Skip to content

Commit 35cd775

Browse files
tguegan-msysyannchevalier
authored andcommitted
[Offscreen] Adding Offscreen Interactivity Sample
1 parent 6ef442e commit 35cd775

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2460
-0
lines changed

LICENSES/surface-duo-sdk.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ NB: the Recognizer API is available from iink SDK 2.1.
7575

7676
For more details on the sample, read more [here](https://github.com/MyScript/interactive-ink-additional-examples-android/blob/master/java/samples/write-to-type/ReadMe.pdf).
7777

78+
5. The offscreen-interactivity samples shows how to integrate MyScript iink SDK interactivity with your own rendering.
79+
It drives the content model by sending the captured strokes to iink SDK and keeps the incremental recognition principle and gesture notifications.
80+
This sample uses a third-party rendering library to manage the captured strokes and display its model, and get real-time recognition results and gesture notifications.
81+
82+
<div align="center">
83+
<img src="offscreen-sample.gif" alt="offscreen interacticity sample" width="302">
84+
</div>
85+
7886
## Documentation
7987

8088
A complete guide is available on [MyScript Developer Portal](https://developer.myscript.com/docs/interactive-ink/latest/android/).

build.gradle

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
5+
6+
android {
7+
namespace 'com.myscript.iink.offscreen.demo'
8+
9+
compileSdk project.ext.compileSdk
10+
11+
buildFeatures {
12+
viewBinding true
13+
}
14+
15+
defaultConfig {
16+
minSdk project.ext.minSdk
17+
targetSdk project.ext.targetSdk
18+
19+
applicationId 'com.myscript.iink.offscreen.demo'
20+
}
21+
}
22+
23+
dependencies {
24+
implementation "androidx.appcompat:appcompat:${project.ext.appcompatVersion}"
25+
implementation 'androidx.core:core-ktx:1.7.0'
26+
implementation 'androidx.fragment:fragment-ktx:1.5.7'
27+
implementation 'com.google.android.material:material:1.9.0'
28+
implementation 'com.google.code.gson:gson:2.10.1'
29+
30+
def lifecycle_version = "2.6.1"
31+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
32+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
33+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
34+
35+
implementation project(':UIReferenceImplementation')
36+
implementation project(':myscript-certificate')
37+
38+
testImplementation 'junit:junit:4.13.2'
39+
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1'
40+
testImplementation 'androidx.arch.core:core-testing:2.2.0'
41+
}
42+
43+
task copyRecognitionAssets(type: Copy) {
44+
from "${projectDir}/../../../../recognition-assets"
45+
into "${projectDir}/src/main/assets"
46+
}
47+
48+
preBuild.dependsOn(copyRecognitionAssets)

build_android.gradle

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
5+
6+
android {
7+
namespace 'com.myscript.iink.offscreen.demo'
8+
9+
compileSdk project.ext.compileSdk
10+
11+
buildFeatures {
12+
viewBinding true
13+
}
14+
15+
defaultConfig {
16+
minSdk project.ext.minSdk
17+
targetSdk project.ext.targetSdk
18+
19+
applicationId 'com.myscript.iink.offscreen.demo'
20+
}
21+
}
22+
23+
dependencies {
24+
def lifecycle_version = "2.6.1"
25+
implementation "androidx.appcompat:appcompat:${project.ext.appcompatVersion}"
26+
implementation 'com.google.code.gson:gson:2.10.1'
27+
implementation 'androidx.core:core-ktx:1.10.1'
28+
implementation 'androidx.fragment:fragment-ktx:1.5.7'
29+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
30+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
31+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
32+
implementation libs.material
33+
34+
implementation project(':UIReferenceImplementation')
35+
implementation project(':myscript-certificate')
36+
37+
testImplementation 'junit:junit:4.13.2'
38+
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1'
39+
testImplementation 'androidx.arch.core:core-testing:2.2.0'
40+
}
41+
42+
task copyRecognitionAssets(type: Copy) {
43+
from "${projectDir}/../../../../recognition-assets"
44+
into "${projectDir}/src/main/assets"
45+
}
46+
47+
preBuild.dependsOn(copyRecognitionAssets)

offscreen-sample.gif

71.9 KB
Loading

src/main/AndroidManifest.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:icon="@mipmap/ic_launcher"
7+
android:label="@string/app_name"
8+
android:roundIcon="@mipmap/ic_launcher_round"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme"
11+
android:fullBackupContent="false"
12+
android:name="com.myscript.iink.demo.inksample.InkApplication">
13+
<activity android:name="com.myscript.iink.demo.inksample.ui.MainActivity"
14+
android:exported="true">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
<category android:name="android.intent.category.LAUNCHER" />
18+
</intent-filter>
19+
</activity>
20+
</application>
21+
22+
</manifest>

0 commit comments

Comments
 (0)