1. #11
    Sencha User
    Join Date
    Jul 2013
    Posts
    99
    Vote Rating
    10
    tt88 will become famous soon enough

      0  

    Default


    Quote Originally Posted by zhazhengyin View Post
    Sencha Cmd version 4.0 and later provides access to Cordova and PhoneGap. You can easily enable or disable access, package an app, and run an emulator or simulator. You can use the Sencha Cmd Cordova and PhoneGap commands to package and emulate a Touch or an Ext JS app. (from Sencha Touch 2.3 documents, see here).

    It's simple. but I don't know how to package a production apk with Sencha Cmd 4.0. Are there any configurations for packaging?
    1. To create a native sencha package of your app use:
    sencha app build native

    2. To create a packaged build use:
    sencha app build package
    (copy these files into the www of the cordova/phonegap project)

    I have managed to get both methods to work to create an android package for a fairly complex app.

    For 2., I followed the cordova (3) documentation by the book & it worked:
    http://cordova.apache.org/docs/en/3.1.0/guide_cli_index.md.html#The%20Command-line%20Interface

    sencha-cordova.jpg

    Above is a sequence of screen grabs of the project setup.
    1. Generated Cordova project
    2. Sencha packaged project pasted into the top level www folder of the generated Cordova project
    3. The platform-specific output (android apk) after running my .bat file, which is simply:
    # Build sencha package ...
    # >sencha app build package
    # Copy ../build/App/package/* ./www
    # Building cordova android package ...
    cordova build android

    -tt88

  2. #12
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,964
    Vote Rating
    132
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    The guide that you posted the link for tells you everything that need to do. I would suggest rereading it. Is there a particular point you are stuck at?
    1. Generate your app
    sencha -sdk ../builds/touch-2.3.0 generate app MyTestApp mytestapp

    2. cd to your apps base directory
    3. Create config.xml file in your app root directory. You can find base config.xml here: https://github.com/phonegap/phonegap...www/config.xml
    4. Enable support for Cordova (run command)
    sencha cordova init com.example.MyTestApp MyTestApp

    5. edit cordova.local.properties cordova.platforms=android
    6. Package your app. (run command)
    sencha app build native
    6. apk will be generated to:
    mytestapp/cordova/platforms/android/bin/
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #13
    Sencha User
    Join Date
    Oct 2013
    Posts
    6
    Vote Rating
    0
    zhazhengyin is on a distinguished road

      0  

    Default


    Dear fmoseley,

    yes, I followed all steps. but I only found mytestapp-debug.apk in mytestapp/cordova/platforms/android/bin/ folder.

    Coz it don't need me providing certification parameters,I guess the apk generated is only for debug,not for production which need signed with a cert.

    thanks.
    Last edited by zhazhengyin; 12 Oct 2013 at 3:09 AM. Reason: mistyped

  4. #14
    Sencha User
    Join Date
    Oct 2013
    Posts
    6
    Vote Rating
    0
    zhazhengyin is on a distinguished road

      0  

    Default


    Quote Originally Posted by tt88 View Post
    1. To create a native sencha package of your app use:
    sencha app build native

    2. To create a packaged build use:
    sencha app build package
    (copy these files into the www of the cordova/phonegap project)

    I have managed to get both methods to work to create an android package for a fairly complex app.

    For 2., I followed the cordova (3) documentation by the book & it worked:
    http://cordova.apache.org/docs/en/3.1.0/guide_cli_index.md.html#The%20Command-line%20Interface

    Attachment 46283

    Above is a sequence of screen grabs of the project setup.
    1. Generated Cordova project
    2. Sencha packaged project pasted into the top level www folder of the generated Cordova project
    3. The platform-specific output (android apk) after running my .bat file, which is simply:
    # Build sencha package ...
    # >sencha app build package
    # Copy ../build/App/package/* ./www
    # Building cordova android package ...
    cordova build android

    -tt88
    Dear tt88,

    your post is very clear. thanks.
    My problem is how to package a production apk. In the picture you posted, only App-debug.apk exists.

    According to http://docs.sencha.com/cmd/4.0.0/?pr...tive_packaging, packaging touch app for android need three steps:
    • step1 - provisioning , for android, obtain a certificate to sign app
    • step2 - create a packing configuration file. (like packager.json which is auto-created by sencha phonegap init command? In this file, I can find some parameters).
    • step3 - run packager to create : sencha app package run <configFile.json>

    If only Sencha touch application, it's OK. but if I use cordova or phonegap, does these steps need change? there is a note in the guide:

    Important Touch 2.3 and later provides support for creating Cordova and PhoneGap apps. If you use Cordova or PhoneGap, refer to Cordova and PhoneGap Apps for information on packaging and emulating.
    Does it mean if I use phonegap with sencha touch, the packaging steps is different.

    Maybe I misunderstood the guide coz my poor english.

  5. #15
    Sencha User
    Join Date
    Jul 2013
    Posts
    99
    Vote Rating
    10
    tt88 will become famous soon enough

      0  

    Default


    Quote Originally Posted by zhazhengyin View Post
    Dear tt88,

    your post is very clear. thanks.
    My problem is how to package a production apk. In the picture you posted, only App-debug.apk exists.

    According to http://docs.sencha.com/cmd/4.0.0/?pr...tive_packaging, packaging touch app for android need three steps:
    • step1 - provisioning , for android, obtain a certificate to sign app
    • step2 - create a packing configuration file. (like packager.json which is auto-created by sencha phonegap init command? In this file, I can find some parameters).
    • step3 - run packager to create : sencha app package run <configFile.json>
    If only Sencha touch application, it's OK. but if I use cordova or phonegap, does these steps need change? there is a note in the guide:


    Does it mean if I use phonegap with sencha touch, the packaging steps is different.

    Maybe I misunderstood the guide coz my poor english.
    Hi zhazhengyin

    I have not yet packaged a production version of my own app yet, so what I can say is only theoretical.
    Anyone with more accurate experience, please correct where I am wrong.

    As I see it, for a Sencha production package, only 2 things need to change:
    1. Your packager.json file, change the key-value of 'configurationebug' to 'configuration:Release'
    2. Your certificate needs to change to a proper formal certificate (the value for "certificatePath")

    For phonegap / cordova I would guess that you also need to change a configuration value in one of the configuration files. I tried to find documentation to build for a release version & there was no obvious configuration file updates that I could find. I found these 2 links from Android:
    http://developer.android.com/tools/publishing/preparing.html
    http://developer.android.com/distribute/googleplay/publish/preparing.html
    They can give you an idea of what is required for an Android app. A Sencha phonegap/cordova app is a small sub-section (Android web-view) of an Android app, so some of these items might not be relevant or might already be covered in the Sencha packaging step.

    What I would do is create a production version as a test & run it in beta mode while getting a better understanding of what is involved in packaging an Android app before releasing the formal / final Android package.

    Good luck!

    - tt88

  6. #16
    Sencha User
    Join Date
    Jul 2013
    Posts
    99
    Vote Rating
    10
    tt88 will become famous soon enough

      0  

    Default


    Quote Originally Posted by fmoseley View Post
    The guide that you posted the link for tells you everything that need to do. I would suggest rereading it. Is there a particular point you are stuck at?
    1. Generate your app
    sencha -sdk ../builds/touch-2.3.0 generate app MyTestApp mytestapp

    2. cd to your apps base directory
    3. Create config.xml file in your app root directory. You can find base config.xml here: https://github.com/phonegap/phonegap...www/config.xml
    4. Enable support for Cordova (run command)
    sencha cordova init com.example.MyTestApp MyTestApp

    5. edit cordova.local.properties cordova.platforms=android
    6. Package your app. (run command)
    sencha app build native
    6. apk will be generated to:
    mytestapp/cordova/platforms/android/bin/
    I only saw this post now. I didn't realize there was tighter integration with phonegap/cordova - making the manual process of packaging an app for phonegap described in my previous post redundant. This link, previously mentioned in this thread is clear: http://docs.sencha.com/touch/2.3.0/?.../guide/cordova

  7. #17
    Sencha User
    Join Date
    Jan 2014
    Posts
    16
    Vote Rating
    1
    manishroy is on a distinguished road

      0  

    Default


    Hi All,I am getting this error while packaging the app in step 2.
    Platform : Windows 7
    Error :

    Code:
    BUILD FAILED
    com.sencha.exceptions.ExNotFound: Failed to detect ruby
    Anyone?

  8. #18
    Sencha User
    Join Date
    Jun 2013
    Posts
    59
    Vote Rating
    3
    good_c_ryan_19 is on a distinguished road

      0  

    Default


    Hi @manishroy , on the error it self you must need to install ruby , get it here http://rubyinstaller.org/downloads/

  9. #19
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,964
    Vote Rating
    132
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    run ruby -v at command line to see if you have ruby installed.
    If it is installed then you need to add to your PATH.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  10. #20
    Sencha User
    Join Date
    Jan 2014
    Posts
    16
    Vote Rating
    1
    manishroy is on a distinguished road

      0  

    Default


    Ok. I will install it. But i have a stupid question.

    I am really confused about why we need to install so many things just to have a simple Hello World app on Android using Sencha??

    1> PhoneGap
    2>Android SDK
    3>Sencha SDK
    4> Sencha CMD
    5>Apache Ant
    6> Ruby

    Can someone please explain for each of the points mentioned above about why we need them and how they felicitate in creating a Android App.

    Also in the tutorial to create the App in this thread there is no mention of Ruby. Whatever was mentioned i installed then why i need Ruby?