java.lang.Object | ||
↳ | sofia.app.internal.AbsActivityStarter | |
↳ | sofia.content.PhotoCamera |
Allows the user to take a photo using the camera on his or her device.
This class should be used from an event handler in a Screen
subclass. Display the camera by calling the start(Activity)
method. When a photo is taken and saved, the photoWasTaken
method
will be called on the screen, if it exists. For example:
public class MyScreen extends Screen { public void buttonClicked() { PhotoCamera camera = new PhotoCamera(); camera.start(this); } public void photoWasTaken(PhotoCamera camera) { // Do something with the image by calling camera.getBitmap(), // camera.getUri(), or camera.getPath(). } }
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PhotoCamera()
Initializes a new photo camera.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Bitmap |
getBitmap()
A convenience method that returns the photo as a
Bitmap . | ||||||||||
String |
getPath()
Gets the file system path of the photo that was taken by the camera.
| ||||||||||
Uri |
getUri()
Gets the
Uri (uniform resource identifier) of the photo that was
taken by the camera. | ||||||||||
void | handleActivityResult(Activity owner, Intent data, int requestCode, int resultCode) | ||||||||||
void |
start(Activity owner, String callback)
Displays the camera application.
| ||||||||||
void |
start(Activity owner)
Displays the camera application.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | getDefaultCallback() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
sofia.app.internal.AbsActivityStarter
| |||||||||||
From class
java.lang.Object
|
Initializes a new photo camera.
A convenience method that returns the photo as a Bitmap
.
Bitmap
that represents the photo that was taken
Gets the file system path of the photo that was taken by the camera.
Displays the camera application. When the user has taken a photo, the
owning Activity
(or Screen
) will have the method with
the name specified by method
called.
owner | the activity or screen that owns this photo camera that will receive a notification when a photo is taken |
---|
Displays the camera application. When the user has taken a photo, the
owning Activity
(or Screen
) will have its
photoWasTaken
method called.
owner | the activity or screen that owns this photo camera that will receive a notification when a photo is taken |
---|