Broadcast Intent
Use Broadcast Intent to tell the plug-in that it has received a camera button operation. Broadcast Intent is also used when the plug-in controls the camera.
Supported by SDK
The SDK supports button events, LED control, and speaker control. For details, please see how to use the SDK.
Receiving Button Events
When the camera button is pressed down or pushed up, Broadcast Intent is set. Combinations of button operation and the intent are as follows:
Button Operation | Intent |
---|---|
Pushed down | “com.theta360.plugin.ACTION_KEY_DOWN” |
Pushed up | “com.theta360.plugin.ACTION_KEY_UP” |
The button type when pressed down or pushed up is listed below in the Broadcast Intent extension data:
Key | Type | Description |
---|---|---|
“keyCode” | int | (RICOH THETA V) 27: Shutter Button, 130: Mode Button, 284: Wireless Button can be specified (RICOH THETA Z1) 27: Shutter Button, 119: Fn Button, 130: Mode Button, 284: Wireless Button can be specified |
“KeyEvent” | KeyEvent | KeyEvent object received from OS |
Control the LEDs
The following functionality is for RICOH THETA V.
Plug-ins can control LEDs on the camera including LED3, LED4, LED5, LED6, LED7, LED8 (turn on / blink / turn off).
Turning on LEDs
When using “com.theta360.plugin.ACTION_LED_SHOW” with Broadcast Intent, the LED will light up. When using Broadcast Intent, the following extension data must be set:
Key | Type | Description |
---|---|---|
target | String | Choose from “LED3”, “LED4”, “LED5”, “LED6”, “LED7”, “LED8” |
color | String | Choose from “blue”, “green”, “red”, “cyan”, “magenta”, “yellow”, “white”. Default is ”blue”. |
With target, set the target LED to be turned on. If target is not specified, Broadcast Intent is ignored. With color, set the luminescent color. Valid only when target is set to LED3.
When Broadcast Intent is used, whether the target LED is already on or already off, processing the LED will be cancelled and start with the requested lighting.
Blinking LEDs
When using “com.theta360.plugin.ACTION_LED_BLINK” with Broadcast Intent, the LED will blink. When using Broadcast Intent, the following extension data must be set:
Key | Type | Description |
---|---|---|
target | String | Choose from “LED3”, “LED4”, “LED5”, “LED6”, “LED7”, “LED8” |
color | String | Choose from “blue”, “green”, “red”, “cyan”, “magenta”, “yellow”, “white”. Default is “blue”. |
period | int | 1-2000 (msec). Default is 2000. |
With target, set the target LED to blink. If target is not specified, Broadcast Intent is ignored. With color, set the luminescent color. Valid only when target is set to LED3. Use period to set 1 cycle time period.
When Broadcast Intent is used, whether the target LED is already on or already off, processing the LED will be cancelled and start with the requested lighting.
Turning off LEDs
When using “com.theta360.plugin.ACTION_LED_HIDE” with Broadcast Intent, the LED will turn off. When using Broadcast Intent, the following extension data must be set:
Key | Type | Description |
---|---|---|
target | String | Choose from “LED3”, “LED4”, “LED5”, “LED6”, “LED7”, “LED8” |
When Broadcast Intent is used, whether the target LED is already on or already off, processing the LED will be cancelled and start with the requested lighting.
With target, set target LED to turn off. If target is not specified, Broadcast Intent is ignored. When Broadcast Intent is used, whether the target LED is already on or already off, processing the LED will be cancelled and start with the requested lighting.
Control the OLED
The following functionality is for RICOH THETA Z1.
Plug-ins can control the OLED.
Displaying Images
By setting Broadcast Intent to “com.theta360.plugin.ACTION_OLED_IMAGE_SHOW” you can display images on the OLED.
Images are displayed in the lower 2/3 area (128 x 24) of the OLED. Extended data is mandatory for Broadcast Intent below.
Key | Type | Description |
---|---|---|
bitmap | Bitmap | 128x24 Bitmap |
Specify the image to be displayed with bitmap. If no image is specified, or if the size is not 128 x 24 Broadcast Intent will be ignored.
When using Broadcast Intent, regardless of whether the OLED is already on or blinking, processing stops and the specified image is displayed.
Flashing Image
By setting broadcast intent to “com.theta360.plugin.ACTION_OLED_IMAGE_BLINK” you can set it to flash images on the OLED.
Images are displayed in the lower 2/3 area (128 x 24) of the OLED. Extended data is mandatory for the broadcast intent below.
Key | Type | Description |
---|---|---|
bitmap | Bitmap | 128x24 Bitmap |
period | Integer | 250-2000 (msec). Default is 2000. |
Specify the image to be displayed with bitmap. If no image is specified, or if the size is not 128 x 24, Broadcast Intent will be ignored.
When using Broadcast Intent, regardless of whether the OLED is already on or blinking, processing stops and the specified image is displayed.
Displaying Characters
By setting Broadcast Intent to “com.theta360.plugin.ACTION_OLED_TEXT_SHOW” you can display characters on the OLED.
Characters are displayed in the lower 1/3 area (128x12) or in the middle 1/3 area (128x12). Extended data is mandatory for Broadcast Intent below.
Key | Type | Description |
---|---|---|
text-middle | String | ASCII printable characters (32 - 126) |
text-bottom | String | ASCII printable characters (32 - 126) |
Characters set as middle display characters are displayed in the plug-in name area. Characters set as lower display characters are displayed in the blank area.
When Broadcast Intent is used, only the part corresponding to the specified key is rewritten and displaying is started.
OLED Turns Off
By setting Broadcast Intent to “com.theta360.plugin.ACTION_OLED_HIDE” you can turn off the OLED.
When using Broadcast Intent, regardless of whether the OLED is already on or blinking, processing stops and the OLED turns off.
Setting Brightness
By setting Broadcast Intent to “com.theta360.plugin.ACTION_LED_BRIGHTNESS_SET” you can set the brightness of LED1, LED2 and the OLED. Extended data is mandatory for Broadcast Intent below.
Key | Type | Description |
---|---|---|
target | String | Choose from “LED1”, “LED2”, “OLED” |
brightness | Integer | 0-100(%).Default is 25. |
Set the target LED’s brightness to change with target. If target is not specified, Broadcast Intent will be ignored.
Set the brightness value with brightness. If brightness is not specified, Broadcast Intent will be ignored.
Display Method Settings
By setting Broadcast Intent to “com.theta 360.plugin.ACTION_OLED_DISPLAY_SET” the plug-in mode display or basic display can be set. Extended data is mandatory for Broadcast Intent below.
Key | Type | Description |
---|---|---|
display | String | Choose from “plug-in”,“”basic” |
If display is not specified, Broadcast Intent will be ignored. When the display method is set to basic display, the following Broadcast Intent is ignored:
- “com.theta360.plugin.ACTION_OLED_IMAGE_SHOW”
- “com.theta360.plugin.ACTION_OLED_IMAGE_BLINK”
- “com.theta360.plugin.ACTION_OLED_TEXT_SHOW”
- “com.theta360.plugin.ACTION_OLED_HIDE”
When the display method is changed from basic display to plug-in mode display, the plug-in name is displayed in the plug-in name area.
Controlling Speakers
Plug-ins can use the camera’s audio files. Using Broadcast Intent for each audio file you can play audio files.
Audio File | Intent |
---|---|
Shutter Audio | “com.theta360.plugin.ACTION_AUDIO_SHUTTER” |
Shutter Audio Start | “com.theta360.plugin.ACTION_AUDIO_SH_OPEN” |
Shutter Audio End | “com.theta360.plugin.ACTION_AUDIO_SH_CLOSE” |
Video Recording Start Audio | “com.theta360.plugin.ACTION_AUDIO_MOVSTART” |
Video Recording Stop Audio | “com.theta360.plugin.ACTION_AUDIO_MOVSTOP” |
Self Timer Audio | “com.theta360.plugin.ACTION_AUDIO_SELF” |
Warning Audio | “com.theta360.plugin.ACTION_AUDIO_WARNING” |
Controlling WLAN
Plug-ins can control WLAN. WLAN can be controlled by using Broadcast Intent corresponding to each WLAN operation mode.
Operation Mode | Intent |
---|---|
OFF | “com.theta360.plugin.ACTION_WLAN_OFF” |
AP Mode | “com.theta360.plugin.ACTION_WLAN_AP” |
CL Mode | “com.theta360.plugin.ACTION_WLAN_CL” |
Updating the Database
RICOH THETA V and Z1 save image data in a database. When image data is moved or deleted, it is necessary to update the database so that inconsistencies does not occur in the database.
When using “com.theta360.plugin.ACTION_DATABASE_UPDATE” with Broadcast Intent, the database will be updated. When using Broadcast Intent, the following extension data must be set:
Key | Type | Description |
---|---|---|
targets | String Array | Directory path or file path array |
With targets, specify the updated target file. If targets is not specified, Broadcast Intent is ignored. If you specify a directory, the files under that directory will be updated. Specify the path /sdcard/DCIM directory as below. It can be included even if the directory path or file path contains uppercase / lowercase letters.
Example: [“DCIM/100RICOH/R0010001.JPG”,”DCIM/101RICOH”]
Notifying Occurrences of Errors
When using “com.theta360.plugin.ACTION_ERROR_OCCURED” with Broadcast Intent, a notification that an error in the plugin has occurred will be sent. When receiving this notification, the camera plays a warning tone and blinks LED2 in red.
Notifying Completion of Plug-in
When using “com.theta360.plugin.ACTION_FINISH_PLUGIN” with Broadcast Intent, notification of the completion of the plug-in will be sent. When using Broadcast Intent, the following extension data must be set:
Key | Type | Description |
---|---|---|
packageName | String | Package Name |
exitStatus | String | “success” or “failure”. Default is “success”. |
message | String | Optional. Default is an empty string. |
With packageName, specify the package name of the plugin itself. With exitStatus, specify “success” when the plug-in ends normally, and “failure” when it ends abnormally. Setting “exitStatus” to “failure” will cause the warning sound to be played and LED2 to blink red.
Notifying Camera Device Control
When using “com.theta360.plugin.ACTION_MAIN_CAMERA_CLOSE” with Broadcast Intent, the fact that the plug-in is controlling camera resources will be reported to the camera, and the Camera API will be able to be used.
When using “com.theta360.plugin.ACTION_MAIN_CAMERA_OPEN” with Broadcast Intent, the fact that the plug-in has released camera resources will be reported to the camera, and the Camera API will not be able to be used.