PhoneGap the pits that have been stepped in the app

Source: Internet
Author: User

Put the problems listed, if there is a solution, I will write down, if you have a better solution, welcome message OH

PhoneGap 2.9 cannot trigger Deviceready event

Pro can see the console has a wooden error, if prompted Cordova_plugins.json 404 (Not Found), in the WWW directory, create a new empty file, named Cordova_ Plugins.json is good, Cordova when initialization will request this file, but PO Master has not found the use of this file, but without this file, Cordova initialization failure, naturally does not trigger Deviceready event.

StackOverflow on this issue has been discussed, http://stackoverflow.com/questions/16095757/ What-is-the-cordova-plugins-json-file-for-cordova-is-requesting-it-at-initializ.

PhoneGap Camera Callback Slow

Just met this problem, PO Master is very crash, in Samsung S4 so slow, that's no, ah, after debugging, found that slow is the picture size problem

Code below, marked red is the focus, will be photographed compressed to 640 wide, the speed of flying general.

Navigator.camera.getPicture (function (imageData) {
App.startloading (' uploading images ');

App.uploadimg (imagedata,function (data) {
Console.log (data)

}, function (message) {
Console.log (' Photo failed: ' + message ');
}, {
Quality:75,
DestinationType:Camera.DestinationType.DATA_URL,
Savetophotoalbum:true,
targetwidth:640,
targetheight:1138,
Correctorientation:true

});

Illegal access exception with Localstorage

Originally thought to be some version of Android support for Localstorage, later found that GetItem () the content is null, the Json.parse will throw this exception, http://stackoverflow.com/ Questions/12846485/illegal-access-exception-with-localstorage-on-android-gingerbread

So add a layer of judgment after the GetItem.

Iscroll Event Recurring Issue

This PO master in the study, temporarily used a variable to control the event only once, but the symptoms do not cure, GitHub on the relevant discussion

Cond...

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.