How to Get the Longitude

public double getLongitude () was added in API level 1
Get the longitude, in degrees.
All locations generated by the LocationManager will have a valid longitude.

1. In the MainActivity.java file, Get the Last Known Location

2. Declare a Double variable named dblLongitude

3. In the onCreate method, add the below line. This test and make sure the myLocation object is not null, and if not null, will get the longitude, in degrees and save it to a double variable named dblLongitude. Note: This will be the Last Known Longitude. It may not be the current longitude.

if (myLocation !=null) {
    dblLongtidue = myLocation.getLongtitude();
}