java - PhoneGAP, Cordova : Modifying Android project to load external URL -


i trying hands on cordova , phonegap. tutorials available, able create cordova app command-line, , add android platform via below mentioned commands. imported android project in android studio. phonegap takes html, css content, modified index.html load external url, didn't work. doing wrong? how can point application load external url? there many other suggestions saw, none of them have data do. thank you.

also, when changed in config.xml file index.html url, opened chrome instance instead of opening in app.

commands :

cordova create hello com.example.hello helloworld cordova platform add android --save cordova build 

mainactivity.java :

public class mainactivity extends cordovaactivity {     @override     public void oncreate(bundle savedinstancestate)     {         super.oncreate(savedinstancestate);          // enable cordova apps started in background         bundle extras = getintent().getextras();         if (extras != null && extras.getboolean("cdvstartinbackground", false)) {             movetasktoback(true);         }          // set <content src="index.html" /> in config.xml         loadurl(launchurl);     } } 

added below line in index.html, didn't work either :

    <script>window.location.href="url_i_am_trying_to_open"</script> 

config.xml :

// trying open google.com   <content src="http://www.google.com" />     <access origin="*" />     <allow-intent href="http://*/*" />     <allow-intent href="https://*/*" />     <allow-intent href="tel:*" />     <allow-intent href="sms:*" />     <allow-intent href="mailto:*" />     <allow-intent href="geo:*" />     <allow-intent href="market:*" />     <preference name="loglevel" value="debug" /> 

how can load external url in app itself. thank you.

what allow-intent tag open schemes/urls put on href property on system app can handle scheme, right <allow-intent href="http://*/*" /> opening chrome google url.

the tag need isn't allow-intent, it's allow-navigation

add <allow-navigation href="http://www.google.com" /> allow navigation inside app google.com , rest of urls open in chrome, or add <allow-navigation href="*" /> allow navigation website inside app


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -