Android App using accelerometer and Google Maps API - android

I want to develop an app that reads the accelerometric values(of the phone's accelerometer) and on passing a certain threshold value of accelerometer, it should send a message with the phones position in Google Maps co-ordinates.
Is this project technically feasible?
I can develop an app that reads accelerometer values but how to design it in such a way that sends a message of the phone's co-ordinates in Google Maps?

Your question is too broad to supply code for it, that you will have to do yourself, but here are the steps you will need to implement.
Set up a google maps activity/fragment. This is explained in detail on the google developer docs.
Receive an event when accelerometer value's are updated.
Based on the accelerometer values, determine whether or not threshold is passed. If yes proceed with 4&5, if not, exit and wait for new accelerometer readings.
Get a Location(lat/long) from the FusedLocationApi. This is explained in detail on the google developer docs.
Place a marker on the map with that Location. If there was already a marker from a previous reading, remove that one before adding the new one.

Related

Navigating& providing directions to a user's GPS location

I've read Google's API policy on Location Services & Maps API, they do not allow one to make an app that provides directions to a user's location. I however wish to make such an app. I know I need to use a third party Maps API, but im unsure if this sort of app would be allowed on the play store.
I've searched extensively. The only references to this not being allowed in the the Maps API terms of service, but no where else. +
The idea is simple, one person sends a request to another, and they track each other with directions provided to find them.
Revalent reddit post by myself.
http://www.reddit.com/r/androiddev/comments/2qcm22/would_i_get_in_trouble_w_googles_policys_if_i/
I do not understand that it is difficult , you can use Google maps , first try to get another exact coordinates of latitude and longitude , and put them on a Google map , then make getting location via satellite.

Google distance matrix web service limit

According to this Google document there are limits on using Distance matrix web service.
From the document :
Use of the Distance Matrix API must relate to the display of information on a
Google Map.Use of the service in an application that doesn't display a Google map
is prohibited.
I am not clear whether I meet this limit or not.
Let me explain how I use this web service. I call this api from server to get distance between locations. Using this distance I just decide that user1's entered location is near to user2's entered location or not. I don't use this information to display on google map. But at client side I display google maps with marker for user's entered location and markers for nearby users' location.
Using web service and google maps this way, do I satisfy the above mentioned limit?
Note : I also call direction web service at client-side to display routes on map.
MAPS API
Your usage is fine. I think the whole point of the Google guidelines you quoted above are to stop people using the distance matrix and other Google Maps APIs (without a Google MAPS API business account) from using it outside of any "app" scope for financial gain or in situations where there is a simpler solution that doesn't require their API. (I will get to this soon)
This is also the reason they impose lower limits on the numbers of API calls you can make per day when using a free Google Maps key:
Normal - 2 500 elements per 24 hour period.
Business - 100 000 elements per 24 hour period.
I've used many of the Google maps API services on free accounts across a broad range of applications, some that match the scenario you have state above, others that do not. We have never had a problem at all and as long as people use the API fairly, they shouldn't either.
Other ways
There are other ways of doing what you require. You could calculate the distance between the two locations using the Haversine Foruma
http://en.wikipedia.org/wiki/Haversine_formula
and then send this distance down to your app upon request. This would remove the need for the Distance Matrix API in some circumstances (I'm unsure how indepth your App and Web Services actually are).
Why not instead use straight line distance between two points?
Try to find something similar to Android's Location.distanceBetween in the language you use for your server or just port the code from Android.

ways of getting my location on android

This may be a kinda odd question but I am new at Android development and I'm having trouble to learn how to retrieve the user's location to my application. I have looked for this topic but I just can't find a statisfying answer.
To get the user location I have found two ways:
http://developer.android.com/training/location/retrieve-current.html . This one is using what I think is the new Google Services release which uses a LocationClient to connect to Google Services and retrieve the location.
http://developer.android.com/guide/topics/location/strategies.html . The other one is using the android.location class and a LocationManager to retrieve the location.
The thing is that I don't get the difference between using one way or the other, which one is better??
And another question is that in the second way you can specify which location provider you want to use, if the GPS provider or the Network provider and in the first one you can't, but in the first paragraph it says that it uses the location sensors that are currently active for the device. Does this mean that I don't have to worry about choosing between both services??
I am using Android Studio and I have set up the new Google Services release, I just need to know the pros and cons between both ways to know which one to use and to begin learning.
Thanks!!
As stated in the second link:
The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework that automatically handles location providers, user movement, and location accuracy. It also handles location update scheduling based on power consumption parameters you provide. In most cases, you'll get better battery performance, as well as more appropriate accuracy, by using the Location Services API.
I would highly recommend you to watch the last I/O video to get a simple explanation from Reto Meier about the new Location Provider: http://youtu.be/GcNNx2zdXN4?t=14m29s (I suggest you to watch the entire clip btw, it's inspiring).

mapping corodinates

I've built application which receives coordinates from a patients device every time a text is sent from the carers requesting an update. I'm now looking into my options for mapping the coordinates received from the patients as well as the location of the carers device so they can both be seen relative to each other. Aside from having Google maps built in to my application is there any other recommended options.
thanks
OpenStreetMap is an alternative. You can start here.

Awaiting comments on my idea on android application

My idea of android application is :
This application would be activated by a calendar
entry, showing that the phone user has an appointment
somewhere (i.e. meeting friends in a town 2 hours away).
The application would track the phones position and register that
the user is on his way to the appointment (by checking if the
user is following the route of Google maps to the destination).
The phone would keep a status of whether the phone owner
will arrive on time or be late
I am quite good at webdesign, but on android platform I am just a rookie
any expert good at android please suggest me good place to start with,
my biggest doubt is
Can i use google maps API to compare mock locations i use in simulator to locations and landmarks in google maps from source point to destination point?
I await some thing useful for me to start my work...
Take a look at glympse.com - they do this almost all of this already. It's also against the T&C of google maps to do routing, so I would very carefully read them and determine if your idea defies the T&C.

Categories

Resources