1. #1
    Sencha User
    Join Date
    Feb 2009
    Location
    Tamilnad,India
    Posts
    23
    Vote Rating
    0
    newb is an unknown quantity at this point

      0  

    Default Unanswered: how to run sencha touch app on android emulator on windows

    Unanswered: how to run sencha touch app on android emulator on windows


    Hi,

    I have created an app using the below sencha command in the command line as below

    sencha app create mysenchaApp /path/to/www/mysenchaApp


    this given me as below
    Code:
    [INFO] Created file C:\path\to\www\mysenchaapp\.senchasdk
    [INFO] Created file C:\path\to\www\mysenchaapp\index.html
    [INFO] Created file C:\path\to\www\mysenchaapp\app.js
    [INFO] Created file C:\path\to\www\mysenchaapp\packager.json
    [INFO] Created file C:\path\to\www\mysenchaapp\app.json
    [INFO] Created file C:\path\to\www\mysenchaapp\app\view\Main.js
    [INFO] Copied dir: C:\path\to\www\mysenchaapp\sdk\src
    [INFO] Copied dir: C:\path\to\www\mysenchaapp\sdk\resources
    [INFO] Copied dir: C:\path\to\www\mysenchaapp\resources\icons
    [INFO] Copied dir: C:\path\to\www\mysenchaapp\resources\loading
    [INFO] Copied dir: C:\path\to\www\mysenchaapp\sdk\command
    [INFO] Copied file: C:\path\to\www\mysenchaapp\sdk\microloader\development.js
    [INFO] Copied file: C:\path\to\www\mysenchaapp\sdk\microloader\testing.js
    [INFO] Copied file: C:\path\to\www\mysenchaapp\sdk\microloader\production.js
    [INFO] Copied file: C:\path\to\www\mysenchaapp\sdk\version.txt
    [INFO] Copied file: C:\path\to\www\mysenchaapp\sdk\sencha-touch.js
    [INFO] Copied file: C:\path\to\www\mysenchaapp\sdk\sencha-touch-all.js
    [INFO] Created file C:\path\to\www\mysenchaapp\resources\sass\app.scss
    [INFO] Created file C:\path\to\www\mysenchaapp\resources\sass\config.rb
    [INFO] Copied file: C:\path\to\www\mysenchaapp\resources\css\app.css
    Then i modified the packager.json file as below to get it run on emulator


    Code:
    /**
         * @cfg {String} applicationName
         * @required
         * This is the name of your application, which is displayed on the  device when the app is installed. On IOS, this should match
         * the name of your application in the Apple Provisioning Portal.
         */
        "applicationName":"My Application",
    
        /**
         * @cfg {String} applicationId
         * This is the name namespace for your application. On IOS, this  should match the name of your application in the Apple Provisioning  Portal.
         */
        "applicationId":"com.mycompany.myAppID",
    
        /**
         * @cfg {String} versionString
         * @required
         * This is the version of your application.
         */
        "versionString":"1.0",
    
        /**
         * @cfg {String} iconName
         * This is file name of your icon. This should be in the same directory of this configuration file.
         *
         * For iOS, please refer to their documentation about icon sizes:
         * https://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html
         *
         * For Android, please refer to the Google Launcher icons guide:
         * http://developer.android.com/guide/practices/ui_guidelines/icon_design_launcher.html
         */
        "iconName":"resources/icons/Icon~ipad.png",
    
        /**
         * @cfg {String} inputPath
         * @required
         * This is location of your Sencha Touch 2 application, relative to this configuration file.
         */
        "inputPath":"build/native",
    
        /**
         * @cfg {String} outputPath
         * @required
         * This is where the built application file with be saved.
         */
        "outputPath":"build/",
    
        /**
         * @cfg {String} configuration
         * @required
         * This is configuration for your application. `Debug` should always be used unless you are submitting your app to an online
         * store - in which case `Release` should be specified.
         */
        "configuration":"Debug",
    
        /**
         * @cfg {String} platform
         * @required
         * This is the platform where you will be running your application. Available options are:
         *  - iOSSimulator
         *  - iOS
         *  - Android
         *  - AndroidEmulator
         */
        "platform":"AndroidEmulator",
    
        /**
         * @cfg {String} deviceType
         * @required
         * This is device type that your application will be running on.
         *
         * If you are developing for Android, this is not necessary.
         *
         * Available options are:
         *  - iPhone
         *  - iPad
         *  - Universal
         */
        "deviceType":"Universal",
    
        /**
         * @cfg {String} certificatePath
         * This is the location of your certificate.
         * This is required when you are developing for Android or you are developing on Windows.
         */
        "certificatePath":"/path/to/certificate.file",
    
        /**
         * @cfg {String} certificateAlias
         * This is the name of your certificate.
         *
         * IF you do not specify this on OSX, we will try and automatically find the certificate for you using the applicationId.
         *
         * This can be just a simple matcher. For example, if your  certificate name is "iPhone Developer: Robert Dougan (ABCDEFGHIJ)", you
         * can just put "iPhone Developer".
         *
         * When using a certificatePath on Windows, you do not need to specify this.
         */
        "certificateAlias":"",
        
        /**
         * @cfg {String} sdkPath
         * This is the path to the Android SDK, if you are developing an Android application.
         */
        "sdkPath":"C:\Program Files\Android\android-sdk",
        
        /**
         * @cfg  androidAPILevel
         * This is android API level, the version of Android SDK to use, you  can read more about it here:  http://developer.android.com/guide/appendix/api-levels.html.
         * Be sure to install corresponding platform API in android SDK manager (android_sdk/tools/android)
         */
        "androidAPILevel":"8",
    
        /**
         * @cfg  orientations
         * @required
         * This is orientations that this application can run.
         */
        "orientations": [
            "portrait",
            "landscapeLeft",
            "landscapeRight",
            "portraitUpsideDown"
        ]
    }

    then i run the below command on secha command line tool

    sencha app build native

    Code:
    C:\path\to\www\mysenchaapp>sencha app build native
    [INFO] Deploying your application to C:\path\to\www\mysenchaapp\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/loading
    [INFO] Resolving your application dependencies...
    [INFO] Found 139 dependencies. Concatenating all into 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...
    
    C:\path\to\www\mysenchaapp
    Here now i am trying to run this app on android emulator , i have created one android application in the eclipse.

    Really i am worried as i am not able to do so...

    i would like to know how to add my sencha app to this android to run it on emulator?

    please let me know, i have been trying to fix this for a long time.

    pls help and thanks a lot

  2. #2
    Sencha User
    Join Date
    Dec 2011
    Location
    Coimbatore
    Posts
    103
    Answers
    4
    Vote Rating
    -1
    venkatesh.R will become famous soon enough

      0  

    Default


    Hi ,

    please try this version if it works: http://dl.dropbox.com/u/8793605/stbuild.msi

    Please install above stbuild version of tool in your machine .

    Include all your application resource files(css,js and aditional files which are required to run your apps) in app.json


    1.Change configuration settings in your packager.json file accordingly.
    Example

    {
    "applicationName":"App name",
    "applicationId":" AppId",
    "bundleSeedId":"appname",
    "versionString":"1.0",
    "versionCode":"1",
    "iconName":"resources/icons/icon.png",
    "inputPath":"Your app root dirctory of sencha apps",
    "outputPath":"build/",
    "configuration":"Debug",
    "platform":"AndroidEmulator",
    "deviceType":"Universal",
    "certificatePath":"debug.keystore",//your keystore path
    "certificateAlias":"",
    "sdkPath":"C:/Program Files/Android/android-sdk",
    "androidAPILevel":"15",
    "orientations": [
    "portrait",
    "landscapeLeft",
    "landscapeRight",
    "portraitUpsideDown"
    ]
    }

    Run sencha app build native [Note: android emulator should be running]


    Let's try ,


    Thanks,






  3. #3
    Sencha User
    Join Date
    Feb 2009
    Location
    Tamilnad,India
    Posts
    23
    Vote Rating
    0
    newb is an unknown quantity at this point

      0  

    Default


    Hi , Thanks for the reply first of all.

    Actually does this "certificatePath":"debug.keystore",//your keystore path is necessary?

    I dont have one.

    Do i need to create one native app to place the files generated by the sencha? pls tell

    Also i have all the resouces files included already in the app.json file .

    Herewith i attach my source code with all files as attchment.

    please have a look , let me know what is the problem

    pls help

    Sorry currently i am not able to upload the files

  4. #4
    Sencha User
    Join Date
    Feb 2009
    Location
    Tamilnad,India
    Posts
    23
    Vote Rating
    0
    newb is an unknown quantity at this point

      0  

    Default


    somebody pls help me out

  5. #5
    Sencha User
    Join Date
    Dec 2011
    Location
    Coimbatore
    Posts
    103
    Answers
    4
    Vote Rating
    -1
    venkatesh.R will become famous soon enough

      0  

    Default sencha app on android emulator

    sencha app on android emulator


    @newb

    Please read this document .

    http://docs.sencha.com/touch/2-0/#!/...native_android


    It gives you the clear idea for sencha android native package.


    Thanks,



  6. #6
    Sencha User
    Join Date
    May 2012
    Location
    bangalore
    Posts
    60
    Answers
    4
    Vote Rating
    0
    bluemvj is an unknown quantity at this point

      0  

    Default sencha app on android emulator

    sencha app on android emulator


    @newb

    For me its working in this way

    Code:
    {
        "applicationName":"My Application",
        "versionString":"1.0",
        "iconName":"resources/icons/Icon~ipad.png",
        "inputPath":"build/native",
        "outputPath":"build/",
        "configuration":"Debug",
        "platform":"Android",
        "deviceType":"Universal",
        "certificatePath":"/path/to/certificate.file",
        "certificateAlias":"",
        "sdkPath":"F:/android-sdk/",
        "androidAPILevel":"8",
        "orientations": [
            "portrait",
            "landscapeLeft",
            "landscapeRight",
            "portraitUpsideDown"
        ]
    }
    First Start the Avd, For me i used 2.3.3 after starting the AVD then used the command "sencha app build native"
    No need of any certificate to run on Emulator

  7. #7
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    291
    Answers
    3
    Vote Rating
    12
    worthlutz is on a distinguished road

      0  

    Default


    Quote Originally Posted by venkatesh.R View Post
    1.Change configuration settings in your packager.json file accordingly.
    Example
    {
    "applicationName":"App name",
    "applicationId":" AppId",
    "bundleSeedId":"appname",
    "versionString":"1.0",
    "versionCode":"1",
    "iconName":"resources/icons/icon.png",
    "inputPath":"Your app root dirctory of sencha apps",
    "outputPath":"build/",
    "configuration":"Debug",
    "platform":"AndroidEmulator", <---- CHANGE THIS TO "platform":"Android"
    "deviceType":"Universal",
    "certificatePath":"debug.keystore",//your keystore path
    "certificateAlias":"",
    "sdkPath":"C:/Program Files/Android/android-sdk",
    "androidAPILevel":"15",
    "orientations": [
    "portrait",
    "landscapeLeft",
    "landscapeRight",
    "portraitUpsideDown"
    ]
    }
    I have found that using platform = AndroidEmulator causes the build to stop at:
    Code:
    ...
    [INFO] Generated app.json
    [INFO] Embedded microloader into index.html
    [INFO] Packaging your application as a native app...
    
    C:\path\to\www\mysenchaapp
    Changing to platform = Android lets the process continue and will load in the emulator if it is running.


    Worth

  8. #8
    Sencha User
    Join Date
    Feb 2009
    Location
    Tamilnad,India
    Posts
    23
    Vote Rating
    0
    newb is an unknown quantity at this point

      0  

    Default


    Hi, thanks for the reply.

    I have installed the http://dl.dropbox.com/u/8793605/stbuild.msi

    Yes i have created the app using sencha app create command in the command line only.
    I have changed the packager.json file as per your instruction.( Android emulator - Android)

    currently i am having the below error

    Code:
     
    C:\path\to\www\mysenchaapp>sencha app build native
    [INFO] Deploying your application to C:\path\to\www\mysenchaapp\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/loading
    [INFO] Resolving your application dependencies...
    [INFO] Found 139 dependencies. Concatenating all into 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...
    [INFO] Required field (versionCode) is missing from config fileFailed to package
     application
    Please let me know what is the issue here

  9. #9
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    North Carolina
    Posts
    291
    Answers
    3
    Vote Rating
    12
    worthlutz is on a distinguished road

      0  

    Default


    Check your "packager.json" file. It should have that field.

    Code:
    ... "versionCode":"1" ...


    Worth

  10. #10
    Sencha User
    Join Date
    Dec 2011
    Location
    Coimbatore
    Posts
    103
    Answers
    4
    Vote Rating
    -1
    venkatesh.R will become famous soon enough

      0  

    Default VesionCode :1

    VesionCode :1


    Hi,

    {
    "applicationName":"appName", "applicationId":"appID",
    "bundleSeedId":"appName",
    "versionString":"1.0",
    "versionCode":"1", //Add version code config and check " :"
    "iconName":"resources/icons/icon.png",
    "inputPath":"D:/senchadev/",
    "outputPath":"build/",
    "configuration":"Debug",
    "platform":"AndroidEmulator",
    "deviceType":"Universal",
    "certificatePath":"Your KeyStore",
    "certificateAlias":"Your alias",
    "sdkPath":"C:/Program Files/Android/android-sdk",
    "androidAPILevel":"15",
    "orientations": [
    "portrait",
    "landscapeLeft",
    "landscapeRight",
    "portraitUpsideDown"
    ]
    }

    Now it should work