java.lang.Object | |
↳ | com.neomades.media.Camera |
Camera features to take pictures or videos.
To use this class, the CAMERA
permission must be declared in the
URS file.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static Camera |
getDefault()
Returns the default camera device.
| ||||||||||
static boolean |
hasCamera()
Returns if the device has a camera feature.
| ||||||||||
static boolean |
hasGallery()
Returns if the device has a gallery feature.
| ||||||||||
Camera |
setActionTitle(int textResID)
Sets the title of the dialog allowing to choose between the camera
application and the gallery.
| ||||||||||
Camera |
setActionTitle(String text)
Sets the title of the dialog allowing to choose between the camera
application and the gallery.
| ||||||||||
Camera |
setCameraActionText(int textResID)
Sets the text for the action "Camera" button.
| ||||||||||
Camera |
setCameraActionText(String text)
Sets the text for the action "Camera" button.
| ||||||||||
Camera |
setCancelActionText(String text)
Sets the text for the action "Cancel" button.
| ||||||||||
Camera |
setCancelActionText(int textResID)
Sets the text for the action "Cancel" button.
| ||||||||||
Camera |
setGalleryActionText(String text)
Sets the text for the action "Gallery" button.
| ||||||||||
Camera |
setGalleryActionText(int textResID)
Sets the text for the action "Gallery" button.
| ||||||||||
Camera |
setPauseActionText(int textResID)
Sets the text for the action "Pause" button.
| ||||||||||
Camera |
setPauseActionText(String text)
Sets the text for the action "Pause" button.
| ||||||||||
Camera |
setPlayActionText(int textResID)
Sets the text for the action "Play" button.
| ||||||||||
Camera |
setPlayActionText(String text)
Sets the text for the action "Play" button.
| ||||||||||
Camera |
setRecordActionText(String text)
Sets the text for the action "Record" button.
| ||||||||||
Camera |
setRecordActionText(int textResID)
Sets the text for the action "Record" button.
| ||||||||||
Camera |
setSelectActionText(int textResID)
Sets the text for the action "Select" button.
| ||||||||||
Camera |
setSelectActionText(String text)
Sets the text for the action "Select" button.
| ||||||||||
Camera |
setStopActionText(String text)
Sets the text for the action "Stop" button.
| ||||||||||
Camera |
setStopActionText(int textResID)
Sets the text for the action "Stop" button.
| ||||||||||
void |
takePicture(CameraListener callback)
Opens a dialog giving the user the choice to launch whether a picture gallery
or a camera application to take a picture.
| ||||||||||
void |
takePictureFromCamera(CameraListener callback)
Launches application chooser for the user to choose a camera application to
take a picture.
| ||||||||||
void |
takePictureFromGallery(CameraListener callback)
Launches application chooser for the user to choose a gallery application to
choose a picture.
| ||||||||||
void |
takeVideo(CameraListener callback)
Opens a dialog giving the user the choice to launch whether a picture gallery
or a camera application to take a video.
| ||||||||||
void |
takeVideoFromCamera(CameraListener callback)
Launches application chooser for the user to choose a camera application to
take a video.
| ||||||||||
void |
takeVideoFromGallery(CameraListener callback)
Launches application chooser for the user to choose a gallery application to
choose a video.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns the default camera device.
If the CAMERA
permission is not declared, calling this method
may throw a SecurityException
.
Returns if the device has a camera feature.
If the CAMERA
permission is not declared, calling this method
may throw a SecurityException
.
Returns if the device has a gallery feature.
If the PHOTO_LIBRARY
permission is not declared, calling this
method may throw a SecurityException
.
Sets the title of the dialog allowing to choose between the camera application and the gallery. This dialog is used by the following platforms :
Default text is : "Select source application"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the title to set. |
---|
Sets the title of the dialog allowing to choose between the camera application and the gallery. This dialog is used by the following platforms :
Default text is : "Select source application"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the title to set. |
---|
Sets the text for the action "Camera" button. This dialog is used by the following platforms :
Default text is : "Camera"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the camera action name to set. |
---|
Sets the text for the action "Camera" button. This dialog is used by the following platforms :
Default text is : "Camera"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the camera action name to set. |
---|
Sets the text for the action "Cancel" button. This dialog is used by the following platforms :
Default text is : "Cancel"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the cancel action name to set. |
---|
Sets the text for the action "Cancel" button. This dialog is used by the following platforms :
Default text is : "Cancel"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the cancel action name to set. |
---|
Sets the text for the action "Gallery" button. This dialog is used by the following platforms :
Default text is : "Gallery"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the gallery action name to set. |
---|
Sets the text for the action "Gallery" button. This dialog is used by the following platforms :
Default text is : "Gallery"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the gallery action name to set. |
---|
Sets the text for the action "Pause" button. This dialog is used by the following platforms :
Default text is : "Pause"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the pause action name to set. |
---|
Sets the text for the action "Pause" button. This dialog is used by the following platforms :
Default text is : "Pause"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the pause action name to set. |
---|
Sets the text for the action "Play" button. This dialog is used by the following platforms :
Default text is : "Play"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the play action name to set. |
---|
Sets the text for the action "Play" button. This dialog is used by the following platforms :
Default text is : "Play"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the play action name to set. |
---|
Sets the text for the action "Record" button. This dialog is used by the following platforms :
Default text is : "Record"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the record action name to set. |
---|
Sets the text for the action "Record" button. This dialog is used by the following platforms :
Default text is : "Record"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the record action name to set. |
---|
Sets the text for the action "Select" button. This dialog is used by the following platforms :
Default text is : "Select"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the select action name to set. |
---|
Sets the text for the action "Select" button. This dialog is used by the following platforms :
Default text is : "Select"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the select action name to set. |
---|
Sets the text for the action "Stop" button. This dialog is used by the following platforms :
Default text is : "Stop"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
text | the stop action name to set. |
---|
Sets the text for the action "Stop" button. This dialog is used by the following platforms :
Default text is : "Stop"
This method should be called once before calling actions (takePicture(CameraListener)
or takeVideo(CameraListener)
)/
textResID | the resource id of the stop action name to set. |
---|
Opens a dialog giving the user the choice to launch whether a picture gallery
or a camera application to take a picture.
Once the picture was taken, it will be available in the application via the
CameraListener
parameter.
NB. the PHOTO_LIBRARY
and CAMERA
permissions need
to be activated in the URS to use this method.
Android
, if the picture is
taken from the camera, it may be saved on the file system and available in
the gallery depending on the default behavior of the application that takes
the picture.callback | camera listener to call after picture action. |
---|
NullPointerException | if the callback parameter is null |
---|---|
MediaException | if the method has been called with a device without camera feature |
Launches application chooser for the user to choose a camera application to
take a picture.
Once the picture was taken, it will be available in the application via the
CameraListener
parameter.
NB. the CAMERA
permission needs to be activated in the URS to
use this method.
Android
, the picture may
be saved on the file system and available in the gallery depending on the
default behavior of the application that takes the picture.callback | camera listener to call after the picture has been taken. |
---|
NullPointerException | if the callback parameter is null |
---|---|
MediaException | if the method has been called with a device without camera feature |
Launches application chooser for the user to choose a gallery application to
choose a picture.
Once the picture was chosen, it will be available in the application via the
CameraListener
parameter.
NB. the PHOTO_LIBRARY
permission needs to be activated in the
URS to use this method.
callback | camera listener to call after picture selection. |
---|
NullPointerException | if the callback parameter is null
|
---|
Opens a dialog giving the user the choice to launch whether a picture gallery
or a camera application to take a video.
Once the video was taken, it will be available in the application via the
CameraListener
parameter.
NB. the PHOTO_LIBRARY
and CAMERA
permissions need
to be activated in the URS to use this method.
Android
, if the video is
taken from the camera, it may be saved on the file system and available in
the gallery depending on the default behavior of the application that takes
the video.callback | camera listener to call after video action. |
---|
NullPointerException | if the callback parameter is null |
---|---|
MediaException | if the method has been called with a device without camera feature |
Launches application chooser for the user to choose a camera application to
take a video.
Once the video was taken, it will be available in the application via the
CameraListener
parameter.
NB. the CAMERA
permission needs to be activated in the URS to
use this method.
Android
, the video may be
saved on the file system and available in the gallery depending on the
default behavior of the application that takes the video.callback | camera listener to call after the video record. |
---|
NullPointerException | if the callback parameter is null |
---|---|
MediaException | if the method has been called with a device without camera feature |
Launches application chooser for the user to choose a gallery application to
choose a video.
Once the video was chosen, it will be available in the application via the
CameraListener
parameter.
NB. the PHOTO_LIBRARY
permission needs to be activated in the
URS to use this method.
callback | camera listener to call after video selection. |
---|
NullPointerException | if the callback parameter is null
|
---|