Browse Source

Merge pull request #568 from valdisvi/android

Documentation and configuration updates for Android
master
Reece H. Dunn 6 years ago
parent
commit
f6ffb69d1c
No account linked to committer's email address
3 changed files with 43 additions and 13 deletions
  1. 34
    8
      README.md
  2. 7
    3
      android/build.gradle
  3. 2
    2
      android/jni/Application.mk

+ 34
- 8
README.md View File

- [Dependencies](#dependencies-1) - [Dependencies](#dependencies-1)
- [Building with Gradle](#building-with-gradle) - [Building with Gradle](#building-with-gradle)
- [Signing the APK](#signing-the-apk) - [Signing the APK](#signing-the-apk)
- [Opening project in Android Studio](#opening-project-in-android-studio)
- [Installing](#installing-1) - [Installing](#installing-1)
- [Documentation](#documentation) - [Documentation](#documentation)
- [eSpeak Compatibility](#espeak-compatibility) - [eSpeak Compatibility](#espeak-compatibility)
- [Feedback](#feedback) - [Feedback](#feedback)
- [License Information](#license-information) - [License Information](#license-information)



---------- ----------


The eSpeak NG (Next Generation) Text-to-Speech program is an open source speech The eSpeak NG (Next Generation) Text-to-Speech program is an open source speech


In order to build the Android APK file, you need: In order to build the Android APK file, you need:


1. the [Android SDK](http://developer.android.com/sdk/index.html) with API 21 support; 1. the [Android Studio](https://developer.android.com/studio/) with API 26 support;
2. the [Android NDK](http://developer.android.com/tools/sdk/ndk/index.html); 2. the [Android NDK](http://developer.android.com/tools/sdk/ndk/index.html);
3. Gradle 2.1 or later. 3. Gradle 3.2.1 or later.


In order to use Android Studio, you will also need: In order to use Android Studio, you will also need:


1. Set the location of the Android SDK: 1. Set the location of the Android SDK:


$ export ANDROID_HOME=<path-to-the-android-sdk> $ export ANDROID_HOME=<path-to-the-android-sdk>
2. Build the project: (where `<path-to-the-android-sdk>` is your actual path of SDK folder e.g. `/home/user/Android/Sdk`)
2. Add location of NDK to the PATH variable:

$ export PATH=$PATH:<path-to-the-android-ndk>
(where `<path-to-the-android-ndk>` is your actual path of NDK folder, e.g. `/home/user/Android/Ndk`)
3. Configure the project:


$ ./autogen.sh $ ./autogen.sh
$ ./configure --with-gradle=<path-to-gradle> $ ./configure --with-gradle=<path-to-gradle>

Check that log shows following lines:

...
gradle (Android): gradle
ndk-build (Android): yes
...
`<path-to-gradle>` may be just `gradle` if it is found in your path by simple name.
4. Build the project:

$ make apk-release $ make apk-release


This will create an `android/build/outputs/apk/espeak-release-unsigned.apk` file. This will create an `android/build/outputs/apk/espeak-release-unsigned.apk` file.


1. Creating a certificate, if you do not already have one: 1. Creating a certificate, if you do not already have one:


$ keytool -genkey -keystore [YOUR_CERTIFICATE] -alias [ALIAS] $ keytool -genkey -keystore [YOUR_CERTIFICATE] -alias [ALIAS] -keyalg RSA -storetype PKCS12
2. Sign the package using your certificate: 2. Sign the package using your certificate:


$ jarsigner -sigalg MD5withRSA -digestalg SHA1 \ $ jarsigner -sigalg MD5withRSA -digestalg SHA1 \
-keystore [YOUR_CERTIFICATE] \ -keystore [YOUR_CERTIFICATE] \
android/build/outputs/apk/espeak-release-unsigned.apk [ALIAS] android/build/outputs/apk/release/espeak-release-unsigned.apk [ALIAS]
3. Align the apk using the zipalign tool. 3. Align the apk using the zipalign tool.


$ zipalign 4 android/build/outputs/apk/espeak-release-unsigned.apk \ $ zipalign 4 android/build/outputs/apk/release/espeak-release-unsigned.apk \
android/build/outputs/apk/espeak-release-signed.apk android/build/outputs/apk/release/espeak-release-signed.apk


### Opening project in Android Studio

To open project in **Android Studio** select **Import project (Gradle, Eclipse ADT, etc)**
and select `android` folder of the `espeak-ng` project.

Then select menu **File — Project Structure...**, tab **SDK Location**, field **Android NDK location**
and set your location of NDK, e.g. `/home/user/Android/Ndk`.


### Installing ### Installing


Now, you can install the APK using the `adb` tool: Now, you can install the APK using the `adb` tool:


$ adb install -r android/build/outputs/apk/espeak-release-signed.apk $ adb install -r android/build/outputs/apk/release/espeak-release-signed.apk


After running, `eSpeakActivity` will extract the `espeakdata.zip` file into its After running, `eSpeakActivity` will extract the `espeakdata.zip` file into its
own data directory to set up the available voices. own data directory to set up the available voices.

+ 7
- 3
android/build.gradle View File

repositories { repositories {
mavenCentral() mavenCentral()
jcenter() jcenter()
google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.3.3' classpath 'com.android.tools.build:gradle:3.2.1'
} }
} }




repositories { repositories {
mavenCentral() mavenCentral()
jcenter()
google()
} }


dependencies { dependencies {
androidTestCompile 'org.hamcrest:hamcrest-all:1.3' testImplementation 'junit:junit:4.12'
androidTestImplementation 'org.hamcrest:hamcrest-all:1.3'
} }


android { android {
buildToolsVersion '25.0.3' buildToolsVersion '28.0.3'
compileSdkVersion 26 compileSdkVersion 26


defaultConfig { defaultConfig {

+ 2
- 2
android/jni/Application.mk View File

APP_OPTIM := release APP_OPTIM := release
APP_PLATFORM := android-14 APP_PLATFORM := android-26
APP_TOOLCHAIN_VERSION := 4.6.3 APP_TOOLCHAIN_VERSION := 4.6.3
APP_ABI := mips armeabi armeabi-v7a x86 APP_ABI := armeabi-v7a x86

Loading…
Cancel
Save