Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Building Sencha Touch 2 + Phonegap Application for Android : Windows

  1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    64
    Vote Rating
    3
      3  

    Default Building Sencha Touch 2 + Phonegap Application for Android : Windows

    Good day, i just want to share on how i successfully build Sencha Touch Application for Android (.Apk) devices.


    Below are the steps:


    Requirements:
    1. Install Phonegap on CMD: download first nodeJS then execute npm install -g phonegap on command prompt - http://phonegap.com/install/
    2. Download Android SDK : http://developer.android.com/sdk/index.html
    3. Download Sencha Touch 2.1 : http://www.sencha.com/products/touch/download/
    4. Download and Install Sencha CMD 3.0 beta : http://www.sencha.com/products/sencha-cmd/download
    5. Download ANT : http://ant.apache.org/
    6. Java SDK






    Building Sencha Touch 2 + Phonegap Application to .APK Android file Steps:
    1. Cd to Sencha Touch SDK Folder(sencha touch 2.2.1) then Create Sencha Touch Project in Command Prompt : Sencha generate app AppNAme Path
    ex:
    Code:
    sencha generate app Device C:\MobileProject\Device
    2. cd on created project folder then package it by :
    Code:
     sencha app build package
    3. Create Phonegap Android Project by cd on
    Code:
    C:\phonegap-2.9.0\lib\android\bin
    then type create.bat <path> <appid> <appname>
    eg:
    Code:
    create.bat C:\MobileProject\Device\build\Device\android com.company.Device Device
    4. Update Android Project for ant to be working android update project --name <project_name> --target <target_ID>
    --path <path_to_your_project> on default Users\yourname path on cmd
    to check available target type android target list
    eg:
    Code:
    android update project --name Device --target 1 --path C:\MobileDeviceProject\Device\build\Device\android
    5. Now copy cordova js from C:\MobileProject\Device\build\Device\android\assets\www to your sencha touch default project folder and add cordova.js to app.json
    Code:
    { "path": "cordova.js"}
    then build package again
    Now edit build.xml on Sencha Project then add
    Code:
    <target name="-after-build">
    <!--Delete content og android web root -->
    <delete dir="${build.dir}/android/assets/www"/>
    
    
    
    
    <copy todir="${build.dir}/android/assets/www">
    <fileset dir="${build.dir}/package"/>
    </copy> </target>
    Step 6: Create apk file. By cd on C:\MobileProject\Device\build\Device\android then type
    ex:
    Code:
    ant debug && adb install -r ./bin/MyApp-debug.apk



    Regards.




    Online Reference:
    http://robertcorvus.com/how-to-reall...negap-to-work/
    http://vimeo.com/55335529
    http://stackoverflow.com/questions/5...y-on-windows-7
    https://baach.de/Members/jhb/setting...e-command-line

  2. #2
    Sencha User
    Join Date
    Jul 2013
    Posts
    11
    Vote Rating
    0
      0  

    Default Thanks

    Thank , i will test it.
    Do you know sencha 2.2.1 wil work too ?

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    11
    Vote Rating
    0
      0  

    Default Still not work

    I have done that , but still get error on using cordova functions.
    Example TypeError: navigator.notification is undefined

  4. #4
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,094
    Vote Rating
    136
      0  

    Default

    Thanks for putting this together.

  5. #5
    Sencha User
    Join Date
    Apr 2013
    Posts
    16
    Vote Rating
    0
      0  

    Default

    what version of phonegap do you use? phonegap 2.9?

    can you provide an guide of integration sencha touch 2.X +phonegap 3.0

  6. #6
    Sencha User
    Join Date
    Jun 2013
    Posts
    64
    Vote Rating
    3
      0  

    Default

    Hi feiqiao, i used phonegap 2.9.0. There is nothing change on the steps even you used phonegap 3.0.

    Best Regards

  7. #7
    Sencha User
    Join Date
    Aug 2013
    Location
    Karachi, Pakistan.
    Posts
    6
    Vote Rating
    -3
      0  

    Default Buil Failed

    Hello, i followed the steps and everything was going smooth but the last step that is:
    Code:
    ant debug && adb install -r ./bin/Expo2013.apk
    gave me this error:
    Code:
    BUILD FAILED
    F:\android-sdk_r22.0.5-windows\android-sdk-windows\tools\ant\build.xml:649: The
    following error occurred while executing this line:
    F:\android-sdk_r22.0.5-windows\android-sdk-windows\tools\ant\build.xml:690: null
     returned: 1
    
    Total time: 1 second
    can't find './bin/Expo2013.apk' to install
    Do you have any solution for this?

    Thanks.

  8. #8
    Sencha User
    Join Date
    May 2013
    Posts
    25
    Vote Rating
    1
      0  

    Default

    I have some issues here after the apk built and installed, the splash screen (cordova showing device is ready) but it will never go to the page that I code. Please help...

  9. #9
    Sencha User
    Join Date
    Jun 2013
    Posts
    64
    Vote Rating
    3
      0  

    Default

    Hi please try Sencha Cordova builder https://github.com/bricemason/sencha...er/tree/master created by Brice Mason to create phonegap android project then do my step 6 to create apk file.

  10. #10
    Sencha User
    Join Date
    Oct 2013
    Posts
    6
    Vote Rating
    0
      0  

    Default Sencha Cmd 4.0 support phonegap & cordova

    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?

Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •