The THETA Z1 comes with a 128x24 OLED display that you can display images and text on.
Using RICOH’s official documentation, I was able to quickly customize the display with theta360.guide branding. The documentation provides information on Broadcast Intent keys and values. If you are new to Broadcast Intent, see my article Simple Explanation of Broadcast Intent for RICOH THETA Development.
Code Example
If you are eager, this is the core code example in this tutorial:
public class MainActivity extends PluginActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setAutoClose(true);
notificationAudioSelf();
Intent oledIntentSet = new Intent("com.theta360.plugin.ACTION_OLED_DISPLAY_SET");
oledIntentSet.putExtra("display", "plug-in");
sendBroadcast(oledIntentSet);
Intent oledIntent = new Intent("com.theta360.plugin.ACTION_OLED_TEXT_SHOW");
oledIntent.putExtra("text-middle", "theta360.guide");
oledIntent.putExtra("text-bottom", "great community");
sendBroadcast(oledIntent);
}
}
Steps
Open Android Studio
Create Empty Activity
- Create New Project
- Create Empty Activity
Add pluginlibrary
Project: build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url 'https://github.com/ricohapi/theta-plugin-library/raw/master/repository' }
}
}
App: build.gradle
dependencies {
...
implementation 'com.theta360:pluginlibrary:2.0.0'
}
Set MainActivity to extend PluginActivity
The rest of the steps refer to MainActivity.java
public class MainActivity extends PluginActivity {
You need to import PlugActivity with Alt-Enter.
Set plug-in to close
Put this line in onCreate
setAutoClose(true);
If the camera locks up. You can force close it by pressing the Wi-Fi button and holding down the power button.
Enable Plug-in to Control OLED
You need this step to allow the plug-in to control the OLED display. If you don’t set the display to “plug-in”, your intent to control the display will be ignored.
Intent oledIntentSet = new Intent("com.theta360.plugin.ACTION_OLED_DISPLAY_SET");
oledIntentSet.putExtra("display", "plug-in");
sendBroadcast(oledIntentSet);
Set Your Message
There are two lines. If you extend beyond the display, the text will scroll.
Intent oledIntent = new Intent("com.theta360.plugin.ACTION_OLED_TEXT_SHOW");
oledIntent.putExtra("text-middle", "theta360.guide");
oledIntent.putExtra("text-bottom", "great community");
sendBroadcast(oledIntent);