Android - getLocation() - android

I have developed an application for my company to track the work done by our agency people and also their location to capture the work places. As we don't want the agency people to browse other website, with the help of network providers we have restricted other websites and allowed only two URL where we run the webservice to store the information captured to the database. But since Android talks to google to get the location we also need map the maps.googleapis.com but when we tried it's not working. Can anyone tell me which URL we should map/whitelist to allow my application to access the google. Thanks

i would think u would get coordinates regardless of internet connectivity. of course i could be wrong. are you sure you added permissions for location services in the manifest. i know i have tested gps apps without internet enabled (emulator though). of course the map wont load but coords should be able to be read from the gps receiver.

If you're talking about getting your current location, then you should use LocationManager(search on SO or google, there are lots of posts about it). Otherweise you can take a look at the Developer Guide for Google Maps, but I'm not sure if Android even uses the same API, though.

Or you can only retrieve the coordinates from the devices to your database/server and you'll have the map and with the coordinates you'll know where are they. That would not need a map in the application, and no need for whitelisting the urls. This is another idea, though.

Related

Do a GPS device needs Internet Connection?

Actually I have lots of questions. I am developing a GPS device which gets the longitude and latitude location coordinates. Do I need any internet module? Can I use the device without any internet connection? Also, is it possible to get the coordinates and display it on my Application via Google Maps? Thank you for the help.
If you use the device's embedded GPS, you can get the longitude and latitude with no problem, without having any Internet access.
You can then use those coordinates however you'd like, so yes on Google Maps for example. Nevertheless, if you plan to use a Google Maps online API (for instance, the JavaScript API) you'll need an Internet connection to download and display the map. But there should be a way to use pre-downloaded maps offline, you will surely find it in the Google Maps API reference : https://developers.google.com/maps/documentation/
You can also take a look at some other mapping service providers (OpenStreetMap is one of the most used in replacement of Google Maps).
Sorry for not bringing a very precise answer concerning offline maps, but I hope this will help you with your issue :)
EDIT
It appears that it isn't possible to legally use the Google Maps API without an Internet Connection, according to Google Maps' Terms of Service

I am trying to pull an active user's location at any given time

I would like to find an API that allows me to pull a client's current location. I know Google Places and FourSquare have API's available. Basically, I want it to run at all times, as I am eventually going to create a dating app that allows you to see who is at a current bar/restaurant/social setting at any given time.
The fetch for the current location will obviously have to be running at all times, and there are considerations of using too many client resources. With that being said, what are some of my options?
Yes, you can use the Google Places API for this: PlaceDetectionApi.getCurrentPlace(). See https://developers.google.com/places/android-api/current-place (and the Getting Started guide).

Is there a way to access location history data from an android app?

Ours is a financial app and to curb forgeries we wanted to access users location history from our android app.
The purpose behind this is if the user is requesting the service from a place where he hasn't been often or never been there, we would flag them or ignore them or implement another layer of security.
I have searched and found that google maps maintains location history and google plus may have an undocumented API also.
Please suggest how to get access to location history of device.
That's not possible unless you keep track of the location history yourself.

Retrieve GPS data from Android Phone

To start this off, I do not have an android and have not in years. But, I have been asked by my SO's mother if there is a way to retrieve the location data (e.g. When the phone was at a specific location or locations) and export that into some sort of usable file.
I looked online and was not having much luck, everything I was finding mentioned installing apps to track future data, but I'm looking for past data.
The phone is a Galaxy S4...does anyone have any ideas on what can be done to retrieve this information?
Thanks!
Sign in to their google account using a browser.
Locate their user settings.
Somewhere in there will be a Location History.
If it has not been disabled it should show the location history of the device.
It'll show a calendar and you can click on the calendar to see what location data is available for each date.

On Demand Android User last location and not storing it

Can someone give a suggestion on how I can accomplish this? Basically my company would like to track all of its drivers route last location without having to store it. What I means is as follow.
driver A suppose to deliver 5 items to 5 different locations. So I have android mapped the driving route and off he/she goes. Location 4 called and said, its address has changed and would like someone to reroute the package to new location. So main dispatch, will need to check where Driver A is, so that he/she can be contacted and given the information.
I want the dispatch to be able to see driver A route and last location like this.
How can I accomplish this task without requiring Driver A android device to continuously broadcasting its last location and our server having to store all the devices information in our server. Basically I'd like to be able to find the last location of Driver A on demand and initiated by our server.
Hope I have explained what I wanted clearly. Please advise?
You can try the Google Cloud Messaging (GCM) or android-push-notifications.
What we decided to do at the end is, to store the historical location directly in our server every 5 minutes and write a code in the app to massage the information according to what we need. A reverse of what we didn't want to do before but we find no other way to accomplish what we want via google directly. Unless I'm mistaken. I'm open to comment. Many thanks.

Categories

Resources