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.

Contents

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.

When the THETA Plug-in library is not used:

Intent intent = new Intent("com.theta360.plugin.ACTION_LED_SHOW");
intent.putExtra("target", "LED3");
intent.putExtra("color",  "blue");
sendBroadcast(intent);   

When using the THETA Plug-in library:

notificationLed3Show( LedColor.BLUE );

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.

When the THETA Plug-in library is not used:

Intent intent = new Intent("com.theta360.plugin.ACTION_LED_BLINK");
intent.putExtra("target", "LED3");
intent.putExtra("color",  "blue");
intent.putExtra(”period”, "250");
sendBroadcast(intent);

When using the THETA Plug-in library:

notificationLedBlink("LED3", "blue", "250");

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.

When the THETA Plug-in library is not used:

Intent intent = new Intent("com.theta360.plugin.ACTION_LED_HIDE");
intent.putExtra("target", "LED3");
sendBroadcast(intent);

When using the THETA Plug-in library:

notificationLedHide("LED3");

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.

Firmware Ver 1.20.1 or later, the entire OLED (128x36) can now display bitmap images.

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.

When the THETA Plug-in library is not used:

// Bitmap size is height 24 or 36 and width 128
Bitmap image = Bitmap.createBitmap(128, 24, Bitmap.Config.ARGB_8888 );//All black image

Intent intent = new Intent(com.theta360.plugin.ACTION_OLED_IMAGE_SHOW);
intent.putExtra(bitmap, image);
sendBroadcast(intent);

When using the THETA Plug-in library:

Bitmap image = Bitmap.createBitmap(128, 24, Bitmap.Config.ARGB_8888 );//All black image

notificationOledImageShow(image);

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.

When the THETA Plug-in library is not used:

//Bitmap size is height 24 or 36 and width 128
Bitmap image = Bitmap.createBitmap(128, 24, Bitmap.Config.ARGB_8888 );//All black image

Intent intent = new Intent(com.theta360.plugin.ACTION_OLED_IMAGE_BLINK);
intent.putExtra(bitmap, image);
intent.putExtra(period, 250);
sendBroadcast(intent);

When using the THETA Plug-in library:

Bitmap image = Bitmap.createBitmap(128, 24, Bitmap.Config.ARGB_8888 );//All black image

notificationOledImageBlink(image, 250);

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.

From firmware Ver 1. 20. 1, it is possible to display in the top 1/3 area (128x12).

Key Type Description
text-top String ASCII printable characters (32 - 126)
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.

When the THETA Plug-in library is not used:

Intent intent = new Intent(Constants.ACTION_OLED_TEXT_SHOW);
intent.putExtra("text-middle", "This is a sample characters");
sendBroadcast(intent);

When using the THETA Plug-in library:

Map<TextArea, String> output = new HashMap<>() ;
output.put(TextArea.TOP, "This is a sample characters to top area.");
output.put(TextArea.MIDDLE, "This is a sample characters to middle area.");
output.put(TextArea.BOTTOM, "This is a sample characters to bottom area.");
notificationOledTextShow(output);

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.

When the THETA Plug-in library is not used:

sendBroadcast(new Intent("com.theta360.plugin.ACTION_OLED_HIDE"));

When using the THETA Plug-in library:

notificationOledHide();

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.

When the THETA Plug-in library is not used:

*You can set the brightness of LED1 or LED2 as well as OLED.

 Intent intent = new Intent("com.theta360.plugin.ACTION_LED_BRIGHTNESS_SET");
 intent.putExtra("target", "OLED");
 intent.putExtra("brightness", 25);
 sendBroadcast(intent);

When using the THETA Plug-in library:

notificationLedBrightnessSet("OLED", 25);

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.

When the THETA Plug-in library is not used:

Intent intent = new Intent("com.theta360.plugin.ACTION_OLED_DISPLAY_SET");
intent.putExtra("display", "basic");
sendBroadcast(intent);

When using the THETA Plug-in library:

notificationOledDisplaySet("basic");

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”

When the THETA Plug-in library is not used:

sendBroadcast(new Intent("com.theta360.plugin.ACTION_AUDIO_SHUTTER"));

When using the THETA Plug-in library:

*Each Intent has its own method.

notificationAudioShutter();

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”

When the THETA Plug-in library is not used:

sendBroadcast(new Intent("com.theta360.plugin.ACTION_WLAN_OFF"));

When using the THETA Plug-in library:

*Each Intent has its own method.

notificationWlanOff();

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”]

When the THETA Plug-in library is not used:

Intent intent = new Intent("com.theta360.plugin.ACTION_DATABASE_UPDATE");
intent.putExtra("targets", "DCIM/100RICOH/R0010001.JPG");
sendBroadcast(intent);

When using the THETA Plug-in library:

notificationDatabaseUpdate("DCIM/100RICOH/R0010001.JPG");

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.

When the THETA Plug-in library is not used:

sendBroadcast(new Intent("com.theta360.plugin.ACTION_ERROR_OCCURED"));

When using the THETA Plug-in library:

notificationErrorOccured();

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.

When the THETA Plug-in library is not used:

Intent intent = new Intent("com.theta360.plugin.ACTION_FINISH_PLUGIN");
intent.putExtra("packageName", "The name of the package you are creating.");
intent.putExtra("exitStatus", "success");
sendBroadcast(intent);

When using the THETA Plug-in library:

notificationSuccess();

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 the THETA Plug-in library is not used:

sendBroadcast(new Intent("com.theta360.plugin.ACTION_MAIN_CAMERA_CLOSE"));

When using the THETA Plug-in library:

notificationCameraClose();

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.

When the THETA Plug-in library is not used:

sendBroadcast(new Intent("com.theta360.plugin.ACTION_MAIN_CAMERA_OPEN"));

When using the THETA Plug-in library:

notificationCameraOpen();