I want to implement a function that calculates locations' list (longitudes and latitudes) through a direction of my phone. The result can be a rectengular shape which is pointing the corners as locations.
First how can i find the device current direction which means which direction the back camera points ?
Then how can i obtain a list of location information through this direction ?
Thank you
From the documentation of Google Maps Android API, the location data available to an Android device includes the current location of the device pinpointed using a combination of technologies - the direction and method of movement, and whether the device has moved across a predefined geographical boundary, or geofence.
This is the 3 options that you can do with your app.
Using My Location layer that provides a simple way to display the device's location on the map. It does not provide data.
Using Google Play services Location API is
recommended for all programmatic requests for location data.
And using the LocationSource
interface allows you to provide a custom location provider.
By using this, you can also get the different information about the
coordinates that you get
For more information, check this tutorial:
Google Map Tutorial in Android Studio: How to get current location in Android Google Map
Google Map Tutorial in Android Studio
Related
I am trying to add compass calibrate option in my app same like in maps app or Whatsapp.
https://www.howtogeek.com/519142/how-to-calibrate-the-compass-on-android-to-improve-device-location-accuracy/
I am trying to find if it comes with the sdk or do I need to implement it manually.
Compass calibration isn't implemented in software. Just wave the device in a figure-8 pattern as shown in your link. The Google Maps app just contains instructions for how to do it, and provides a convenient way to see if it worked.
I'm happily developing GPS aware apps using LocationManager and NmeaListener, so I am not asking about how to use the Android SDK, but how the Android SDK talks to the internal GPS SDK
I'm trying to understand how Android interacts with the GPS SDK to deliver, for example, the speed and direction values in the GPRMC sentence. Do they come directly from the chip SDK or are they calculatedd by Android?
I'm looking at Android source in LocationManager.java, but I can't find where it interacts with the GPS SDK.
Can anyone point me in the right direction please?
I expect the GPS is a separate sub system which reports data to the system over a serial NMEA connection. If so then the GPS module will calculate Speed (SOG) and Course (COG) using internal methods. For low cost GPS modules they typically have a filtered position difference method. Higher end GPS receivers use carrier phase measurements to get instant results.
I'm guessing that you are noticing a lag in the COG and SOG values and hoping that knowing more about how they are derived will help you correct the lag...
I want to use Google Maps on my java based application.
My application would overlay images on maps based on latitude and longitude and change position of these images with time. The time interval will be very short so it needs to be efficient.
Currently I can find following solution, but none of these works :
1) Using Qt WebKit through Qt Jambi : This will just open Google Maps in browser over my application, I would not have control of overlaying images on top of the Map, according to the lat/long.
2) Using Google Maps Image API : This would open image, but I would not be able to translate the location in lat/long into coordinates in image, also as the position of images are changing I will need zoom-in and zoom out feature, which will be unavailable here.
Is there an exiting solution which fits my need?
Thanks!
I have a tracking application and uses osmdroid library. My prolbem is that osmrdroid does not support routing. By the way the application is purely offline. Are there any suggestions that you can provide with regards to a library that supports routing, which can coordinate with the osmdroid map overlay. What I need to do is only calculate shortest path and draw it on the offline map from one point to the next.
I found this link:
http://code.google.com/p/j2memaprouteprovider/source/browse/trunk/J2MEMapRouteAndroidEx/src/org/ci/geo/route/android/MapRouteActivity.java
but I don't know how to integrate it on osmdroid application.
I think in all osmdroid apps the map data come from a code line like this:
map.setTileSource(TileSourceFactory.MAPQUESTOSM);
This means the maps are downloaded as raster tiles, or if you have an offline application the maps are cached as tiles. So you do not have a graph of streets that could be used to calculate a route. So routing isn't supported in osmdroid for a reason.
To do offline route calculation you will need the street network data on your phone. Then you can use a simple wayfinding algorithm to calculate the shortest path. (like Dijkstra)
Basically I am developing an app which can show both the users' current location and their interested locations on the map, I know there are MyLocationOverlay and ItemizedOverlay, but seems they can only show either current location or interested location.
Thank you so much
I used this tutorial and learned a lot http://mobile.tutsplus.com/tutorials/android/android-sdk-build-a-mall-finder-app-mapview-location/