Location setAltitude - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Location setAltitude method.

This code example shows how to use the following methods:setAltitude, setLatitude, setLongitude
 
        super(); 
         
        // setup dummy location 
        if (USE_DUMMY_LOCATION) {
            dummyLocation = new Location("");
//	    	dummyLocation.setLatitude(Location.convert("50:43:12.59")); // B-IT 
//	    	dummyLocation.setLongitude(Location.convert("7:7:16.2")); // B-IT 
//	    	dummyLocation.setAltitude(103); // B-IT 
            dummyLocation.setLatitude(Location.convert("50:44:58.43")); // FIT
            dummyLocation.setLongitude(Location.convert("7:12:14.54")); // FIT
            dummyLocation.setAltitude(125); // FIT
        } 
    } 
     
    /** 
     * Returns the activity constant for the pitch and roll values from the orientation service. Is used by the 
     * activities to determine when they have to switch to another activity. 
     *  
     * @param pitch Pitch value of the orientation service (values from -90 to 90). 
6
CodeRank
This code example shows how to use the following methods:setAltitude, setLatitude, setLongitude
		Location l1 = getLocation(lat1, lon1);
		Location l2 = getLocation(lat2, lon2);
		return l1.distanceTo(l2);
	} 
	public static Location getLocation(double lat, double lon) {
		Location l2 = new Location("gps");
		l2.setLatitude(lat);
		l2.setLongitude(lon);
		l2.setAltitude(0);
		return l2;
	} 
 
	public static synchronized void updateRequired(Context context, boolean req) {
		if (context==null) {
			Log.e(TAG,"updateRequired called with null context - ignored");
			return; 
		} 
		Log.d(TAG,"updateRequired("+req+")");
		if (locationCallback==null) {
			locationCallback = new LocationCallback(context);			
6
CodeRank
This code example shows how to use the following methods:setAccuracy, setAltitude, setLatitude, setLongitude, setTime
  SQLiteDatabase myDb;
  TrackMeDB db;
  MyPreference myPreference;
 
  public static Location mkLocation(Double lat, Double lng, long alt, long acc, long ts) {
    Location l = new Location("");
    l.setLatitude(lat);
    l.setLongitude(lng);
    l.setAltitude(alt);
    l.setAccuracy(acc);
    l.setTime(ts);
    return l;
  } 
 
  public static Location mkLocationWithoutAltitude(Double lat, Double lng, long acc, long ts) {
    Location l = new Location("");
    l.setLatitude(lat);
    l.setLongitude(lng);
    l.setAccuracy(acc);
    l.setTime(ts);
6
CodeRank
This code example shows how to use the following methods:setAltitude, setLatitude, setLongitude
            listener.onLocationChanged(l);
        } 
    } 
 
    private Location newLocation(double lat, double lon, double alt) {
        Location l = new Location(testProvider);
        l.setLatitude(lat);
        l.setLongitude(lon);
        l.setAltitude(alt);
 
        return l;
    } 
 
    private void initLocationData() { 
        locations = new ArrayList<Location>();
 
        locations.add(newLocation(33.751459, -84.3238770, 309));
        locations.add(newLocation(33.7514752, -84.3238663, 304));
        locations.add(newLocation(33.7514859, -84.3238610, 303));
        locations.add(newLocation(33.7514752, -84.32385, 303));
6
CodeRank
This code example shows how to use the following methods:setAltitude, setBearing, setLatitude, setLongitude, setTime
 
	private class PositionSender implements Runnable{
		int height;
 
		public Location getFakeLocation(double alt, double lat, double lon,float bearing){
			Location newLocation = new Location("NavigationTest");
			newLocation.setTime(System.currentTimeMillis());
			newLocation.setLatitude(lat);
			newLocation.setLongitude(lon);
			newLocation.setAltitude(alt);
			newLocation.setBearing(bearing);
			return newLocation; 
		} 
 
		public PositionSender(){ 
			height = 300;
		} 
 
		@Override 
		public void run() { 
6
CodeRank
This code example shows how to use the following methods:setAltitude, setLatitude, setLongitude
            listener.onLocationChanged(l);
        } 
    } 
 
    private Location newLocation(double lat, double lon, double alt) {
        Location l = new Location(testProvider);
        l.setLatitude(lat);
        l.setLongitude(lon);
        l.setAltitude(alt);
 
        return l;
    } 
 
    private void initLocationData() { 
        locations = new ArrayList<Location>();
 
        locations.add(newLocation(33.751459, -84.3238770, 309));
        locations.add(newLocation(33.7514752, -84.3238663, 304));
        locations.add(newLocation(33.7514859, -84.3238610, 303));
        locations.add(newLocation(33.7514752, -84.32385, 303));
6
CodeRank
This code example shows how to use the following methods:setAccuracy, setAltitude, setBearing, setExtras, setLatitude
This code example shows how to use the following methods:setAccuracy, setAltitude, setBearing, setLatitude, setLongitude
		return uri;
	} 
 
	public static Location decodeLocation(Uri uri) {
		String[] data = uri.getPath().split("/");
		Location l = new Location("Geoloqi");
		l.setLatitude(Float.parseFloat(data[1]));
		l.setLongitude(Float.parseFloat(data[2]));
		l.setAltitude(Float.parseFloat(data[3]));
		l.setBearing(Float.parseFloat(data[4]));
		l.setSpeed(Float.parseFloat(data[5]));
		l.setTime(Long.parseLong(data[6]));
		l.setAccuracy(Float.parseFloat(data[7]));
		return l;
	} 
 
	public static int getMinTime(Context context) {
		SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(context);
		String minTime = p.getString(GeoloqiPreferences.PREF_MINTIME_KEY, "5");
		return Integer.parseInt(minTime) * 1000;
7
CodeRank
This code example shows how to use the following methods:setAccuracy, setAltitude, setLatitude, setLongitude, setSpeed
		SQLiteDatabase db = this.getReadableDatabase();
		Cursor cursor = db.rawQuery(
				"SELECT LATITUDE, LONGITUDE, ALTITUDE, SPEED, ACCURACY, TIME FROM LOCATION" 
						+ " WHERE ID=" + Long.toString(id), new String[] {});
		if (cursor.moveToFirst()) {
			Location location = new Location(LocationManager.GPS_PROVIDER);
			location.setLatitude(cursor.getDouble(0));
			location.setLongitude(cursor.getDouble(1));
			location.setAltitude(cursor.getDouble(2));
			location.setSpeed(cursor.getFloat(3));
			location.setAccuracy(cursor.getFloat(4));
			location.setTime(cursor.getLong(5));
			return location;
		} 
		return null; 
	} 
 
	// Get list of points 
	public Cursor getPointList(String trackName, boolean wpt, boolean desc) {
		SQLiteDatabase db = this.getReadableDatabase();
6
CodeRank
This code example shows how to use the following methods:getLatitude, getLongitude, setAltitude, setLatitude, setLongitude
	 * �б����� �ݰ� 1km�̳��� Ʈ�������ؾ� ��. �׷��� ������ ��ǥ �ʿ�! 
	 *  
	 * @return	GeoLocation	���� ��ġ(����) 
	 */ 
	private GeoLocation getMyGeoLocation(){
		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() 
6
CodeRank
setAltitude Method Overview
Set the altitude, in meters above sea level.
See Code Examples for other Android Location Methods: