cordova-3

cordova: how to call method after all modules are loaded

六月ゝ 毕业季﹏ 提交于 2019-12-13 00:41:50
问题 I am using Cordova and I'm using some plugins too. So now I want to do the task after all of the plugins/modules are loaded. How to achieve this in Cordova? Does Cordova provide any callback after the plugins are loaded? I have used onload but now i want some alternate to it. Is there some callback provided by Cordova to be called after all modules are loaded. 回答1: You can use deviceready . Check out the example .... <!DOCTYPE html> <html> <head> <title>Device Ready Example</title> <script

Phonegap Plugins work on CLI?

江枫思渺然 提交于 2019-12-13 00:11:45
问题 Does the Phonegap Plugins work on CLI or only on the phonegap online build? If yes, please tell me how to properly integrate the splashscreen plugin on phonegap 3.3. Thank you! 回答1: From Cordova 3.3 the right call is as follows: cordova plugin add org.apache.cordova.splashscreen Keep in mind to use cordova cli not phonegap, phonegap uses cordova but its focus is on the phonegap build, however it still allows you to do local stuff without the build. 回答2: Yes, plugins work locally, not just in

Getting plugin functions on Typescript

倖福魔咒の 提交于 2019-12-12 20:22:44
问题 I am trying to use some cordova plugins functions on a typescript file but i can't build the file. Imagine that I want to access the device platform and model. Can someone help me with this? Should I create interfaces for every function on js files of the plugin? Thanks in advance! 回答1: There are already definitions for that : https://github.com/borisyankov/DefinitelyTyped/blob/master/cordova/plugins/Device.d.ts interface Device { /** Get the version of Cordova running on the device. */

Windows 8 - Cordova - navigator.camera.getPicture

强颜欢笑 提交于 2019-12-11 20:19:39
问题 We are in the process of porting our HTML application to Windows 8 using Cordova/Phonegap 3.1.0. Most of it runs fine; however when we take a photo using the FILE_URI navigation, we receive what initially looks like a blob, but is just a string (I believe). An example string I get back when using the following code, could be: blob:00000000-0000-0000-0000-000000000000 Using: navigator.camera.getPicture(success, failure, { quality: 40, destinationType: Camera.DestinationType.FILE_URI,

requestFileSystem never returns Cordova 3.4 on iOS

六眼飞鱼酱① 提交于 2019-12-11 07:18:27
问题 I am in the process of updating my cordova app which was last released in January - prior to the significant changes to the File plugin. All is working fine in ripple (old style), but when run on the iOS simulator or iOS device (iOS 7.1), my window.requestFileSystem call will never return (neither fail nor succeed). This behaviour occurs for both persistent and temporary file systems. I am guessing I have some configuration problem. However, I have tried everything to no avail. Adding console

Phonegap getPicture function long delay, resumes on recall

自闭症网瘾萝莉.ら 提交于 2019-12-11 03:56:55
问题 I am having a problem when capturing a photo in Cordova / Phonegap 3.2 app on Android devices. When I run the navigator.camera.getPicture function, the camera returns success after around 30 seconds, sometimes longer. However, when I tap the camera button again (running the navigator.camera.getPicture function again, without capturing the shot), it immedietyl return the control back to the app and resumes the process of the app. It looks that like the app it stuck after I capture an image

Cannot use asynchronous methods in Cordova 3.4. Onsuccess is not called after the first call of plugin method

点点圈 提交于 2019-12-11 03:55:48
问题 Following code does not work properly: public class TestPlugin extends CordovaPlugin { public static CallbackContext callbackContext; class TestRun implements Runnable { public void run() { try { Thread.sleep(10000); } catch (InterruptedException e) {} PluginResult result = new PluginResult(PluginResult.Status.OK, callbackContext.getCallbackId()); result.setKeepCallback(false); callbackContext.sendPluginResult(result); } } @Override public boolean execute(String action, JSONArray args,

How to create subfolder using Cordova

强颜欢笑 提交于 2019-12-10 23:42:50
问题 I'm using Cordova and I tried to create a folder to the root of my SD card on a device. I used the following code for create the folder and add a file 'login.txt' inside it: window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail); function gotFS(fileSystem) { fileSystem.root.getDirectory("citylook", {create: true}, gotDir); } function gotDir(dirEntry) { dirEntry.getFile("login.txt", {create: true, exclusive: true}, gotFile); } function gotFile(fileEntry) { // Do something with

Apache Cordova - don't build i386 architecture

瘦欲@ 提交于 2019-12-10 21:06:57
问题 I'm getting an error in my build (using cordova 3.4): Undefined symbols for architecture i386: "_iconv", referenced from: zxing::qrcode::DecodedBitStreamParser::append(std::string&, unsigned char const*, unsigned long, char const*) in zxing-all-in-one.o "_iconv_close", referenced from: zxing::qrcode::DecodedBitStreamParser::append(std::string&, unsigned char const*, unsigned long, char const*) in zxing-all-in-one.o "_iconv_open", referenced from: zxing::qrcode::DecodedBitStreamParser::append

Ionic:Android Emulator Error

半腔热情 提交于 2019-12-10 20:59:18
问题 I'm trying to test my Ionic(3.16.0) hybrid app using Android Emulator that ships with Android Studio v3.0. /myapp> ionic cordova build android successfully creates the build. But when I run /myapp> ionic cordova emulate android the emulator starts and loads the screen, however, I'm not able to locate the my app in the emulator. Also the stack trace in the terminal logs are seen below: Waiting for emulator to start... emulator: Requested console port 5584: Inferring adb port 5585. Hax is