Hybrid View

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    24
    Answers
    2
    Vote Rating
    6
    dustfinger is on a distinguished road

      4  

    Default Unanswered: My Sencha Touch 2.0.1.1 Getting Started Notes

    Unanswered: My Sencha Touch 2.0.1.1 Getting Started Notes


    Installing sencha touch 2.0.1.1
    1. Download Sencha-touch-2.0.1.1-commercial.zip or later.
    2. Extract to c:\Dev\sencha-touch
    3. Edit c:\Dev\sencha-touch\command\src\module\generate\App\App.json.tpl
    Scroll almost all the way down until you find the following peroperty:
    Code:
    /**
         * Build options
         */
        "buildOptions": {
            "product": "touch",
            "minVersion": 3,
            "debug": false,
            "logger": "no"
        {[ "\}"]},
    4. Change the line "logger": "no" to "logger": false
    Important: App.json.tpl is just a template used by sencha generate app. If you are following these instructions to get an existing app to build and run in the emulator then you will have to follow steps 3 and 4 by editing your app.json file as well.
    5. Install one of 2 patches for stbuild. This applies to sencha touch 2.0.1.1 only.
    windows: http://dl.dropbox.com/u/8793605/stbuild.msi
    mac: http://dl.dropbox.com/u/8793605/stbuild.pkg


    Installing sencha sdk tools
    1. Download and execute SenchaSDKTools-2.0.0-beta3-windows.exe.
    2. The welcome screen appears, click next.
    3. The License Agreement screen appears. Select "I accept the agreement". Click Next.
    4. The Installation Directory appears. I chose to install it to c:\Dev\SenchaSdkTools. Click Next.
    5. The Ready to Install screen appears. Click Next.


    Installing android-sdk
    1. Download the android SDK. At the time of writing the installer was called installer_r20-windows.exe: http://developer.android.com/sdk/index.html
    2. Execut the installer.
    3. The Android SDK Tools Setup screen appears.
    4. Click Next.
    5. The Java Development Kit detection screen appears. In my case Java SE Development Kit (JDK) version 1.7 was found at location: c:\Program Files(x86)\Java\jre7\bin\java.exe. If you do not have java installed, the installer is suppose to download and install it for you at this point. Unfortunately it detected a JRE and not a JDK, so in the next section I will download and install the JDK. click Next.
    6. The Choose Users screen appears. Since I am the only user, I left the default selection: "Install just for me". Click Next.
    7.The "Choose Install Location" screen appears. I chose to install it at c:\Dev\android-sdk. Click Next.
    8.The "Choose Start Menu Folder" appears. Click Install.
    9. The "Installation Complete" screen appears. Click Next.
    10. The "Completing the Android SDK Tool Setup Wizard" screen appears. Leave the "start SDK Manager" checkbox checked. Click Finish.
    11. The Android SDK Manager appears.
    12. In the Packages pane check:
    - Tools->Android SDK Platform-tools.
    - Android 4.1 (API 16) or whatever API you need.
    - Extras -> Google USB Driver //I am not sure if this is required.
    13. Click the Install packages... button.
    14. The Choose Packags to Install dialog appears. Select the "Accept All" radio button. Click Install.
    15. The Android SDK Manager log appears and the packages are downloaded and installed. This can take a long time. Time for a coffee break.
    16. Add C:\Dev\android-sdk\platform-tools to the PATH Environment Variable

    Install JDK
    1. Download the latest JDK. In my case this is Java SE Development Kit 7. I am not sure if I should download the 64-bit version, or the 32-bit version. So I am just going to download the 32-bit version because I am guessing that is a safe bet. For me this was jdk-7u5-windows-i586.exe.
    2. Execute the installer and follow the instructions until the JDK is installed. I never installed JavaFX.
    3. Create Environment Variable: JAVA_HOME, value: C:\Program Files (x86)\Java\jdk1.7.0_05
    4. Add %JAVA_HOME%\bin;%JAVA_HOME%\lib to PATH.


    Create an android AVD
    1. Execute the Android SDK Manager
    2. Click Tools->Manage AVDs...
    3. New...
    4. Enter the following details:
    Name: android-16
    Target: Android 4.1 - API Level 16
    CPU/ABI: ARM (armeabi-v7a)
    5. Click Create AVD


    Generate your first app
    1. From the command line:
    cd c:\Dev\sencha-touch
    c:\Dev\sencha-touch> sencha generate app GS ../GS
    2. edit c:\GS\packager.json
    3. At the top of the file following the opening curly brace '{' add the following line:
    "versionCode":"1",
    4. Please note the use of double backslash in path because this is important. Find and set the following properties
    "platform":"AndroidEmulator",
    "certificatePath":"debug.keystore",
    "sdkPath":"c:\\Dev\\android-sdk",
    "androidAPILevel":"16",

    5. Start the Android SDK Manager
    6. Click Tools->Manage AVDs...
    7. Select the AVD named android-16
    8. Click Start...
    9. The Launch Options dialog appears. Click Launch
    10. Wait until the Android emulator has finished booting.
    11. From the command line:
    cd c:\Dev\GS
    c:\Dev\GS> sencha app build native

    Congradulations, your Getting started app should now be running in an android emulator. You will have to swipe into android (unlock it) to see the app running. To uninstall the app just type the following at the command prompt:
    c:\Dev> adb uninstall com.mycompany.myAppID
    Note: com.mycompany.myAppID was taken from packager.json "applicationId":"com.mycompany.myAppID",

    I hope that helps someone out there.

    Sincerely,
    dustfinger.
    Last edited by dustfinger; 6 Jul 2012 at 12:05 PM. Reason: Added an important note in red.

  2. #2
    Sencha Premium Member
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    120
    Answers
    3
    Vote Rating
    3
    clifficious is on a distinguished road

      0  

    Default


    Thanks for your detailed post. You'll sure make a lot of developers happy
    Haven't tried it yet, cause I found a solution via PhoneGap.

  3. #3
    Sencha User
    Join Date
    May 2009
    Posts
    32
    Vote Rating
    0
    casic has a little shameless behaviour in the past

      0  

    Default Thanks dustfinger

    Thanks dustfinger


    This is what we are looking for . Short and clear getting start. I hope will work. Go to try it .
    Thanks again .

  4. #4
    Sencha User
    Join Date
    May 2009
    Posts
    32
    Vote Rating
    0
    casic has a little shameless behaviour in the past

      0  

    Default Step ahead

    Step ahead


    I have followed your getting started notes and now i get compiled both debug and release .apk.
    That is great for me.
    But in both cases (on AVD , and on my Galaxy note ) just start microloader and hang on .
    .
    If someone know what have to do ....
    Thanks anyway

    One more , when i start sencha app build native

    D:\wamp2\www\GS2>sencha app build native
    [INFO] Deploying your application to D:\wamp2\www\GS2\build\package
    [INFO] Copied sdk/sencha-touch.js
    [INFO] Copied app.js
    [INFO] Copied resources/css/app.css
    [INFO] Copied resources/images
    [INFO] Copied resources/icons
    [INFO] Copied resources/startup
    [INFO] Resolving your application dependencies (file:///D:/wamp2/www/GS2/index.html)
    [INFO] Found 139 dependencies. Concatenating all into 'D:\wamp2\www\GS2\build\package\app.js'
    [INFO] Processed sdk/sencha-touch.js
    [INFO] Minifying sdk/sencha-touch.js
    [INFO] Processed app.js
    [INFO] Minifying app.js
    [INFO] Minifying resources/css/app.css
    [INFO] Minified sdk/sencha-touch.js
    [INFO] Minified app.js
    [INFO] Minified resources/css/app.css
    [INFO] Generated app.json
    [INFO] Embedded microloader into index.html
    [INFO] Packaging your application as a native app...

    process hang here , and i have to break it with CTRL +C to exit in shell .
    anyway .apk is already generated ,(or started on AVD) .
    Any ideas ?

  5. #5
    Sencha User
    Join Date
    Jun 2012
    Posts
    24
    Answers
    2
    Vote Rating
    6
    dustfinger is on a distinguished road

      0  

    Default


    Hello Casic,

    I am glad to hear that my notes were of some help to you. It sounds like you may need to do a bit of debugging to find out what is going on. Why don't you start with examining the logs in your AVD.

    Note: You might consider uninstalling your app from the avd first, then installing it with sencha app build native at step 7. When it hangs obtain the logs.

    Steps to get logs from an AVD.
    1. Start the AVD Manager
    2. The Android Virtual Device Manager appears. Select the AVD you wish to debug and click Start.
    3. The Launch Options dialog appears. Click Launch.
    4. Wait until Android has finished booting.
    5. Start the Dalvik Debug Monitor (DDM) [Android-Install-Path]\android-sdk\tools\ddms.
    6. You should see your android avd running in the upper left pane. In the bottom pane you should see messages from the avd being logged.
    7. Start your app in the avd.
    8. Wait until your app hangs.
    9. Click Device-->File Explore
    10. Select all the files under data\anr\. You might see files titled traces.txt, s00.txt, s01.txt etc.
    11. Click the Pull File from Device icon. The icon depicts a floppy disc with an arrow pointing to the left. Save the files to an appropriate location.
    12. Using your favorite text editor, open the files and look for logs pertaining to your app. You may also want to simply look through the messages displayed in the DDM. Hopefully you will find something that clues you into what is happening. Let me know what you find.
    Sincerely,
    dustfinger.

  6. #6
    Sencha User
    Join Date
    May 2009
    Posts
    32
    Vote Rating
    0
    casic has a little shameless behaviour in the past

      0  

    Default It is working.

    It is working.


    I just have done. Thanks again. Reason for hanging on microloader is that looking for logger.js , but when changed in app.json.tpl form 'no' to 'false' and generated from scratch, IT IS WORKING.

    Many thanks for all .
    Any way , why 2-3 months no one posted note like that. I have read that many have such of problem .
    I have Almost gived up. I like EXT JS . I'm shure sencha will my favorite framewok next year .

  7. #7
    Sencha User
    Join Date
    Apr 2012
    Posts
    34
    Vote Rating
    3
    MichelleWong is on a distinguished road

      0  

    Default


    Quote Originally Posted by dustfinger View Post
    Installing sencha touch 2.0.1.1

    Install JDK
    1. Download the latest JDK. In my case this is Java SE Development Kit 7. I am not sure if I should download the 64-bit version, or the 32-bit version. So I am just going to download the 32-bit version because I am guessing that is a safe bet. For me this was jdk-7u5-windows-i586.exe.
    2. Execute the installer and follow the instructions until the JDK is installed. I never installed JavaFX.
    3. Create Environment Variable: JAVA_HOME, value: C:\Program Files (x86)\Java\jdk1.7.0_05
    4. Add %JAVA_HOME%\bin;%JAVA_HOME%\lib to PATH.
    Hi Dustfinger,

    First of all, thanks for sharing and telling us your steps as described above.
    I got also problems when compiling into Android Apps.
    I would like to generate my app into Android 2.3. Unfornately I got a lot of errors!
    So I am trying to follow your steps one-by-one.

    As I am not famous in Java, I miss a little bit detailed steps about Installing JDK at point 3 and 4.
    Can you tell me where I have to set this environment?

    After this, I can start trying to generate my first android app... hope this will works.

    Thanks in advance!

    Michelle

  8. #8
    Sencha User
    Join Date
    Jun 2012
    Posts
    57
    Vote Rating
    1
    deepak_patil1222 is on a distinguished road

      0  

    Default feedback

    feedback


    hey dustfinger. Hey thanks a lot man. It helped me seriously. i have just gived up boss. But one more thing . if i want to create the standalone apk then what is the command to be fired from the command line ? Any ways Thanks again for the help. thanks deepak

  9. #9
    Sencha User
    Join Date
    Mar 2012
    Posts
    65
    Vote Rating
    3
    thang_ibrahim is on a distinguished road

      0  

    Default


    Code:
    C:\Dev\GS>sencha app build native[INFO] Deploying your application to C:\Dev\GS\build\package
    [INFO] Copied sdk/sencha-touch.js
    [INFO] Copied app.js
    [INFO] Copied resources/css/app.css
    [INFO] Copied resources/images
    [INFO] Copied resources/icons
    [INFO] Copied resources/startup
    [INFO] Resolving your application dependencies (file:///C:/Dev/GS/index.html)
    [INFO] Found 157 dependencies. Concatenating all into 'C:\Dev\GS\build\package\a
    pp.js'
    [INFO] Processed local file sdk/sencha-touch.js
    [INFO] Minifying sdk/sencha-touch.js
    [INFO] Processed local file app.js
    [INFO] Minifying app.js
    [INFO] Minifying resources/css/app.css
    [INFO] Minified sdk/sencha-touch.js
    [INFO] Minified app.js
    [INFO] Minified resources/css/app.css
    [INFO] Generated app.json
    [INFO] Embedded microloader into index.html
    [INFO] Packaging your application as a native app...
    i'm build native in "AndroidEmulator", but nothing happend in Emulator.
    When i build native in "Android", i same get error no target and android-7.
    I using sencha sdk beta3, sencha-touch-2.1.0-b2

  10. #10
    Sencha User
    Join Date
    Jun 2012
    Posts
    57
    Vote Rating
    1
    deepak_patil1222 is on a distinguished road

      0  

    Default @ thang_ibrahim

    @ thang_ibrahim


    Please check your android sdk is properly installed or not .
    according to your comments above it seems that you have not installed the platform for android-7 .
    you can check that by below command.

    C:\Program Files\Android>android list targets

    this should give you all installed platforms to your android sdk.