cordova-3

How tell plugman that I want to update a file that may not be present?

拜拜、爱过 提交于 2019-12-10 20:26:24
问题 I wrote an android phonegap 3 plugin that starts an activity (the activity is part of plugin) and uses a native android UI. Now I want to follow the plugin specification to be able to install the plugin using the CLI. My plugin has resources in the xml files /res/values/attrs.xml, /res/values/colors.xml and /res/values/ids.xml My issue is that those files are not created by the platform add android command, so I can't use <config-file> to patch them. I don't want to use <source-file> because

Cordova 3.2 ios add plugin “Which config.xml? Where is it?”

主宰稳场 提交于 2019-12-10 19:14:49
问题 My app name is mobile-app Create a cordova project add ios platform add plugin "cordova plugin add org.apache.cordova.contacts" go to project folder /platforms/ios/mobile-app/ and add the following to config.xml <feature name="Contacts"> <param name="ios-package" value="CDVContacts" /> </feature> want to build the ios project with terminal "cordova build ios" I get the error in terminal: generating config.xml from defaults for platform "ios" Preparing ios project Compiling app on platform

cordova 3.x (phonegap) - write on /data/data generates encodingException

自古美人都是妖i 提交于 2019-12-10 18:00:35
问题 I am trying to write a file on my application memory using the following code taken from here: writeOnFileSystem : function() { console.log("writeOnFileSystem resolveLocalFileSystemURL ..."); window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail); } }; function gotFS(fileSystem) { fileSystem.root.getFile("file:///data/data/com.company.app/readme.txt", {create: true, exclusive: false}, gotFileEntry, fail); } function gotFileEntry(fileEntry) { fileEntry.createWriter(gotFileWriter,

Cordova Connection to server was Unsuccessful

瘦欲@ 提交于 2019-12-10 12:59:53
问题 The Connection to the server was unsuccessful(file:///android-asset/www/index.html) is showing when i run my android application. please let me know how to resolve this issue. 回答1: For latest Cordova (4+) this a setting in config.xml : e.g. <preference name="LoadUrlTimeoutValue" value="70000"/> Increases default timeout to 70 seconds (default is 20), reducing the chance of timing out. Docs: https://cordova.apache.org/docs/en/latest/config_ref/index.html#preference When loading a page, the

Cordova/PhoneGap Plugin Development Workflow for Android

五迷三道 提交于 2019-12-09 12:16:54
问题 I am developing a set of Cordova plugins. The initial implementation will be Android only, so for now I am interested in being able to use ADT in Eclipse for plugin development. I've read over the documentation and have been able to get the first plugin completed, but the workflow is a bit of a pain. I couldn't find any docs or tools in Cordova that specifically support plugin development workflow. I wonder if I am making it harder than it needs to be? Here is what I am doing. The plugin is

Add Parameters to Cordova-CLI Hook Scripts?

烂漫一生 提交于 2019-12-08 19:57:03
问题 Is there a way to pass in command parameters to a Cordova-CLI hook script? Specifically I want to skin an application for a few clients and I would like to copy in their specific settings before the build by passing in an id number or something. 回答1: You can access parameters passed to cordova hooks via environment variables. You can set an environment variable that will stay 'alive' for the current session. For example, if we have a variable called 'TARGET': Windows cmd: SET TARGET=someValue

Problems using phonegap / cordova file plugin part 2 - synchronicity

有些话、适合烂在心里 提交于 2019-12-08 05:08:33
问题 I want to add some simple logging capabilities to my cordova app. So I added the file plugin, implemented a super simple log method and tested. My configuration: $ cordova --version 3.5.0-0.2.7 $ cordova plugins org.apache.cordova.file 1.3.0 "File" The test device is a Huawei u8850, running Android 2.3.5 The Logger: window.MyLog = { log: function(line){ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(FS) { FS.root.getFile('the_log3.txt', {"create":true, "exclusive":false},

Offline Maps in cordova using leaflets make my app stores much capacity

柔情痞子 提交于 2019-12-08 03:14:53
问题 I have followed this link http://davidrs.com/wp/phonegap-3-0-leaflet-offline-maps/ and it is truly powerful. However, my app stores large amount of data especially tiles. Is there any other ways to make the maps offline with less storage? Notes: I use google maps for online mode. 回答1: Save the tiles as JPGs and/or restrict to certain zoom-levels in order to avoid heavy tile folders. Only offer the min. required map area. Other than that there is not much you can do. 回答2: Use this code in your

How to access cordova functions from an IFrame in phonegap IOS

烈酒焚心 提交于 2019-12-08 00:52:08
问题 IN my Phonegap ios project i have an i frame and src of Iframe is a local html page within the same www folder . inside the html (IFrame source) one button and onlick listener. i need to open one website while clicking that button in InAppBrowser or in safari (new window). i cannot able to access phonegap methods from the html file (IFrame source), i includeed cordova on both html files, my source html page given bellow, this page is shown in an Iframe. <html> <head> <script type="text

Cordova 3.1 Oriention not working

落花浮王杯 提交于 2019-12-08 00:32:51
问题 I have an application (Cordova 3.1) which should only be displayed in portrait. My config.xml: <?xml version='1.0' encoding='utf-8'?> <widget id="de.something.test" version="0.0.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>Something 2.0</name> <description> A sample Apache Cordova application that responds to the deviceready event. </description> <author email="dev@callback.apache.org" href="http://cordova.io"> Apache Cordova Team </author>