phonegap-plugins

how to send data or message from java application / plugin to javascript with cordova / phonegap

霸气de小男生 提交于 2019-12-11 04:10:04
问题 I think I'm missing something here. I'm used to sending data from javascript to java and back with calls to execute and back with the callbackContext methods. But if at some points, lets say I have a running thread that needs to send data to the javascript at regular intervals, how should I do that then ? (This assumes that this task is running and has not been triggered by a javascript action, thus no callbackContext is available) 回答1: You can always execute javascript from java doing this:

Ionic app crashes on Android emulator and device

亡梦爱人 提交于 2019-12-11 04:09:05
问题 I'm building an app using the Ionic framework and AngularJS. It used to run fine, now it crashes as soon as it starts in both the emulator and an Android device. What is weird is that it runs fine in the Ionic View app (http://view.ionic.io/). The logcat says that the error is a NullPointerException. What really worries me is that I didn't do any big changes, and another app started to fail as well. How can Ionic Cordova fail like that? The complete logcat for the part of the crash says: ----

Phonegap iOS: Download image to Photo Library

我怕爱的太早我们不能终老 提交于 2019-12-11 03:56:53
问题 Is it possible to download a file (image) and save it in the Photo Library? I am aware of this download method, but it only allows to download to a location that I specify. On iOS I was unable to get the path to the Photo Library (and I know it doesn't just store it there, but also adds it to a DB) Does phonegap provide this ability in some way? Do I need to write a dedicated plugin for this? Thanks, Nadav 回答1: Ehh... I hate answering my own questions I found this was impossible without a

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,

Open external URL in cordova webview (NOT inAppBrowser)

旧街凉风 提交于 2019-12-11 03:51:17
问题 What I want to do? To open an external URL to open in the internal cordova webview, where the index.html file loads by default. What do I not want to do and why? Use the inAppBrowser, because (1) in android it shows the address bar. (2) The external URL of the website is such that people post links there often.. They all open up in the inAppBrowser. I would prefer them to open in a different browser in the phone. What have I tried so far without success? (1) window.location.href="http://www

Phonegap Android App, open links within app?

孤街浪徒 提交于 2019-12-11 03:26:20
问题 Is it possible to open a url within a PhoneGap compiled HTML5 app? We need to process our orders by sending a url to an external https webpage. We would like to open this page within our app rather than externally in the phone's browser? I know that Phonegap uses the webview class, but have no idea how to alter it to make URLs open internally! Thanks Paul 回答1: checkout the phonegap plugin childbrowser: https://github.com/purplecabbage/phonegap-plugins/tree/master/Android/ChildBrowser It

Oauth.io phonegap social login (cannot find hostname in file:///)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 03:14:28
问题 I have included oauth.js file. I am initializing the oauth using following code OAuth.initialize('public-key'); OAuth.popup('twitter', function(error, result) { console.log(result); //handle error with error //use result.access_token in your API request result.get('/1.1/account/verify_credentials.json').done(function(data) { console.log(data) alert('Hello ' + data.name) }) }); Its properly working in browser but not in device. I have tried to include following plugin in config.xml <gap:plugin

Cordova created files not showing in Windows Explorer unless restart of device

做~自己de王妃 提交于 2019-12-11 02:53:33
问题 I have recently created a Cordova Application to work on a Android table. everything is working great and my application saves audio files that have been recorded by the user by using the org.apache.cordova.media plugin. I am saving recorded sound files to a specific directory within "mnt/sdcard/" and when exploring the device using ES File Explorer i can see the .mp3 files. However if i navigate to the same directory within Windows Explorer (with my device attached via USB) i am unable to

Cordova multiple callbacks in Windows Phone 8

你。 提交于 2019-12-11 02:36:46
问题 I have a Cordova plugin which works fine for both Android & iOS. However, it fails when ported to Windows Phone 8 because it seems that multiple outstanding callbacks are not supported in Cordova for Windows Phone. The problem is this: When a DispatchCommandResult is called with a PluginResult which has KeepCallback set to true, a further DispatchCommand from a different method will call both its callback and the previous callback (the one with KeepCallback set to true). Worse still, if the

Phonegap plugin result when app is not active anymore

那年仲夏 提交于 2019-12-11 01:30:16
问题 I'm trying to edit the phonegap/cordova PushPlugin plugin for android in order to not create an status-bar Notification when app is not active but always doing some javascript work. I want to receive my GCM message an do some work on it with javascript at anytime. GCM message received by PushPlugin => javascript function called. I've no problem to make this working when my cordova app is active (ie in foreground or paused). But I can't use sendJavascript(...) when the app has been destroyed.