Code example for Location

Methods: setAccuracysetLatitudesetLongitude

0
     
    public Location getHomeLocation() {
    	if(!settings.getBoolean("haveHomeLocation", false))
    		return null; 
    	 
    	Location loc = new Location("Home");
    	loc.setLatitude(settings.getFloat("HomeLocLat", (float)40.443181));  // Easter Egg: default value
    	loc.setLongitude(settings.getFloat("HomeLocLong", (float)-79.943060));
    	loc.setAccuracy(settings.getFloat("HomeLocAccuracy", 100000));
    	return loc;
    } 
     
    // Higher level settings 
    public int getClientID() { return settings.getInt("randClientID",-1); }
    public void setClientID(int id) { sEditor.putInt("randClientID", id); sEditor.commit(); }
    public String getHomeSSID() { return settings.getString("homeSSID", null); }
    public void setHomeSSID(String ssid) { sEditor.putString("homeSSID", ssid); sEditor.commit(); }
     
    // For some 802.11 wireless settings 
    public int getHomeWifiFreq() { return settings.getInt("homeWifiFreq", -1); }
    public void setHomeWifiFreq(int freq) { sEditor.putInt("homeWifiFreq", freq); sEditor.commit(); }