cordova-plugins

Unable to install plugins in cordova project

青春壹個敷衍的年華 提交于 2019-12-04 12:44:54
Am facing a big issue : Unable to install the phonegap plugins in my cordova project.Actually it was working fine still yesterday. Now whenever I try adding any cordova plugin using CLI in my cordova project. I get the following error; D:\Projects\test cordova>cordova plugin add org.apache.cordova.network-information Fetching plugin "org.apache.cordova.network-information" via plugin registry npm http GET http://registry.cordova.io/org.apache.cordova.network-information npm http 502 http://registry.cordova.io/org.apache.cordova.network-information npm ERR! registry error parsing json What is

How to test custom cordova plugin's native code?

心已入冬 提交于 2019-12-04 12:44:20
I know cordova-plugin-test-framework will help in testing any cordova project. I am developing a custom camera cordova plugin for Android platform. I would like to write some Junit/Instrumentation test cases for my custom camera Android plugin code. I am facing issues as I can't create CordovaInterface , CordovaWebView Objects from my test class. Is there anyway that I can create CordovaInterface , CordovaWebView Objects from my test class and pass these as parameters for my custom camera Android plugin excute method. I would like to avoid unit test cases at js level using cordova-plugin-test

External Storage Path (SD card) for Android 5.1.1 and later with Cordova

谁都会走 提交于 2019-12-04 12:27:02
I am working to develop an android APP with cordova,I wanted to create an folder everyday and store a txt file in it. everything I tried is working for the internal memory of each android but not for the External SD card, have a look and help me out, if(sDeviceVersion=='4.0' || sDeviceVersion=='4.0.4'){ var sPath = 'file:///storage/extSdCard/'; }else if(sDeviceVersion=='4.1' || sDeviceVersion=='4.1.2' ||sDeviceVersion=='4.3.1'){ var sPath = 'file:///storage/extSdCard/'; }else if(sDeviceVersion=='4.4' || sDeviceVersion=='4.4.4'){ var sPath = 'file:///storage/extSdCard/'; }else if(sDeviceVersion

Cordova - modify or remove MainActivity

喜夏-厌秋 提交于 2019-12-04 12:01:47
问题 I am developing a Cordova application which should run in a "Kiosk" mode - the device will be locked to that app and should not be able to exit. To achieve this I am using a slightly modified version of cordova-plugin-kiosk, which provides an extra activity ( KioskActivity ) that is defined as a launcher (it has android.intent.category.HOME ). This works reasonably well. However, the app still has the original cordova MainActivity, which causes some confusion, especially as this is what gets

How to upload saved video to a remote server, captured using cordovaCapture?

眉间皱痕 提交于 2019-12-04 11:17:51
I am using the captureVideo method of cordovaCapture as follows: $cordovaCapture.captureVideo(options) .then(function(videoData) { var file_path = videoData[0].fullPath; // upload to server }); I get the file path as file:/storage/....mp4 How to upload this file to a remote server, will I be able to access this file directly through my controller or will I have to process a url out of it? I am using the Ionic framework. Any help would be much appreciated. It is pretty simple. This will work only in ionic FW first you must be installed file transfer plugin. if not use this command: cordova

Cordova 3.5 deviceready event not fired after 5 seconds

一世执手 提交于 2019-12-04 10:24:32
I recently upgraded my cordova app from cordova v2.9 to v3.5.0. After adding plugins from command-line, I imported my app to eclipse so that I can test on an android device. But, when I run the app, I see below logcat message: 07-08 11:24:03.359: I/Web Console(1500): deviceready has not fired after 5 seconds. at file:///android_asset/www/cordova/cordova.js:1154 07-08 11:24:03.359: D/CordovaLog(1500): file:///android_asset/www/cordova/cordova.js: Line 1147 : Channel not fired: onFileSystemPathsReady 07-08 11:24:03.359: I/Web Console(1500): Channel not fired: onFileSystemPathsReady at file://

Cordova's FileTransfer Writing Error (Code 1)

大兔子大兔子 提交于 2019-12-04 10:22:14
I'm using Cordova 4.2.0 for Android. I have some troubles to get FileTransfer plugin work properly. I suppose that there is a writing error exception:".myApp\/contentImages\/20150110220101.jpg: open failed: ENOENT (No such file or directory)" filename was previously tested and does not exist yet: rootFS.getFile('.myApp/contentImages/'+file,{create:false}, function(){ console.log(file+' already exists'); }, function(error){ console.log(file+" does not exist locally"); console.log("Error #"+error.code); download(file); } ); And here is the download function: function download (filename){ var

What thread to use for Cordova plugin callback?

主宰稳场 提交于 2019-12-04 10:08:08
In what thread are the methods of CallbackContext supposed to be called? The documentation for CordovaPlugin#execute(...) says it's called in the WebView thread. Is that the same as the UI thread? If so, then that's probably my answer. If the WebView thread is not the UI thread, and I'm supposed to call back in the WebView thread, is it possible to do so asynchronously? I put you the Threading section of the android plugins documentation. The plugins are all asynch, when you call them you get a success or failure callback. The theads are just to not block the UI if the native task is too long.

Request Permission in Android Cordova plugin does not prompt the user

三世轮回 提交于 2019-12-04 10:02:34
I am trying to write a Cordova Plugin to have a Facebook chat head like floating icon for ionic hybrid apps which requires SYSTEM_ALERT_WINDOW Permission. Since Android M onward requires the user to grant the permission at the first time the app starts, I am trying to use Cordova plugin's cordova.requestPermission(CordovaPlugin plugin, int requestCode, String permission) method to prompt the user to grant permission (as in the documentation ). public class Floatie extends CordovaPlugin { public static final String ACTION_START_FLOATIE = "startFloatie"; public static final int REQUEST_CODE = 0;

accessing android internal storage with cordova file plugin

僤鯓⒐⒋嵵緔 提交于 2019-12-04 09:50:48
I'm trying to make an android app that, so far, is using the native voice recorder to record audio. The path for that is the Sounds file in /storage/emulated/0/Sounds Now the app is using the File Transfer cordova plugin. The root for that is /data/data/thisAppDirectory and requestFileSystem is using this as the path. Is it possible to go up a directory with the file system to get to the sounds folder? Yes here we go! You have to utilize cordova file-transfer plugin, like so: window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function(fs){ fs.root.getFile("'"+audioData[0].name+"'", {create