cordova

Phonegap camera draw on canvas distorted

耗尽温柔 提交于 2020-01-16 11:25:10
问题 I'm using Phonegap Camera Plugin to draw the captured image on a Canvas. <canvas id="canvas"></canvas> And the JS: var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); canvas.width = window.innerWidth; canvas.height = window.innerHeight; var x = 0; var y = 0; var width = window.innerWidth; var height = window.innerHeight; var imageObj = new Image(); imageObj.onload = function() { context.drawImage(imageObj, x, y, width, height); }; imageObj.src = imageURI;

How to get playstore app verson name and version code android application cordova

China☆狼群 提交于 2020-01-16 08:36:28
问题 i have one app in the play store, how can get play store application version name and version code using Cordova, any suggestion appreciated 回答1: To check updates, you need to take a platform-specific approach iOS Approach You need to send a request to https://itunes.apple.com/lookup?bundleId=BUNDLE_ID Once you get the result, you can fetch the version from response.data.results[0].version and then compare it with the local version. Now, if the version is different, you can send the user to

cordova send message to javascript

情到浓时终转凉″ 提交于 2020-01-16 07:29:11
问题 Im using Cordova-Android (PhoneGap). I'm extending the CordovaWebViewClient class, overriding the shouldOverrideUrlLoading method. I need to send some javascript to the view. I've tried this, but it doesn't work: @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { if (isNetworkAvailable()) { sendJavascript("javascript:alert('OK')"); return false; } else { sendJavascript("javascript:alert('NO')"); return true; } } What am I doing wrong? Any help? Thanks in advance. 来源

How to make a PhoneGap application save current geolocation less often?

≯℡__Kan透↙ 提交于 2020-01-16 05:17:05
问题 I'm working on an app for fun which allows you to record routes you take. I'm using this to learn about the Google Maps API as well as Phonegap Build, so those are the tools I'm using here. I made a rudimentary app which collects position data (lat,lng) into an array, then uses Google's API to display the results on a map. In the future I'd like to connect them with a line, allow comments, et cetera. Here's what a drive around my neighborhood looks like: Pretty neat. However, something's

Phonegap display images with the path 'cdvfile://localhost/persistent'

删除回忆录丶 提交于 2020-01-16 03:26:49
问题 I'm currently developping an app with phonegap and I want to update the content of my application which is on wordpress. Through an JSON API, I get the html content of the pages, but the problem is getting the images choose by the user. What I have done, is send a zip from wordpress to my smartphone which contains the new html content, and the new images. I download the zip, apply the new html content, and copy the images inside 'cdvfile://localhost/persistent' which is translate to '/storage

i am trying to make an ajax request from my phonegap app to servlet running on my laptop,

徘徊边缘 提交于 2020-01-16 02:55:31
问题 i am trying to make an ajax request from my phonegap app to servlet running on my laptop, its hitting server but the ajax request is always going to error part. If i will do the same request in normal browser working fine. function cred() { var username = "hisari"; var password = "kumar"; var ul = "ip" ; $.ajax({ type: "GET", url: ul, dataType: "json", success: function(msg, textstatus) { alert("success"); if (msg.id != null) { } else if (msg.error_id) { //Error alert('Error logging in:' +

iOS Cordova: Does Cordova create multiple instances of an objective-C plugin when called more than once?

时光总嘲笑我的痴心妄想 提交于 2020-01-16 01:12:08
问题 I am working on a iOS hybrid application based on Cordova. We have a Objective-C plugin file (MyPlugin.h and MyPlugin.m) which is typically a subclass of CDVPlugin. We call the objective-C plugin from a JavaScript file like below. cordova.exec(success, error, "MyPlugin", "callNativeActivity", args); Here, success- success callback function, error- error callback function and args- array of arguments. Below is the native plugin method signature. -(void)callNativeActivity:(CDVInvokedUrlCommand

Cordova removing my changes in main activity class after building cordova project

泄露秘密 提交于 2020-01-16 01:09:07
问题 I am adding some extra stuff in my cordova project's Main activity class (overriding some functions like onResume) but cordova remove them after every cordovaBuild. What should I do to prevent this behaviuor? 回答1: Sorry I have no time right now to elaborate. If you don't know how to do plugins, the easyest is to go with hooks. Basically hooks are scripts you can add between each step of cordova cli. so you would add a script in projecthome/.cordova/hooks/before_prepare to save your java file

Ionic iOS remove default splash screen

做~自己de王妃 提交于 2020-01-16 01:08:30
问题 I tried this BUT didn't work <preference name="SplashScreen" value="none"/> After this I also tried ionic platform remove ios ionic platform add ios ionic emulate ios But it didn't work Other details: vishal$ ionic -version 1.7.10 vishal$ cordova -version 5.4.0 vishal$ npm -version 2.14.7 config.xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <widget id="com.ionicframework.splashscreenapp489828" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache

Firebase on Cordova doesn't trigger notifications on iOS Devices

人走茶凉 提交于 2020-01-16 01:08:26
问题 I'm making an app for iOS ed Android with Cordova. I've installed this plugin: phonegap-plugin-push and works on Android. So about iOS, i've installed che certificates in the Firebase project into console. Infact when i try to run notifications for testing i see this: 17 app users associated are the testing I've done about the token communications. The certificate was create .p8 certificates from apple developer console, and i think is correct what I done, because we can see the devices