Google Play or HTML5 geolocation - android

I am currently an app which fetches user location at regular interval. I am using google play services api for that. It works fine. But sometimes it fails to get location even if it connects to playstore. I found none these issues with foursqaure app. I came to know that they are using HTML5 geolocation api from stackoverflow itself.
how foursquare determine a user location?
How can i implement this Geolocation api in my app?
What are the benefits and problems of using this api?

That's a very very broad question.
The easiest solution is implement what you need to be done in javascript, for example getting a position:
navigator.geolocation.getCurrentPosition(function(position) {
do_something(position.coords.latitude, position.coords.longitude);
});
Now, where to run this code, a straightforward solution is just running it inside a webview.
Other alternatives for running Javascript on android are V8 or Rhino.
I really can't help you any further, considering you never tell us what you want to do with the geolocation.

Related

Does a WebView app have access to Android features?

I am sorry if this is not the correct place to ask these questions but I cannot find the answer anywhere. I have built/building an app that basically displays a leaflet map and tracks users in real time with node and socket.io It has various functions but everything is contained either on or over the map. What I need to know is.
Will this run properly in a WebView app?
Can it run when the app is on but in the background (This has to run to keep the connection open and update location with the watch.position function)?
Can it access the HTML5 location features?
Can I access things like if I want to send a SMS from it via a button on the webapp?
Can I access the camera?
Whats the quickest software to use to develop this and could a similar app be made for iOS?
Sorry if a lot of questions but from what I have read WebView should be good enough as most of the work is back-end and map/browser based anyway. Or should I go down the native route?
I have done a couple of cross platform apps for iOS and Android with Cordova. To answer your questions: In a nutshell, I think you can do most of what you are trying to do with a framework like Cordova.
No.
Not with the webview, but maybe with Cordova (there is a plugin for background services).
Not with the webview, but yes with Cordova.
Not with the webview, but yes with Cordova.
Not with the webview, but yes with Cordova.
I am now a native developer for both iOS and Android. I would probably not do an app cross platform again unless it was really simple. I was always able to make things work in Cordova, but with a lot of hacking involved. Since you are familiar with javascript/html Corodova or Phonegap would probably be fastest in terms of development time for you.

How can I use native iOS/Android maps in Ionic Application?

I'm developing an Ionic app that allows the user to select a point of interest and edit the data. To do so, I need to display a map. I've tried using Google Maps, Leaflet, Bing Maps and they work fine (some are a little bit laggy) but a co-worker warned me that the performance would get worse if I started showing all the markers. (I know that I can use plugins to cluster, but thats not the point).
My supervisor said that it would be better if I used native mobile maps. When the app is launched in Android, the map shown to the user would be the android native map and the same thing for iOS.
Can someone explain if this is even possible? I googled it already but I couldn't find any good alternatives.
Thanks!
I think a way to achieve this is to detect the platform and use specific code for each :
PhoneGap - Detect device type in phonegap
(Ionic is based on phonegap/cordova)
You can also develop a cordova plugin who use differents API from each platform. There is already a cordova plugin for maps, but who only works on ios and android, and only with google map :
https://github.com/mapsplugin/cordova-plugin-googlemaps
Hope this help

Google Maps API v3 navigation (like Google maps for android)

In our app we do use the Google Maps API a lot. The app (web) is build in Jquery, CSS, HTML.
The app runs in the browser.
But we like to add the navigation functions like the Android Google Maps native in our webapp.
Is that possible with the Google Maps API or do we need to convert to native to realise
something like that?
I just wrote a long winded answer introducing the Directions service, luckily I re-read the question before answering...
No there is no Javascript equivalent of the android navigation services unless I'm very much mistaken. I imagine it would be possible to create a custom solution (I presume you want the route to update as you travel based on your gps coords etc) leveraging the route-parts returned from a directions request but this would be none trivial.
I would have thought the simplest solution would be to pass the start and end points of your route to the native maps app, however I am no expert at Android development (or interaction between a web app and a phone).

Is Google Drive RealTime API for Android?

Does Google Drive RealTime API still not support Android? I did it using JavaScript but want to use it in Android. I don't think it does exist cause no official blogs say that and it doesn't even appear on the Developers site. Is there any alternative for these purpose? Or I need to just do it all myself till Google announces anything? And if so can you please suggest me should I put everything on my server and send it to devices using GCM; or should I use Google App Engine?
A very similar question here: StackOverflow Question. But I even found these links saying it does Link 1, Link 2. So any updates?Please help thanks :)
Currently Realtime API does not support Android, sorry.
BUT! Google are working on this, and it should be available quite soon. Google are excited about the possibility of users collaborating simultaneously between web and mobile apps in real time. That is going to rock!

Morphing PHP driven site functionality into an Android App?

I'm completely new to Android DEV.
I want to make an app for a client that sells music, the idea is that it will be an alternate front end to the PHP site but will use some of the phone functionality such as locality etc.
Could anyone recommend the best approach to this? Would I look at developing via the Android SDK or via Flex/Flash? Is it possible to use php connections to retrieve dynamic data via android?
Any advice very gratefully received.
Thanks
Paul
Your best bet would be developing your app using Android SDK as you can use all the available native features. From a Flex perspective, you have a limited set of existing android API functionality that is supported.
As long as your PHP backend supports all your HTTP requests, you are good with both Flex as well as Android way.
Hope it helped.
I highly recommend you check out jQuery touch. It is a simple UI, but you get features like access to location (I believe through the html5 geolocation api (if they allow you to know their location)) and the list layout would work perfectly for purchasing music.
Obviously this is just my opinion. The Android API can be a little overwhelming at times but you will obviously have the most control over the phone and hardware, but jQuery touch keeps it simple. http://jqtouch.com

Categories

Resources