Cordova3+sencha touch2.x Environment Construction

Source: Internet
Author: User
Tags touch command

  1. 1. Installing Nodejs
  2. 2. Install Cordova:
  3. NPM install-g Cordova
  4. 3. Create a project:
  5. Cordova Create MyApp com.example.MyApp MyApp
  6. Where: The first MyApp is the name of a folder;
  7. COM.EXAMPLE.MYAPP is the app ID
  8. The second MyApp is the name of the project and the name of the application
  9. 4. Go to the folder
  10. CD MYAPP
  11. 5. Create an Android app
  12. Cordova Platform Add Android
  13. 6. Create a new Android project with Eclipse (import the MyApp catalog file just now) and you can develop it under eclipse.
  14. Attention:
  15. 1.eclipse to install the ADT plug-in first.
  16. 2. To download the Android SDK first, and add its path (for example: C:\Development\adt-bundle\sdk\tools) to the environment variable path.
  17. Otherwise , step 5 will error: [Error:an error occurred while listing Android targets]
  18. =============================================================
  19. At this point, the construction of PhoneGap is completed. So, how to combine with Sencha touch?
  20. 1. Install the Sencha Touch command line. (Shang Guan net download exe file: http://cdn.sencha.com/cmd/4.0. 1.45/senchacmd-4.0. 1.45-windows.exe.zip)
  21. 2. Unzip the Sencha touch compressed package, and store the directory for example:
  22. e:/webroot/touch-n.n/
  23. Command line, enter the directory, and execute the following command to create a Sencha touch project:
  24. $ Sencha Generate app MyApp: /myapp
  25. Or:
  26. SENCHA-SDK/PATH/TO/SENCHA-TOUCH-SDK Generate App Myapp/path/to/www/myapp
  27. 3. Go to the folder
  28. CD MYAPP
  29. 4. Add Android App support:
  30. Sencha Cordova Init com.example.MyApp MyApp
  31. Note: Keep the app ID and project name here consistent with the PHONEGAP project we created earlier.
  32. 5. Open the MyApp root directory, modify the Cordova.local.properties file, set the operating environment for Android:
  33. Cordova.platforms=android
  34. 6. Execute the command, package the file to the project directory.
  35. Sencha App Build Package
  36. Note: The default Sencha touch is packaged into the build folder in the MyApp directory, and I do not find the configuration to modify the path, so I need to first modify the build.xml below the MyApp to add a task:
  37. <target name="-after-build" >
  38. <copy todir="E:\phonegap-project\MyApp\platforms\android\assets\www" >
  39. <fileset dir="Build/package/myapp"/>
  40. </copy>
  41. </target>
  42. This will allow you to copy the files to the PhoneGap project directory.
  43. Finish it now!
  44. Sencha Touch a project +phonegap a project. The former outputs js+html to the latter, which is then packaged as an APK file.
  45. Other:
  46. 1. Originally Sencha built-in direct package as apk file, but my machine does not run correctly.
  47. BUG:
  48. Http://www.sencha.com/forum/showthread.php? 276203-possible-bugs-in-sencha-cmd-4.0. 1.45
  49. 2. The current in JS write Chinese, Sencha Touch packaging will be garbled. (Environment: Win7 + senchacmd-4.0 + SDK 2.3. 1)
  50. Solution: To JS inside the first line to add://@charset utf-8 can be.

Cordova3+sencha touch2.x Environment Setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.