Java tutorial
//package com.java2s; //License from project: Apache License import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; public class Main { private static void saveWeatherInfo(Context context, String tmp, String windDir, String windSc, String txt, String city, String publishTime, String cityCode) { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(context).edit(); editor.putBoolean("city_selected", true); editor.putString("city_name", city); editor.putString("city_code", cityCode); editor.putString("tmp", tmp); editor.putString("wind_dir", windDir); editor.putString("wind_sc", windSc); editor.putString("weather_desp", txt); editor.putString("publish_time", publishTime); editor.apply(); } }