Package com.bambuser.broadcaster
Class BackendApi
java.lang.Object
com.bambuser.broadcaster.BackendApi
This class contains a few convenience methods for doing requests to Bambuser's API.
Do not invoke on the UI thread.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Author of the uploaded file.static final String
Creation date of the uploaded file.static final String
Arbitrary data stored along with the file.static final String
Name of the file which will be uploaded.static final String
Geo-position accuracy (meters, decimal) of the provided position.static final String
Geo-position latitude (degrees, decimal) of the uploaded file.static final String
Geo-position longitude (degrees, decimal) of the uploaded file.static final String
Short free-text title of the uploaded file, analogous to the title for a Bambuser broadcast.static final String
Type of the file which will be uploaded. -
Method Summary
-
Field Details
-
TICKET_FILE_TYPE
Type of the file which will be uploaded. Mandatory. Values currently supported by the backend are "video" and "image".- See Also:
-
TICKET_FILE_NAME
Name of the file which will be uploaded. Mandatory. The provided file name can be another than the local file name, but the file extension should be correct or the server may reject the upload.- See Also:
-
TICKET_FILE_CREATED
Creation date of the uploaded file. Optional. The date is given as unixtime, in seconds. If no date is supplied, only the time of upload will be available server-side.- See Also:
-
TICKET_FILE_AUTHOR
Author of the uploaded file. Optional.- See Also:
-
TICKET_FILE_TITLE
Short free-text title of the uploaded file, analogous to the title for a Bambuser broadcast. Optional.- See Also:
-
TICKET_FILE_CUSTOM_DATA
Arbitrary data stored along with the file. Max 10KB per uploaded file. Optional.- See Also:
-
TICKET_FILE_POS_LAT
Geo-position latitude (degrees, decimal) of the uploaded file. Optional.- See Also:
-
TICKET_FILE_POS_LON
Geo-position longitude (degrees, decimal) of the uploaded file. Optional.- See Also:
-
TICKET_FILE_POS_ACCURACY
Geo-position accuracy (meters, decimal) of the provided position. Optional.- See Also:
-
-
Method Details
-
getUploadTicketForApplicationId
public static Pair<Integer,String> getUploadTicketForApplicationId(Context context, Map<String, String> params, String applicationId) Method for doing a POST request to the Bambuser ticket API endpoint, requiring a Bambuser-provided application ID. Request always done using HTTPS. This must not be invoked on the UI thread.For further information on using this method, see the UploadHelper class in the example app source.
- Parameters:
context
- A Context object. Must not be null.params
- Parameters for the ticket endpoint. Some are mandatory. Must not be null.applicationId
- Secret Bambuser-provided application specific ID.- Returns:
- A Pair containing the http response code and the response String, if any. The response String is expected to be a JSON object containing an "upload_url", to which the actual file data should be uploaded using a PUT HTTP(S) request.
-