Skip to content

Instantly share code, notes, and snippets.

@px-amaac
Created May 16, 2013 09:44
Show Gist options
  • Save px-amaac/5590618 to your computer and use it in GitHub Desktop.
Save px-amaac/5590618 to your computer and use it in GitHub Desktop.
protected LatLng doInBackground(String... strings) {
assert( strings.length == 2 );
String loc = strings[0];
String vid = strings[1];
mVenueId = Integer.parseInt(vid);
int count = -1;
try {
Date start = new Date();
List<Address> la = mGC.getFromLocationName(loc, 1);
Date end = new Date();
float ms = (end.getTime()-start.getTime());
synchronized (LoadGeoCode.class) {
count = sGeoCount;
sGeoCount++;
}
Log.d( Global.LOG_TAG, "geocode " + count + ": " + ms + " ms" );
if ( la.size() > 0 ) {
Address a = la.get(0);
LatLng ll = new LatLng(a.getLatitude(), a.getLongitude());
mCGC.AddEntry( loc, ll );
return ll;
}
} catch (IOException e) {
Log.e( Global.LOG_TAG, "geocode #" + count + " io exception" );
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment