[Phonegap+sencha Touch] Mobile development Sencha Touch Project by Phonegap after packaging the program name problem

Source: Internet
Author: User

Said before

Sencha phonegap Init com.pushsoft.myapp MyApp

After the packaged program install package APK name is "myapp.apk", the program name displayed on the phone desktop (the text below the icon) is also "MyApp"

If you want to change to a different name, change the Myapp\config.xml file, and change the top "<name>MyApp</name>" in the middle of the MyApp to the required name. Note that the assumption of XML content in Chinese, to be changed to UTF-8 encoding, note that the text file encoding, not the top "<?xml version= '1.0 ' encoding= ' utf-8 '"?>. It is recommended to change the encoding of the text file with notepad++.

The problem here is that if you change the name to a full Chinese, such as "My Program", it will cause the Sencha app build native to fail (PhoneGap local build Android is also a failure), for example:


Figure one: Project name garbled



Figure two: Compilation failure



Figure three: Java files in the generated Android project do not have a file name



Figure IV: The contents of the Java file with figure two, no class name causes compilation to fail


The reason is that the Java file class name comes from a file in the CONFIG. "<name> My program </name>" middle name, Cordova or PHONEGAP support for Chinese is not very good, resulting in such a situation.


The workarounds are as follows:

Open C:\Users\username\.cordova\lib\android\cordova\3.4.0\bin\lib\create.js and find the following red box content



Change to look like this:


The purpose of this amendment is to assume that the name in config. cordovaexample is in English, use the name of the English language, and assume that the name is changed to full Chinese.


After the packaged program installation package APK name is "cordovaexampleapk", the program name displayed on the phone desktop (the text below the icon) is "my program"


Suppose you think that the apk name "cordovaexample.apk" is not very good, but want to change the file name, for example, want to put the package name (such as "Com.pushsoft.myapp") as the last part of the file name ( such as "MyApp"), Can change this:



Related Article

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.