Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Dev/1.0.0

upload result

add wait
  • Loading branch information
osakila committed Nov 14, 2023
0 parents commit 1518ca0
Show file tree
Hide file tree
Showing 480 changed files with 93,066 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/dummy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Dummy for test

on:
workflow_dispatch:

permissions:
contents: read

jobs:
dummy:
if: ${{ false }}
runs-on: ubuntu-latest
steps:
- run: ""
26 changes: 26 additions & 0 deletions .github/workflows/publish-maven.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish Maven

on:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_15.0.1.app/Contents/Developer'
- name: Show Xcode version
run: xcodebuild -version
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: publish maven
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: publish
37 changes: 37 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test

on:
push:
branches: [ "main" ]
paths:
- 'kotlin-multiplatform/**'
- 'react-native/**'
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_15.0.1.app/Contents/Developer'
- name: Show Xcode version
run: xcodebuild -version
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: test-kmm
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: testDebugUnitTest
- name: Archive code coverage results
if: always()
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: kotlin-multiplatform/build/reports/tests/testDebugUnitTest
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.iml
.gradle
.idea
.DS_Store
build
captures
.externalNativeBuild
.cxx
local.properties
xcuserdata
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 RICOH360

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[![test](https://github.com/ricohapi/theta-ble-client/actions/workflows/test.yaml/badge.svg)](https://github.com/ricohapi/theta-ble-client/actions/workflows/test.yaml)

# THETA BLE Client

This library provides a way to control RICOH THETA using [THETA Bluetooth API](https://github.com/ricohapi/theta-api-specs/tree/main/theta-bluetooth-api).
Your app can perform the following actions:
* Take a photo and video
* Acquire the status of THETA
* Acquire and set properties of THETA

## Supported Environments
* Android native (Kotlin)
* iOS native (Swift)
* React Native

## Supported Models
* THETA Z1
* THETA X

## Directory Structure
* theta-ble-client
* demos: Demo applications
* docs: Documentation
* kotlin-multiplatform: Library body ([Kotlin Multiplatform Mobile](https://kotlinlang.org/docs/multiplatform-mobile-getting-started.html))
* react-native: React Native package

## Build

### Android (aar)
```
theta-ble-client$ ./gradlew assemble
```

aar is output to `theta-ble-client-$/kotlin-multiplatform/build/outputs/aar`

### iOS (XCFramework)
```
theta-ble-client$ ./gradlew podPublishXCFramework
```

XCFramework is output to `theta-ble-client$/kotlin-multiplatform/build/cocoapods/publish`

### ReactNative
See README in each directory.(`react-native`)

### Test
```
theta-ble-client$ ./gradlew testReleaseUnitTest
```

## How to Use
See tutorial in `docs` directory.


## License

[MIT License](LICENSE)
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
//trick: for the same plugin versions in all sub-modules
id("com.android.library").version("8.1.2").apply(false)
kotlin("multiplatform").version("1.9.10").apply(false)
kotlin("plugin.serialization").version("1.9.10").apply(false)
id("org.jetbrains.dokka").version("1.9.10")
}

buildscript {
dependencies {
classpath("org.jetbrains.dokka:versioning-plugin:1.9.10")
}
}

tasks.register("clean", Delete::class) {
}
19 changes: 19 additions & 0 deletions demos/demo-android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

/mathlibrary
/spherelibrary
/thetalibrary
21 changes: 21 additions & 0 deletions demos/demo-android/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 RICOH360

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions demos/demo-android/README.ja.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Android demo for theta-ble-client

A simple sample Android application using [theta-ble-client](https://github.com/ricohapi/theta-ble-client).

## 目的

* THETA BLE Clientを使う開発者に、簡単な実例を示す

## Functions

* List photos in Theta.
* View sphere photo in Theta.
* Take a photo with Theta.

## 設計方針

* 非同期処理をコルーチンで書けるKotlinを使う
* UIの簡潔な記述ができる[Jetpack Compose](https://developer.android.com/jetpack/compose?hl=ja)を使う


20 changes: 20 additions & 0 deletions demos/demo-android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Android demo for theta-ble-client

A simple sample Android application using [theta-ble-client](https://github.com/ricohapi/theta-ble-client).

## Objective

* Show developers how to use THETA BLE Client.

## Functions

* List photos in Theta.
* View sphere photo in Theta.
* Take a photo with Theta.

## Policy

* Use Kotlin which coroutine simplifies code that executes asynchronously.
* Use [Jetpack Compose](https://developer.android.com/jetpack/compose) that can describe UI simply.


1 change: 1 addition & 0 deletions demos/demo-android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
85 changes: 85 additions & 0 deletions demos/demo-android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlinx-serialization'
}

android {
compileSdk 34

defaultConfig {
applicationId "com.ricoh360.thetableclient.thetaBleClientDemo"
minSdk 26
targetSdk 34
versionCode 1
versionName "1.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
buildConfig true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
// for JUnit5
testOptions {
unitTests.all {
useJUnitPlatform()
}
unitTests.returnDefaultValues = true // Disable exception "Method e in android.util.Log not mocked."
}
namespace 'com.ricoh360.thetableclient.thetaBleClientDemo'
}

dependencies {

implementation 'androidx.core:core-ktx:1.12.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.compose.runtime:runtime-livedata:1.5.4'
implementation 'androidx.activity:activity-compose:1.8.0'
implementation "androidx.navigation:navigation-compose:2.7.4"
implementation 'androidx.webkit:webkit:1.8.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
implementation 'com.jakewharton.timber:timber:5.0.1'
implementation 'io.coil-kt:coil-compose:2.2.2'

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
testImplementation 'org.junit.jupiter:junit-jupiter'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"

implementation "com.ricoh360.thetaclient:theta-client:1.5.0"

implementation "com.ricoh360.thetableclient:theta-ble-client-android:1.0.0"
}
Loading

0 comments on commit 1518ca0

Please sign in to comment.