-
Notifications
You must be signed in to change notification settings - Fork 3
CommunicationOut
This activity class is in charge of taking a picture and uploading it to Twitter. This activity extends AppCpmpatActivity
for basic layout functionality and implements CameraFragmentResultListener
, which enables the image taking process.
Here the activity's layout is inflated and the camera fragment is initialized. Afterwards, by a delay of 3 seconds, the takeAPicture()
method is called upon to take the image.
This method uses the camera fragment to obtain an image. The image is saved to file.
This is a method implemented by CameraFragmentResultListener
, it is called immediately once a picture is captured on a camera fragment. This method calls postToTwitter()
and sends to it the image's file path. Furthermore, this method creates an intent for CentralHub
and starts it after a delay of 3 seconds. The delay allows the app enough time to upload the image prior to returning to the app's main activity.
- Parameters:
-
byte[] bytes
: this contains the image information. -
String filepath
: this contains the image's file address and is sent topostToSlack()
.
-
A similar function to onPhotoTaken()
, although only triggered when a video is recorded. This method is not used in this project scope, but is present due to the CameraFragmentResultListener
implementation.
This method posts an image to Slack with a caption.
- Parameters:
-
String filePath
: the image's file address for retrieval. -
String channel
: Slack channel to post on.
-