I now the data is showing up because I see it when I run adb logcat from the tools directory. I'm just not sure how to collect it up and ship it out. I was guessing I would do collect the info in the method, onLocationChanged and the send it to another method to be emailed out or stored in a file or db or some earwax.
Thanks for any ideas or pointers.
Here is my code:
- Code: Select all
package edu.xxx.xxx.xxxx;
import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class xxxxxxxx extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
//<=================================================
// Calling parent and pass in savedInstanceState
//<=================================================
super.onCreate(savedInstanceState);
//<=================================================
// Calling parent setContentView
//<=================================================
setContentView(tv);
setupListener();
private void setupListener()
{
//<=========================================================================
// get locationMananger object from the system service map
//<=========================================================================
LocationManager locm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
//Location loc = locm.getLastKnownLocation("gps");
Log.d("LSKFLKEasdfawefawefew", "EHHLOOO");
//<==========================================================================
// Instantiate and override methods in the LocationListener
// Could be done with subclassing
//<==========================================================================
LocationListener onLocationChange=new LocationListener() {
public void onLocationChanged(Location location) {
//updateForecast(location);
//Log.d("TSETTESTE" , "Updataed position " + location.toString());
System.out.println(">>>>>>>>>>>>>>>>--- Collecting GPS Data ---<<<<<<<<<<<<<<<<");
//System.out.println(location.toString());
} public void onProviderDisabled(String provider) {
// required for interface, not used
}
public void onProviderEnabled(String provider) {
// required for interface, not used
}
public void onStatusChanged(String provider, int status, Bundle extras) {
// required for interface, not used
}};
//<==================================================================
// register the listener with the Location Manager to receive
// updates when the nav data changes
//<==================================================================
locm.requestLocationUpdates("gps", 5, 1, onLocationChange);
}
}



