Theta-client 1.5 released - Official RICOH THETA Open Source SDK

RICOH released theta-client 1.5. This is an open source SDK available on GitHub. It uses the WebAPI and is designed for iOS and Android mobile app developers. Examples exist for Android Kotlin, iOS Swift, Flutter (iOS and Android), React Native (iOS and Android).

The SDK consists of an open source library to communicate with the RICOH THETA and a set of demos that use the library.

Changes from 1.4.0


personal test with demo-flutter build on Windows for Android

I tested Flutter on Windows since I knew from prior experience that I needed to make a few changes to the settings.

theta-client\demos\demo-flutter> flutter pub get 
Resolving dependencies... (1.2s)
Because demo_flutter depends on theta_client_flutter from path which doesn't exist (Path
  dependency for package theta_client_flutter must refer to a directory, not a file. Was
  "C:\Users\craig\Documents\Development\ricoh\2023\theta-client\demos\demo-flutter\packages\theta_client_flutter".),
 version solving failed.

The error message gives a nice hint at the solution.

In packages/theta_client_flutter the file redirects to the root/flutter folder. This fails on Windows.

image

I’m going to delete the file and replace it with a folder.

image

Now, I have the contents of flutter in packages\theta_client_flutter

flutter pub get now works.

flutter pub get
Resolving dependencies... (1.0s)                                                         
> async 2.11.0 (was 2.10.0)
> characters 1.3.0 (was 1.2.1)
> collection 1.17.2 (was 1.17.0) (1.18.0 available)
  flutter_lints 2.0.3 (3.0.0 available)
  lints 2.0.1 (3.0.0 available)
> matcher 0.12.16 (was 0.12.13)
> material_color_utilities 0.5.0 (was 0.2.0) (0.8.0 available)
> meta 1.9.1 (was 1.8.0) (1.11.0 available)
> path 1.8.3 (was 1.8.2)
> source_span 1.10.0 (was 1.9.1)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
> test_api 0.6.0 (was 0.4.16) (0.6.1 available)
  video_player_avfoundation 2.4.11 (2.5.0 available)
  video_player_web 2.0.17 (2.1.1 available)
+ web 0.1.4-beta (0.3.0 available)
These packages are no longer being depended on:
- js 0.6.5
Changed 11 dependencies!

Launch Emulator

As I’m on Windows, I’ll use an Android emulator. I’ll start it from the command line since I’m using VS Code.

flutter emulators --launch P4

run demo

check for device name

flutter devices   
4 connected devices:

Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)  
Windows (desktop)                  • windows       • windows-x64    • Microsoft Windows [Version      
10.0.19045.3570]
Chrome (web)                       • chrome        • web-javascript • Google Chrome 118.0.5993.89     
Edge (web)                         • edge          • web-javascript • Microsoft Edge 118.0.2088.61 

run

flutter run -d emulator-5554

App comes up with no problems.

testing with physical device Pixel 4a connected physical device theta x

demo

transfer image after capture.

1 Like

MacOS X Build test

./gradlew publishToMavenLocal
Downloading https://services.gradle.org/distributions/gradle-7.3.3-bin.zip
...........10%...........20%...........30%...........40%...........50%...........60%...........70%...........80%...........90%...........100%
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :kotlin-multiplatform:compileReleaseKotlinAndroid

w: file:///Users/craig/Development/ricoh/2023/theta-client/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/ThetaRepository.kt:6946:13 Name shadowed: plugins

> Task :kotlin-multiplatform:compileDebugKotlinAndroid

w: file:///Users/craig/Development/ricoh/2023/theta-client/kotlin-multiplatform/src/commonMain/kotlin/com/ricoh360/thetaclient/ThetaRepository.kt:6946:13 Name shadowed: plugins

BUILD SUCCESSFUL in 5m 33s

81 actionable tasks: 81 executed

craig@Craigs-MacBook-Air theta-client %

Library looks fine.

 pwd
/Users/craig/Development/ricoh/2023/theta-client/kotlin-multiplatform/build/outputs/aar
craig@Craigs-MacBook-Air aar % ls
theta-client-debug.aar    theta-client-release.aar
craig@Craigs-MacBook-Air aar % 

Android Demo

Open demos/demo-android in Android Studio.

Build with Android Studio. Emulator comes up with no problem.

testing with fake-theta


environment

image

kdoctor -v
Environment diagnose:
[✓] Operation System
  ➤ Version OS: macOS 14.1
    CPU: Apple M1

[✓] Java
  ➤ Java (openjdk version "17.0.5" 2022-10-18 LTS)
    Location: /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home/bin/java
  i JAVA_HOME is not set
    Consider adding the following to ~/.zprofile for setting JAVA_HOME
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home

[✓] Android Studio
  ➤ Android Studio (AI-223.8836.35.2231.10811636)
    Location: /Applications/Android Studio.app
    Bundled Java: openjdk 17.0.6 2023-01-17
    Kotlin Plugin: 223-1.9.0-release-358-AS8836.35.2231.10811636
    Kotlin Multiplatform Mobile Plugin: 0.8.0(223)-25
  i Note that, by default, Android Studio uses bundled JDK for Gradle tasks execution.
    Gradle JDK can be configured in Android Studio Preferences under Build, Execution, Deployment -> Build Tools -> Gradle section

[✓] Xcode
  ➤ Xcode (15.0.1)
    Location: /Applications/Xcode.app
  i Xcode JAVA_HOME: /Library/Java/JavaVirtualMachines/amazon-corretto-17.jdk/Contents/Home
    Xcode JAVA_HOME can be configured in Xcode -> Settings -> Locations -> Custom Paths

[✓] Cocoapods
  ➤ ruby (ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23])
  ➤ ruby gems (3.4.10)
  ➤ cocoapods (1.11.3)

Recommendations:
  ➤ IDE doesn't suggest running all tests in file if it contains more than one class
    More details: https://youtrack.jetbrains.com/issue/KTIJ-22078
Conclusion:
  ✓ Your system is ready for Kotlin Multiplatform Mobile Development!

iOS build

./gradlew podPublishXCFramework

> Configure project :kotlin-multiplatform

Error

Execution failed for task ‘:kotlin-multiplatform:linkPodDebugFrameworkIosArm64’.

Hello,
I have Theta-client 1.5 working on this Windows 11 Home laptop for the Android Native Demo using the Android Studio method you showed.

Spec Name
Processor Intel(R) Core™ i7-10710U CPU @ 1.10GHz 1.61 GHz
Installed RAM 16.0 GB (15.8 GB usable)
System type 64-bit operating system, x64-based processor

1 Like

Hi ,

I have Theta-client 1.5 working on my Mac m2 with macOS Sonoma 14.1 for the Android Demo.

An initial error that I think people might run into is settings, after cloning the repo down if you have not set your environment variable for ANDROID_HOME you might have some error about not finding the SDK file. What you would need to do is set the location for it.

To check if you have the variable set up you can run the command

echo $ANDROID_HOME

If you don’t have one and would like to set it up you can run

echo 'export ANDROID_HOME=example_value' >> ~/.zshrc

To find your path, you can check it in your Android Studio >> Settings >> Language & Frame >> Android SDK

After setting it you might want to reload the configuration either turn off your terminal and reopening it or run this command

source ~/.bash_profile  # for Bash
source ~/.zshrc        # for Zsh

Then just run the build

Here is my result with Theta-client

And here is my result with fake-theta

1 Like

@Phat_Ca regarding the problem with iOS build with the newest version of Xcode 15, there appears to be a problem with Kotlin and some libraries.

I ran into this problem myself. We need to either downgrade Xcode or stick to Android. I was already looking into downgrading Xcode when I saw this issue on GitHub.

It’s working now with theta-client 1.6. Upgrade now. :slight_smile: