Android Open Source - SimpleWeather City Preference






From Project

Back to project page SimpleWeather.

License

The source code is released under:

Apache License

If you think the Android project SimpleWeather listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.eventbooking.simpleweather;
//from w ww. ja va  2s. c o  m
import android.app.Activity;
import android.content.SharedPreferences;

public class CityPreference {
    SharedPreferences preferences;

    public CityPreference(Activity activity) {
        preferences = activity.getPreferences(Activity.MODE_PRIVATE);
    }

    String getCity() {
        return preferences.getString("city", "Knoxville, TN");
    }

    void setCity(String city) {
        preferences.edit().putString("city", city).commit();
    }
}




Java Source Code List

com.eventbooking.simpleweather.ApplicationTest.java
com.eventbooking.simpleweather.CityPreference.java
com.eventbooking.simpleweather.RemoteFetch.java
com.eventbooking.simpleweather.WeatherActivity.java
com.eventbooking.simpleweather.WeatherFragment.java