Recently i got task to make a mobile app which will run on iphone and android. Basically i am not a mobile app developer so the only choice i had was PhoneGap and jquery mobile.
I had app ready so my task was to wrap that in a phonegap wrapper to run it in ios and android os, after googleing i found that there is something named ChildBrowser
I found many different version of code for childbrowser plugin with android phonegap but many of them were not working properly. So i am posting the code here that worked for me properly. Hope this will help someone.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<script>// <![CDATA[ var cb = new ChildBrowser(); document.addEventListener("deviceready", onDeviceReady, false); function onDeviceReady() { try { window.plugins.childBrowser.onClose = closed; window.plugins.childBrowser.showWebPage("http://www.phonegap.com", { showLocationBar: false }); }catch (err){ console.log(err); } } function closed() { navigator.app.exitApp(); } // ]]></script> |
Hi Amit. Nice tutorial. I was preparing an android app using the phonegap child browser and found one issue. While accessing the app, it’s showing a white screen for about 30 seconds then then redirecting to the actual website. Just wanted to know, is there any way to overcome this.
Thanks in advance
You are trying in imulator or in mobile ? In emulator it takes little extra time, on mobile devices its little faster i guess.
Hi, could you please provide a sample project that using childbrowser plugin
thanks
You can download example code here http://jmp.sh/b/rtxNgVpNM0HYAQIJwdLQ
thanks for your reply