Android GeoLocation - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android GeoLocation class.

This code example shows how to use the following methods:
	public boolean isValid() { 
		return latitude >= 0 || longitude >= 0;
	} 
 
	public GeoLocation toGeoLocation() {
		return isValid() ? new GeoLocation(latitude, longitude) : null;
	} 
 
	@Override 
	public String toString() {
		return "ParcelableLocation{latitude=" + latitude + ", longitude=" + longitude + "}";
	} 
 
	@Override 
	public void writeToParcel(final Parcel out, final int flags) {
		out.writeDouble(latitude);
		out.writeDouble(longitude);
	} 
 
	public static ParcelableLocation fromString(final String string) {
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
		Location hardFix = new Location("reverseGeocoded");
		hardFix.setLatitude(37.60192850146395);
		hardFix.setLongitude(126.95474624633789);
		hardFix.setAltitude(20);
		 
		return new GeoLocation(hardFix.getLatitude(),
						hardFix.getLongitude());
	} 
	 
	/** 
	 * �ݰ� ���� 
	 *  
	 * @return	radius	 
	 */ 
	private double getRadius() 
	{ 
		return radius * 0.001;	// Ʈ���� API �� �°� �ݰ� ����.
	} 
	 
	/** 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
mCurrentLocation = mLocationClient.getLastLocation();
		((MyApp) MyApp.getApp()).setMyLocation(mCurrentLocation);
 
		Query query = new Query();
		GeoLocation myLoc = new GeoLocation(mCurrentLocation.getLatitude(),
				mCurrentLocation.getLongitude());
		query.count(75);
		query.setGeoCode(myLoc, 1, "km");
 
		GetTweetsSearchAsync getTweets = new GetTweetsSearchAsync(twitter, this);
		getTweets.execute(query);
	} 
 
	/* 
	 * Called by Location Services when the request to connect the client 
	 * finishes successfully. At this point, you can request the current 
	 * location or start periodic updates 
	 */ 
	@Override 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
import com.google.android.gms.maps.model.Marker; 
import com.google.android.gms.maps.model.MarkerOptions; 
 
public class MapActivity extends Activity {
	private static final LatLng PHILADELPHIA = new LatLng(39.9522, -75.1642);
	private static GeoLocation atlanta = new GeoLocation(33.65, -84.42);
	private GoogleMap map;
 
	@Override 
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Bundle bundle = getIntent().getExtras();
		double mLat = bundle.getDouble("mLat");
		double mLong = bundle.getDouble("mLong");
		setContentView(R.layout.map_layout);
		map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
				.getMap();
 
		LatLng myLocation = new LatLng(mLat, mLong);
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
		@Override 
		public void run() { 
			GeoLocation location = null;
			if(mLatitude != -1 && mLongitude != -1) {
				location = new GeoLocation(mLatitude, mLatitude);
			} 
			 
			try { 
				mApplication.updateStatus(mAccountId, mTweetText, location);
				 
				showTickerText("Tweet Sent!", "Your tweet has been posted"); 
			} catch (TwitterException e) {
				Log.e(TAG, "Error updating status", e);
				 
				/* 
				 * We should retry if the user requests.. 
				 */ 
				Notification notification = 
					getCustomNotification("Error updating status",  
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android GeoLocation Methods: