Software Archive
Read-only legacy content
17061 Discussions

href to bring up google maps

David_S_18
Beginner
357 Views

I'm trying to get a simple test app going that will allow me to read a list of businesses from a web server and permit the user to call the business or bring up directions to the business.  This is currently an HTML 5 app without Cordova since I didn't want to use any additional libraries that weren't required.

I'm able to read in the json list of businesses and populate a UI list (in App Framwork) just fine (it' uses Angular to create a set of list items from the json object.  I'm using the API Explorer Web Service to access the json from the server.

I'm also able to get the "tap on the phone number to initial a call" feature to work by just using a link format as follow:  href="tel:{{entry.Phone}}"

I was hoping that an equivalent link format, something like href="geo:{{entry.latlong}}" could be used to bring up the phone's default mapping program and allow the user to get directions to the business but this doesn't seem to work.  In the emulator, it doesn't work on either Apple or Android devices.  When I try to Test it using the Intel Apps Preview app on an iPhone, it looks like its trying to open something but is unsuccessful.

I also tried some variations of href="http://maps.google.com/?q={{entry.Geo}}   (and the equivalent for maps.apple.com) but in those cases, the app tries to bring the link up within the app itself but it never completes loading it.

(Just as a test, I changed the link to just www.google.com and it will bring up that page but images on the page don't render.)

The next step to try, before I go to javascript to try and solve it, would be to bring up the maps.google.com type link in the phone's browser.  Is there a way to modify an html href=  link that causes it to bring it up in an external browser rather than in an iframe.

I added a * to the Cordova white list on the Build page (althrough I'm not sure if this is even used in the Emulate and Test modes of running an app).

I also added geo:, http:, and https: just in case this was required

Thanks for any help you can provide.

Dave

 

0 Kudos
4 Replies
Elroy_A_Intel
Employee
357 Views

I recommend that you review this article with step by step information for resolving your issue in regards to opening web pages outside of your application.

http://weblog.west-wind.com/posts/2015/Jul/02/External-Links-in-Cordova-for-iOS

0 Kudos
David_S_18
Beginner
357 Views

Thanks.  So does that mean I have to build the XDK app with Cordova (not just HTL5) in order to open web pages outside of the application?

Also, is it true that a website like maps.google.com will not load into the apps internal browser?  Are their specs somewhere as to what the features of that browser are --what kinds of sites will work in it and what kinds won't?

Thanks,

Dave

0 Kudos
PaulF_IntelCorp
Employee
357 Views

When you build an "HTML5 only" app with the XDK, for Android, iOS or Windows, you are building a Cordova app. The only difference is that you cannot include plugins and the cordova.js file is not included in the default template. It's better to just start out with an "HTML5+Cordova" app, they run in the same environment and the latter allows you the option of using plugins. You can create a Cordova app that has no plugins, and you'll have the same thing as the "HTML5 only" app.

Your app is running inside of a "webview" not a mobile browser. There are some differences. See this blog for a little bit of help > https://blogs.intel.com/evangelists/2014/09/02/html5-web-app-webview-app/

0 Kudos
David_S_18
Beginner
357 Views

Great, thanks for clarifying the difference between Cordova+HTML5 and HTML5.

0 Kudos
Reply