--- /dev/null
+package org.average.whereami;
+
+import com.google.api.client.extensions.android2.AndroidHttp;
+import com.google.api.client.googleapis.GoogleHeaders;
+import com.google.api.client.http.HttpRequest;
+import com.google.api.client.http.HttpResponse;
+import com.google.api.client.http.HttpResponseException;
+import com.google.api.client.http.HttpTransport;
+import com.google.api.client.util.DateTime;
+
+import android.util.Log;
+
+public final class Location extends Oracle {
+ @Override
+ public final String getResult() {
+ return "Response from Location.getResult";
+ }
+
+ //public PhoneLog() {}
+}
package org.average.whereami;
import org.average.whereami.WhereAmIprefs;
+import org.average.whereami.Oracle;
import org.average.whereami.PhoneLog;
+import org.average.whereami.Location;
import android.app.Activity;
import android.net.wifi.WifiManager;
private class UpdateTarget {
private TextView tv;
- private Integer updater; // will be the function/object
+ private Oracle updater;
private BgUpdate task;
private class BgUpdate extends AsyncTask<Void, Void, String> {
protected String doInBackground(Void... params) {
Log.w("WhereAmI", "BgUpdate " + updater + " starting");
SystemClock.sleep(5000); // real job do be done here
- String result = PhoneLog.getResult();
+ String result = updater.getResult();
Log.w("WhereAmI", "BgUpdate about to return");
return result;
}
}
}
- public UpdateTarget(TextView tv, Integer updater) {
+ public UpdateTarget(TextView tv, Oracle updater) {
this.tv = tv;
this.updater = updater;
}
tvd = (TextView)findViewById(R.id.date);
tvs = (TextView)findViewById(R.id.timestamp);
ut = new UpdateTarget[] {
- new UpdateTarget((TextView)findViewById(R.id.location), 1),
- new UpdateTarget((TextView)findViewById(R.id.phonecall), 2)
+ new UpdateTarget((TextView)findViewById(R.id.location),
+ new PhoneLog()),
+ new UpdateTarget((TextView)findViewById(R.id.phonecall),
+ new Location())
};
Log.w("WhereAmI", "created UI, about to start update task");
mHandler.post(updateClock);