Affects Version/s: Release 2.0.2
Titanium SDK version: 1.7.1 (06/21/11 14:28 1293a6d)
Platform: Android 2.2.2
Device: Motorola Cliq 2 (MB611)
Host OS: MacOS 10.6.8
Titanium Studio, build: 220.127.116.11107130739
(c) Copyright 2011 by Appcelerator, Inc. All rights reserved.
Build date: 13 July 2011, 07:42:08
My experience shows that geolocation doesn't work consistently in an Android WebView, even when android.permission.ACCESS_FINE_LOCATION is added to tiapp.xml.
- Add to tiapp.xml:
- Save and build as usual. Install to Android device and to iOS device for comparison.
- Verify that the permission privilege was added to build/android/AndroidManifest.xml.
- Open KitchenSink on Android device and go to Base UI > Views > Web Views > External URL. Geolocation test fails.
- Open KitchenSink in iOS device and repeat process. App requests location permission and test completes.
Here is my suggested resolution to the problem:
- Add the following to source code for TiWebChromeClient.java:
- Build and update titanium-ui.jar.
- Clean and build project and install new build to Android device.
- Open KitchenSink on Android device and go to Base UI > Views > Web Views > External URL. Geolocation test succeeds!