Skip to content

Commit 95c95d8

Browse files
Yuntaek RimEtienneDauphin
authored andcommitted
[samples][write-to-type] add a new sample
1 parent e2d244c commit 95c95d8

30 files changed

+3671
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,26 @@ NB: you will retrieve data converted in your device internal storage: `Android/d
5555
<img src="search-sample.gif" alt="search sample" width="302">
5656
</div>
5757

58+
4. The write to type example gives you a hint how to implement Scribble like feature relying on the Recognizer API of iink SDK. It is based on a contextless gesture recognition combined with a text recognition.
59+
To run both recognitions simultaneously, two instances of Recognizer are created - one for Gesture recognition and the other one for Text recognition:
60+
~~~#!java
61+
static final float INCH_IN_MILLIMETER = 25.4f;
62+
63+
float scaleX = INCH_IN_MILLIMETER / displayMetrics.xdpi;
64+
float scaleY = INCH_IN_MILLIMETER / displayMetrics.ydpi;
65+
66+
Recognizer textRecognizer = engine.createRecognizer(scaleX, scaleY, "Text");
67+
Recognizer gestureRecognizer = engine.createRecognizer(scaleX, scaleY, "Gesture");
68+
~~~
69+
70+
<div align="center">
71+
<img src="write-to-type.gif" alt="write to type sample" width="302">
72+
</div>
73+
74+
NB: the Recognizer API is available from iink SDK 2.1.
75+
76+
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).
77+
5878
## Documentation
5979

6080
A complete guide is available on [MyScript Developer Portal](https://developer.myscript.com/docs/interactive-ink/latest/android/).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
1.07 MB
Binary file not shown.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) MyScript. All rights reserved.
3+
*/
4+
5+
apply plugin: 'com.android.application'
6+
7+
android {
8+
namespace 'com.myscript.iink.samples.writetotype'
9+
compileSdk project.ext.compileSdk
10+
defaultConfig {
11+
applicationId "com.myscript.iink.samples.writetotype"
12+
minSdk project.ext.minSdk
13+
targetSdk project.ext.targetSdk
14+
versionCode project.ext.iinkVersionCode
15+
versionName project.ext.iinkVersionName
16+
}
17+
}
18+
19+
dependencies {
20+
implementation project(':UIReferenceImplementation')
21+
implementation project(':myscript-certificate')
22+
implementation project(':common-kotlin')
23+
24+
implementation "androidx.appcompat:appcompat:${project.ext.appcompatVersion}"
25+
26+
// Google Gson
27+
implementation "com.google.code.gson:gson:${project.ext.gsonVersion}"
28+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (c) MyScript. All rights reserved.
4+
-->
5+
6+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
7+
8+
<uses-permission android:name="android.permission.VIBRATE" />
9+
10+
<application
11+
android:name=".IInkApplication"
12+
android:allowBackup="false"
13+
android:icon="@mipmap/ic_launcher"
14+
android:label="@string/app_name"
15+
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:supportsRtl="true"
17+
android:theme="@style/AppTheme">
18+
19+
<activity
20+
android:name=".MainActivity"
21+
android:label="@string/app_name"
22+
android:exported="true">
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN" />
25+
<category android:name="android.intent.category.LAUNCHER" />
26+
</intent-filter>
27+
</activity>
28+
<activity android:name="com.myscript.iink.app.common.activities.ErrorActivity" />
29+
</application>
30+
31+
</manifest>

0 commit comments

Comments
 (0)