Back to project page ccardstats.
The source code is released under:
GNU General Public License
If you think the Android project ccardstats listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.marwinxxii.ccardstats; /*from w ww . j a v a 2s . co m*/ import java.util.HashMap; import android.content.SharedPreferences; import android.preference.PreferenceManager; import com.github.marwinxxii.ccardstats.db.DBHelper; import com.github.marwinxxii.ccardstats.helpers.DateHelper; import com.github.marwinxxii.ccardstats.helpers.MoneyHelper; import com.github.marwinxxii.ccardstats.R; public class Application extends android.app.Application { @Override public void onCreate() { DateHelper.setMonthNames(getResources().getStringArray(R.array.month_names)); SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this); HashMap<String, Double> rates = new HashMap<String, Double>(2); rates.put("usd", Double.parseDouble(prefs.getString("exchange_rates_usd", "30.0"))); rates.put("eur", Double.parseDouble(prefs.getString("exchange_rates_eur", "39.0"))); rates.put("ron", Double.parseDouble(prefs.getString("exchange_rates_ron", "9"))); rates.put("huf", Double.parseDouble(prefs.getString("exchange_rates_huf", "0.14"))); MoneyHelper.setExchangeRates(rates); DBHelper.storeMonth = prefs.getBoolean("store_month", DBHelper.storeMonth); } }