Prerequisites:
a. Sencha Touch 2 (SDK 2.2.1 + Cmd v3.1.2.342) b. Android SDK Tools (android-17 with adt-bundle-linux-20130522) 1. Android icons Create following png files in your Sencha app directory: - resources/icons/Icon_Android36.png - resources/icons/Icon_Android48.png - resources/icons/Icon_Android72.png - resources/icons/Icon_Android96.png 2. Certificate generation In the terminal, 'cd' into the Android sdk directory, for example: $ cd ~/Programs/MobileOS/Android_OS/adt-bundle-linux-x86-20130522 Now, run the below command to generate a certificate: $ keytool -genkey -v -keystore android422.keystore -alias android422 -keyalg RSA -keysize 2048 -validity 10000 3. 'packager.json' configuration The app's name is 'chukar' and in its root directory, you can locate 'packager.json' file. This file is to be modified with following configuration: - "applicationId":"com.demo.chukar" - "icon": { "36":"resources/icons/Icon_Android36.png", "48":"resources/icons/Icon_Android48.png", "72":"resources/icons/Icon_Android72.png", "96":"resources/icons/Icon_Android96.png" } - "platform":"AndroidEmulator" - "certificatePath":"~/Programs/MobileOS/Android_OS/adt-bundle-linux-x86-20130522/android422.keystore" - "certificateAlias":"android422" - "certificatePassword":"android422" - "sdkPath":"~/Programs/MobileOS/Android_OS/adt-bundle-linux-x86-20130522/sdk" - "androidAPILevel":"17" 4. Build to test for production In the terminal, 'cd' into your app directory and run below commands to fire-up the build process and test the app in the browser: $ sencha app build production $ sencha fs web -port 9911 start -map ~/Workspace/Sencha-Workspace/Dev-Apps/chukar/build/chukar/production/ 5. Enable access to st-cmd's 'st-res' folder within app's root directory In the terminal, 'cd' into app's root directory and run the below command to create a symbolic-linked folder: $ sudo ln -s ~/Programs/Sencha/Sencha/Cmd/3.1.2.342/stbuild/st-res 6. Fire-up Android device emulator In a new terminal, 'cd' into ~/Programs/MobileOS/Android_OS/adt-bundle-linux-x86-20130522/sdk/tools and run: $ ./emulator -avd Android422 7. Build native package using st-cmd In the terminal, 'cd' into the app's root directory and run: $ sencha --debug app build native 8. Install newly built app on to Android device emulator In the terminal, 'cd' into Androids sdk's 'platform-tools' directory: $ cd ~/Programs/MobileOS/Android_OS/adt-bundle-linux-x86-20130522/sdk/platform-tools Now, run the below command: $ ./adb install ~/Workspace/Sencha-Workspace/Dev-Apps/chukar/build/chukar/native/chukar.apk 9. In the emulator, open the newly installed app.
0 Comments
|
AuthorCategories
All
Archives
January 2019
|