How to really exit a cordova application? - android

I put this code in a cordova (3.4.0) app:
<preference name="exit-on-suspend" value="true" />
<preference name="keepRunning" value="false" />
but when I push my home button for quit, and push it again, I can see the app keep running in the list ! so, what is the good param?

Related

cordova-plugin-ionic-webview - custom scheme not working on Android

I am developing (and near to the release) of a Cordova App for iOS and Android.
I am trying to use cordova-plugin-ionic-webview in order to use the latest WebView engines.
I am able to use this plugin on iOS but on Android the App crashes on launch.
MY CONFIG.XML:
<allow-navigation href="cordovaios://*" />
<allow-navigation href="cordovaandroid://*" />
<plugin name="cordova-plugin-ionic-webview" spec="^4.0.0">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
<preference name="Hostname" value="my-backend-url-to-avoid-CORS.com" />
<preference name="iosScheme" value="cordovaios" />
<preference name="Scheme" value="cordovaandroid" />
<preference name="ScrollEnabled" value="true" />
<preference name="MixedContentMode" value="0" />
<preference name="AllowBackForwardNavigationGestures" value="true" />
<preference name="Allow3DTouchLinkPreview" value="false" />
<preference name="WKSuspendInBackground" value="false" />
<preference name="KeyboardAppearanceDark" value="false" />
LOGS:
5726-5770/mycertificate.enterprise D/SERVER: Handling local request: cordovaandroid://my-backend-url-to-avoid-CORS.com/static/js/10.601e7973.chunk.js
5726-5773/mycertificate.enterprise E/chromium: [ERROR:render_process_host_impl.cc(4070)] Terminating render process for bad Mojo message: Received bad user message: Origin is invalid
5726-5773/mycertificate.enterprise E/chromium: [ERROR:bad_message.cc(23)] Terminating renderer for bad IPC message, reason 123
NOTE:
This config works fine on iOS. On Android I can't use this plugin due to this Hostname/Origin issue.
That custom scheme does not appear to be supported (just try to find something alike that in the source code). It is also beyond my understanding, for what one even would even need to register a custom protocol handler, while never leaving that WebView? The usual purpose is: to open another application.
<preference name="Scheme" value="https" />
<allow-navigation href="https://my-backend-url-to-avoid-CORS.com/*"/>
Unfortunately there is a lot of mismatching between the Cordova Android Platform version and plugins versions, which lead to some waste of time for nothing. Said so, for similar problemas I had like this I simply fixed them downgrading the version of Cordova or Android or the Plugin (or use the same version of android the plugin is using in their code example).

Cordova Webview and Splashscreen dont work

I installed Cordova plugin:
cordova-plugin-crosswalk-webview
Everything works fine with this plugin, but then I installed
cordova plugin add cordova-plugin-splashscreen
for creating splashscreen. In file config.xml in widget section I put this code:
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
Build was successful. After start application it shows splashscreen (for 5 second), but when splashscreen is disappear, it shows just white page instead my app. After I remove webview plugin - everyting works fine. How can I fix that problem?

IFrame Fills Area on PhoneGap instead of Fixed Position

My app works perfectly fine in the browser.
What I do is I show and hide this iFrame using a checkbox.
However when I released it for android, the new iFrame I added fills the entire page instead of having it's fixed position which I stated in CSS.
I'm converting my app to an Android app using PhoneGap Build.
My app uses the following permissions.
<preference name="permissions" value="none"/>
<preference name="orientation" value="default"/>
<preference name="target-device" value="universal"/>
<preference name="webviewbounce" value="false"/>
<preference name="prerendered-icon" value="true"/>
<preference name="stay-in-webview" value="false"/>
<preference name="ios-statusbarstyle" value="black-opaque"/>
<gap:plugin name="org.apache.cordova.file"/>
<gap:plugin name="org.apache.cordova.file-transfer"/>
<gap:plugin name="org.apache.cordova.inappbrowser"/>
<gap:plugin name="org.apache.cordova.network-information"/>
<access origin="*"/>
<plugin name="cordova-plugin-whitelist" version="1"/>
<preference name="phonegap-version" value="cli-5.2.0" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-targetSdkVersion" value="19" />
<preference name="AndroidPersistentFileLocation" value="Compatibility" />
Can someone explain why my app fills the page and does anyone know of a way to solve this problem?
EDIT:
I was able to fix the problem two different ways.
I merged the html of that page into my main app and merged the script into my main script.
I also fixed it using the .load JQuery API.
Even though I was able to solve my problem here I still don't understand why the iFrame filled the entire page.

Cordova Splashscreen does not work with Intel XDK

I activated the splashscreen plugin, created 9patch files and inserted them into the assets. What is more, I added this..
<preference name="SplashScreenDelay" value="10000" />
<preference name="SplashMaintainAspectRatio" value="true" />
to my intelxdk.config.additions.xml file and use
navigator.splashscreen.hide();
in my onDeviceReady event.
The splashscreen does not show anyway, when I build the app with Crosswalk.
What am I doing wrong? It would be nice, if you could help me with that.
Thx in advance.

Android permissions in Cordova 4.0 config.xml

I used Cordova 4.0 to create a phonegap app (that has worked fine via cli on iOS), but I also want to use build.phonegap.com particularly for Android.
The main issue is that upon installing the APK on Android, the security warning lists all features, when I do not actually need any.
I have read that you can remove all permissions with <preference name="permissions" value="none" />and then selectively add back the ones you want.
However, this is not working; I still get all the permissions requested upon install. I must be missing something, or something has changed. (Did I make a mistake using Cordova instead of Phonegap? That's reasonably easy to correct..)
My config.xml is below:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.test" version="1.0.0"
xmlns="http://www.w3.org/ns/widgets"
xmlns:cdv="http://cordova.apache.org/ns/1.0"
xmlns:gap="phonegap.com/ns/1.0"
xmlns:android = "http://schemas.android.com/apk/res/android">
<name>Test</name>
<description>
Test.
</description>
<author email="test#test.com" href="http://test.com">
Test
</author>
<content src="index.html" />
<access origin="*" />
<gap:plugin name="org.apache.cordova.statusbar" />
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#ffffff" />
<preference name="StatusBarStyle" value="default" />
<preference name="DisallowOverscroll" value="true" />
<preference name="permissions" value="none" />
</widget>
Edit: To remove ambiguity, I want to remove the Android security warnings saying this app needs full access to contacts, camera, internet access, etc. I do not need any of these.
config.xml , is just a bunch of information. It is not executed sequentially. so if you mention you require DisallowOverscroll permission and then mention you dont require any permission, it means ,
<preference name="permissions" value="none" />
will not overWrite
<preference name="DisallowOverscroll" value="true" />
for example:
<preference name="DisallowOverscroll" value="true" />
<preference name="permissions" value="none" />
and
<preference name="DisallowOverscroll" value="true" />
<preference name="permissions" value="none" />
both are same.

Categories

Resources