= Android = * Get Android Studio Bundle https://dl.google.com/dl/android/studio/install/1.2.2.0/android-studio-bundle-141.1980579-windows.exe * Install with Next, Next ..... * UI Theme Darcula Linux download https://dl.google.com/dl/android/studio/ide-zips/3.5.1.0/android-studio-ide-191.5900203-linux.tar.gz {{{#!highlight sh cp android-studio-ide-191.5900203-linux.tar.gz /opt/ cd /opt/ tar xvzf android-studio-ide-191.5900203-linux.tar.gz chgrp users android-studio/ -R /opt/android-studio/bin/studio.sh ### Preparing "Install Android SDK Tools (revision: 26.1.1)". Downloading https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip "Install Android SDK Tools (revision: 26.1.1)" ready. Installing Android SDK Tools in /home/vitor/Android/Sdk/tools "Install Android SDK Tools (revision: 26.1.1)" complete. "Install Android SDK Tools (revision: 26.1.1)" finished. Preparing "Install SDK Patch Applier v4 (revision: 1)". Downloading https://dl.google.com/android/repository/3534162-studio.sdk-patcher.zip "Install SDK Patch Applier v4 (revision: 1)" ready. Installing SDK Patch Applier v4 in /home/vitor/Android/Sdk/patcher/v4 "Install SDK Patch Applier v4 (revision: 1)" complete. "Install SDK Patch Applier v4 (revision: 1)" finished. Preparing "Install Android Emulator (revision: 29.2.1)". Downloading https://dl.google.com/android/repository/emulator-linux-5889189.zip "Install Android Emulator (revision: 29.2.1)" ready. Installing Android Emulator in /home/vitor/Android/Sdk/emulator "Install Android Emulator (revision: 29.2.1)" complete. "Install Android Emulator (revision: 29.2.1)" finished. Preparing "Install Android SDK Platform-Tools (revision: 29.0.4)". Downloading https://dl.google.com/android/repository/platform-tools_r29.0.4-linux.zip "Install Android SDK Platform-Tools (revision: 29.0.4)" ready. Installing Android SDK Platform-Tools in /home/vitor/Android/Sdk/platform-tools "Install Android SDK Platform-Tools (revision: 29.0.4)" complete. "Install Android SDK Platform-Tools (revision: 29.0.4)" finished. Preparing "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)". Downloading https://dl.google.com/android/repository/build-tools_r29.0.2-linux.zip "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" ready. Installing Android SDK Build-Tools 29.0.2 in /home/vitor/Android/Sdk/build-tools/29.0.2 "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" complete. "Install Android SDK Build-Tools 29.0.2 (revision: 29.0.2)" finished. Preparing "Install Android SDK Platform 29 (revision: 3)". Downloading https://dl.google.com/android/repository/platform-29_r03.zip "Install Android SDK Platform 29 (revision: 3)" ready. Installing Android SDK Platform 29 in /home/vitor/Android/Sdk/platforms/android-29 "Install Android SDK Platform 29 (revision: 3)" complete. "Install Android SDK Platform 29 (revision: 3)" finished. Preparing "Install Sources for Android 29 (revision: 1)". Downloading https://dl.google.com/android/repository/sources-29_r01.zip "Install Sources for Android 29 (revision: 1)" ready. Installing Sources for Android 29 in /home/vitor/Android/Sdk/sources/android-29 "Install Sources for Android 29 (revision: 1)" complete. "Install Sources for Android 29 (revision: 1)" finished. Parsing /home/vitor/Android/Sdk/build-tools/29.0.2/package.xml Parsing /home/vitor/Android/Sdk/emulator/package.xml Parsing /home/vitor/Android/Sdk/patcher/v4/package.xml Parsing /home/vitor/Android/Sdk/platform-tools/package.xml Parsing /home/vitor/Android/Sdk/platforms/android-29/package.xml Parsing /home/vitor/Android/Sdk/sources/android-29/package.xml Parsing /home/vitor/Android/Sdk/tools/package.xml Android SDK is up to date. }}} * https://developer.android.com/studio/releases/gradle-plugin * https://services.gradle.org/distributions/ == Android SDK linux command line tools == {{{#!highlight sh cd /opt wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz tar xvzf android-sdk_r24.4.1-linux.tgz cd android-sdk-linux/tools ./android list sdk }}} {{{ 1- Android SDK Tools, revision 25.1.7 2- Android SDK Platform-tools, revision 24.0.2 3- Android SDK Build-tools, revision 24.0.2 13- SDK Platform Android 4.1.2, API 16, revision 5 }}} {{{#!highlight sh ./android update sdk --no-ui --filter 1,2,3,13 cd ../tools ./android create project --target android-16 --name AndroidProj --path ~/tmp/androidProj/ --activity MyProject --package androidproj.test --gradle --gradle-version 1.1.0 # 1.1.0 is the gradle plugin version cd ~/tmp/androidProj }}} === Project structure === {{{ . |-- build.gradle |-- gradle | `-- wrapper | |-- gradle-wrapper.jar | `-- gradle-wrapper.properties |-- gradlew |-- gradlew.bat |-- local.properties `-- src |-- androidTest | `-- java | `-- androidproj | `-- test | `-- MyProjectTest.java `-- main |-- AndroidManifest.xml |-- java | `-- androidproj | `-- test | `-- MyProject.java `-- res |-- drawable-hdpi | `-- ic_launcher.png |-- drawable-ldpi | `-- ic_launcher.png |-- drawable-mdpi | `-- ic_launcher.png |-- drawable-xhdpi | `-- ic_launcher.png |-- layout | `-- main.xml `-- values `-- strings.xml }}} {{{#!highlight sh vi gradle/wrapper/gradle-wrapper.properties # change version from 1.12 to 2.2.1 vi build.gradle # comment with // lines with Proguard ./gradlew ./gradlew tasks ./gradlew clean build find . -name "*.apk" # ./build/outputs/apk/androidProj-debug.apk }}} {{{ ./build/outputs/apk/androidProj-debug.apk ./build/outputs/apk/androidProj-release-unsigned.apk ./build/outputs/apk/androidProj-debug-unaligned.apk }}} === ./src/androidTest/java/androidproj/test/MyProjectTest.java === {{{#!highlight java package androidproj.test; import android.test.ActivityInstrumentationTestCase2; /** * This is a simple framework for a test of an Application. See * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on * how to write and extend Application tests. *
* To run this test, you can type: * adb shell am instrument -w \ * -e class androidproj.test.MyProjectTest \ * androidproj.test.tests/android.test.InstrumentationTestRunner */ public class MyProjectTest extends ActivityInstrumentationTestCase2