J2ME/Android/BlackBerry – driving directions, route between two locations

J2ME Map Route Provider maps.google.com has a navigation service which can provide you route information in KML format. To get kml file we need to form url with start and destination locations: public static String getUrl(double fromLat, double fromLon, double toLat, double toLon) {// connect to map web service StringBuffer urlString = new StringBuffer(); urlString.append(“http://maps.google.com/maps?f=d&hl=en”); … Read more

How to get a time zone from a location using latitude and longitude coordinates?

Time Zone Location Web Services Google Maps Time Zone API Bing Maps Time Zone API Azure Maps Time Zone API GeoNames Time Zone API TimeZoneDB API AskGeo – commercial (but arguably more accurate than GeoNames) GeoGarage Time Zone API – commercial, focusing on Nautical time zones. Raw Time Zone Boundary Data Timezone Boundary Builder – … Read more

How do I get the current GPS location programmatically in Android?

I have created a small application with step by step description to get current location’s GPS coordinates. Complete example source code is in Get Current Location coordinates , City name – in Android. See how it works: All we need to do is add this permission in the manifest file: <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” /> And create … Read more

Fused Location always returns null

Add this code to your onConnected, thats where it would get Last Known Location. private static Location mLastLocation; private static GoogleApiClient mGoogleApiClient; private static Context context; // added private LocationRequest mLocationRequest; private Double latitude; private Double longitude; private String TAG = “”; // set your TAG @Override public void onConnected(Bundle bundle) { if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) … Read more