From 50ea7de5cb1abac83858f87b016a83e80eae0eb2 Mon Sep 17 00:00:00 2001 From: Valdis Vitolins Date: Tue, 4 Dec 2018 15:56:25 +0200 Subject: [PATCH 1/4] docs: add more details for Android build --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d5de1507..87c95148 100644 --- a/README.md +++ b/README.md @@ -276,9 +276,9 @@ branch when the repository tracked eSpeak releases. 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); -3. Gradle 2.1 or later. +3. Gradle 3.2.1 or later. In order to use Android Studio, you will also need: @@ -289,10 +289,25 @@ In order to use Android Studio, you will also need: 1. Set the location of the Android SDK: $ export ANDROID_HOME= -2. Build the project: +(where `` 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: +(where `` is your actual path of NDK folder, e.g. `/home/user/Android/Ndk`) +3. Configure the project: $ ./autogen.sh $ ./configure --with-gradle= + +Check that log shows following lines: + + ... + gradle (Android): gradle + ndk-build (Android): yes + ... +`` may be just `gradle` if it is found in your path by simple name. +4. Build the project: + $ make apk-release This will create an `android/build/outputs/apk/espeak-release-unsigned.apk` file. From 64828c856677dc4451802be505f59ac172f14efd Mon Sep 17 00:00:00 2001 From: Valdis Vitolins Date: Tue, 4 Dec 2018 16:02:48 +0200 Subject: [PATCH 2/4] docs: add entry about Android Studio --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 87c95148..46e7457b 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ - [Dependencies](#dependencies-1) - [Building with Gradle](#building-with-gradle) - [Signing the APK](#signing-the-apk) + - [Opening project in Android Studio](#opening-project-in-android-studio) - [Installing](#installing-1) - [Documentation](#documentation) - [eSpeak Compatibility](#espeak-compatibility) @@ -24,6 +25,7 @@ - [Feedback](#feedback) - [License Information](#license-information) + ---------- The eSpeak NG (Next Generation) Text-to-Speech program is an open source speech @@ -330,6 +332,15 @@ this by: $ zipalign 4 android/build/outputs/apk/espeak-release-unsigned.apk \ android/build/outputs/apk/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 Now, you can install the APK using the `adb` tool: From ace63a0bca45bf46931d2b0f02f780b714f80cec Mon Sep 17 00:00:00 2001 From: Valdis Vitolins Date: Tue, 4 Dec 2018 16:15:38 +0200 Subject: [PATCH 3/4] docs: update signing steps: - use open source key storage (PKCS 12) - update location of target files --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 46e7457b..d0952b1b 100644 --- a/README.md +++ b/README.md @@ -321,16 +321,16 @@ this by: 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: $ jarsigner -sigalg MD5withRSA -digestalg SHA1 \ -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. - $ zipalign 4 android/build/outputs/apk/espeak-release-unsigned.apk \ - android/build/outputs/apk/espeak-release-signed.apk + $ zipalign 4 android/build/outputs/apk/release/espeak-release-unsigned.apk \ + android/build/outputs/apk/release/espeak-release-signed.apk ### Opening project in Android Studio @@ -345,7 +345,7 @@ and set your location of NDK, e.g. `/home/user/Android/Ndk`. 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 own data directory to set up the available voices. From 5821e418c198f32cfb95f28ffaf0376f8beb1d1c Mon Sep 17 00:00:00 2001 From: Valdis Vitolins Date: Tue, 4 Dec 2018 16:32:29 +0200 Subject: [PATCH 4/4] android: update configuration files: - remove unsupported hardware platforms - udpate dependencies and versions of tools --- android/build.gradle | 10 +++++++--- android/jni/Application.mk | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 2a890d03..97ba73d1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,9 +2,10 @@ buildscript { repositories { mavenCentral() jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' + classpath 'com.android.tools.build:gradle:3.2.1' } } @@ -12,14 +13,17 @@ apply plugin: 'com.android.application' repositories { mavenCentral() + jcenter() + google() } dependencies { - androidTestCompile 'org.hamcrest:hamcrest-all:1.3' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'org.hamcrest:hamcrest-all:1.3' } android { - buildToolsVersion '25.0.3' + buildToolsVersion '28.0.3' compileSdkVersion 26 defaultConfig { diff --git a/android/jni/Application.mk b/android/jni/Application.mk index a292fa64..091c8c07 100644 --- a/android/jni/Application.mk +++ b/android/jni/Application.mk @@ -1,4 +1,4 @@ APP_OPTIM := release -APP_PLATFORM := android-14 +APP_PLATFORM := android-26 APP_TOOLCHAIN_VERSION := 4.6.3 -APP_ABI := mips armeabi armeabi-v7a x86 +APP_ABI := armeabi-v7a x86