Android Open Source - radioExpresWidget Location Service






From Project

Back to project page radioExpresWidget.

License

The source code is released under:

GNU General Public License

If you think the Android project radioExpresWidget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hustaty.radioexpres.widget.service;
//w w w  .  java2s. c om
import android.content.Context;
import android.location.Location;
import android.location.LocationManager;
import android.util.Log;

import com.hustaty.radioexpres.widget.util.LogUtil;

public class LocationService {

  // logger entry
  private final static String LOG_TAG = LocationService.class.getName();

  private static Location myLocation;

  public static Location obtainCurrentLocation(final Context context) {

    LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);

    LocationService.myLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

    if (LocationService.myLocation == null) {
    }

    Log.d(LOG_TAG, "#obtainCurrentLocation(): " + myLocation);
    LogUtil.appendLog(LOG_TAG + "#obtainCurrentLocation(): " + myLocation);

    return myLocation;

  }

}




Java Source Code List

com.hustaty.radioexpres.widget.MyActivity.java
com.hustaty.radioexpres.widget.exception.RadioExpresException.java
com.hustaty.radioexpres.widget.http.MyHttpClient.java
com.hustaty.radioexpres.widget.model.Document.java
com.hustaty.radioexpres.widget.model.IconStyle.java
com.hustaty.radioexpres.widget.model.Icon.java
com.hustaty.radioexpres.widget.model.Kml.java
com.hustaty.radioexpres.widget.model.Placemark.java
com.hustaty.radioexpres.widget.model.Point.java
com.hustaty.radioexpres.widget.model.Style.java
com.hustaty.radioexpres.widget.receiver.AlarmManagerBroadcastReceiver.java
com.hustaty.radioexpres.widget.service.LocationService.java
com.hustaty.radioexpres.widget.util.Constants.java
com.hustaty.radioexpres.widget.util.LogUtil.java
com.hustaty.radioexpres.widget.util.Serializer.java