Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap on Android wont load external scripts

I'm making a simple app that will load a google map. but the problem is everytime I load this

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

It wont run on my android emulator while on desktop it works fine. how can I let Phonegap or Android allow external scripts to work/load?

UPDATE: I always get this error "Application Error: The connection to the server was unsuccessful.(file///android_asset/www/index.html). But if I removed the google map script. it works.

like image 616
psycrow117 Avatar asked Feb 21 '12 03:02

psycrow117


1 Answers

Actually, the whitelist is the issue like @TDeBailleul said, but he was referring to the location of the whitelist in iOS not Android.

In android, it is in /res/xml/PhoneGap.xml

There is an example of this file in this answer: https://stackoverflow.com/a/9187479/878602

like image 117
Devgeeks Avatar answered Oct 24 '22 00:10

Devgeeks