Issue with Phonegap in app browser - html

So I have been trying to load http://yahoo.com in a phonegap application. So when user opens the app, it automatically shows yahoo website as an app. Everything I do I'm still getting phonegap splash page and don't really know what else to do. Documentation on phonegap doesnt make sense, its confusing and in addition to that Cordova and Phonegap versions (in references) are wrong version.
Can you please put me in a right direction with a dummy guide to achieve this? I have done this last year but couldnt find my test app any more.
Thank you all.

You want to load yahoo page inside your application and open the yahoo page as soon as your application is opened. Right?
To do this create a phonegap application. Assuming you know how to do it.
Add inAppBrowser plugin.
Then inside the device ready event,write this code.
<script type="text/javascript" src="cordova.js"></script>
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady()
{
window.open("http://www.yahoo.com",'_self',"location=no");
}
</script>

Related

How to make a web page compatible with google chrome

I have include Html page into another html page in Dreamweaver using the below code
<script type="text/JavaScript">
$(function(){
$("#header").load("header.html"); });
</script>
but this code is not with Google chrome browser.
Please help me out how to make a web page compatible with Google chrome browser.
It seems that you open this page as local file. For security purpose Goodle Chrome doesnt allow to make AJAX call to local files. To solve this problem you can install the local webserver and open the page using http:// protocol instead of file://

phonegap.js or cordova.js not working in appmobi XDK and app.lab

i'm beginner in phnegap. while searching easy testing tool for phonegap i found appmobi xdk for desktop and app.lab for mobile. it looks easy to work with it. but when i tried to run some phonegap functions like:
function captureVideo() {
// Launch device video recording application,
// allowing user to capture up to 2 video clips
navigator.device.capture.captureVideo(captureSuccess, captureError, {limit: 2});
}
etc. it throws and error "can't read property 'capture' of undefined". i'v set the
<script src="phonegap.js"></script>
inside head tag but no luck. when i tried it with phonegap build in https://build.phonegap.com/apps. it works fine.
i'm bit confused here. is XDK and app.lab are just for testing html5 apps or it supports phonegap features too like notification, camera, capture etc.
Thanks !
I ran in the same issue times ago. Depending on your configuration device or capture is the undefined object. You have to add the Device, Capture and Camera plugins.
If you are using intel xdk you can set them by going to the project view -> plugin and permissions
see: https://github.com/apache/cordova-plugin-media-capture/blob/master/doc/index.md

How do I leverage HTML5 Cache Manifest with Google Maps Javascript API V3 for a faster experience

I'm currently developing a mobile application using html5 + phonegap, and everything is working well.. The only issue I'm having is that scrolling through a map on a phonegap made native app it's sluggish and slow, zooming on the map is quite slow as well. Is there any way to increase map rendering speed / tile loading using html5 and / or cache manifest file?
I was reading around and saw something about using cache manifest to combat these quirks? I haven't found any good documentation on it so I figured I would ask here?
Any help in speeding up map loading is greatly appreciated!
Try to put the google map JavaScript files into your cache manifest file. let's say your files source are
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?v=3.3&libraries=geometry&sensor=true"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
Put the source values of your Google map apis into your cache manifest file and than check your application again, it might help you to zooming the map faster.
Put your own api's which you used.

phonegap Html 5 application - android javascript libraries are loaded only in first index.html page

I am trying to create a phonegap HTML5, jQuery mobile app.
Everything is ok in the first index.html page.
When the user clicks to an internal link ex test.html,
the libraries are not loaded (ie I can't run their functions) unless
I add their code and declarations inline in the first index.html page!
I am really stack, it doent make any sence!
Ondeviceready function doesn't fire at all.
If I run the page from pc's google chrome, the js code runs normally!
Have got any ideas?
I was sooo wrong.
I did not realize that phonegap uses ajax to load different pages.
All javascript from pages other than the initial one (index.html) is stripped off.
Basically, you load all the js code in the index.html (in the js libraries included).
If anyone makes the same mistake as I did. This is the answer.

How to make an HTML5 that does not require the blackberry browser component?

I used the latest and greatest jQuery Mobile (RC1) to develop an app for the client. I used the latest Webworks version from RIM and packaged the app in a Cod file.
The app works great if accessed through the web browser ETC however when I installed the actual generated JAD/Cod files onto a blackberry device, performance was horrible even with minimum number of jQuery libraries.
Since I have Googled this everywhere and it is apparent that one cannot have a meaningful app experience if Webworks is used, I want to be able to just create something that just places the app icon on the phone. Once clicked, it open the browser and takes the user to the web server where the HTML files are parked.
Is this possible?
You can do that, with a very simple Java-application.
The following code:
Browser.getDefaultSession().displayPage("http://www.yourserver.com");
It will open browser and open page: http://www.yourserver.com
Browser class javadoc is here: http://www.blackberry.com/developers/docs/5.0.0api/net/rim/blackberry/api/browser/Browser.html