You are here

Android

Build Android OS

navigator.geolocation not work in Android 4.1.2, soulution

One hybrid app with Phonegap 1.9.0 worked fine in Android 3.0 and 4.0, but when I update the OS to 4.1.2, the navigator.geolocation stop working.
Firstly i update the project with new version of phonegap cordova 2.7.0, it does not help. And I found even i test navigator.geolocation in Android native brower, under this demo link:

http://html5demos.com/geo
The gps operation was never be called. And i found many other developers have same problem in new Android OS.

At last I found one solution(not 100%, but at least works now):
My orginal code:

Google Maps is not available on Amazon tablet devices

Blog Terms: 

Google Maps is not available on Amazon tablet devices, if you need map, Amazon Maps API is required to be migrated.

Ref:
https://developer.amazon.com/sdk/maps/migrating.html

Sailfish OS

The Sailfish OS is a mobile-optimized operating system, baseed on Linux core, support Qt™ platform, and you can develop Android, QT, and HTML5 app for it.

This new mobile OS will release its first phone in China.

https://sailfishos.org/

Error "Access-Control-Allow-Origin" At Android 4.1

One of my Android Hybrid HTML5 app does not work now at Android 4.1.0, but it worked fine on 3.0 and 4.0.

Issue:
The app call one WFS service from other server, this Ajax throw exception:

11-22 14:30:47.062: E/Web Console(734): XMLHttpRequest cannot load http://xxxx Origin null is not allowed by Access-Control-Allow-Origin. at null:1

Solution:

if (Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) //16
// yourwebview, i use phonegap here
super.appView.getSettings().setAllowUniversalAccessFromFileURLs(true);

Why:

Subscribe to RSS - Android