27,7 → 27,7 |
private static final String COLUMN_CURRENCY2 = "currency2"; //$NON-NLS-1$ |
private static final String COLUMN_FACTOR = "factor"; //$NON-NLS-1$ |
|
private static HashMap<String, HashMap<String, Double>> conversionRates = |
private static HashMap<String, HashMap<String, Double>> currencyConversions = |
new HashMap<String, HashMap<String, Double>>(); |
static |
{ |
34,19 → 34,19 |
HashMap<String, Double> conversionFactors = new HashMap<String, Double>(); |
conversionFactors.put(CurrenciesActivity.VALUE_EUR, 0.767842293); |
conversionFactors.put(CurrenciesActivity.VALUE_USD, 1.03413); |
CurrenciesDatabase.conversionRates.put(CurrenciesActivity.VALUE_CHF, |
CurrenciesDatabase.currencyConversions.put(CurrenciesActivity.VALUE_CHF, |
conversionFactors); |
|
conversionFactors = new HashMap<String, Double>(); |
conversionFactors.put(CurrenciesActivity.VALUE_CHF, 1.30235077); |
conversionFactors.put(CurrenciesActivity.VALUE_USD, 1.3468); |
CurrenciesDatabase.conversionRates.put(CurrenciesActivity.VALUE_EUR, |
CurrenciesDatabase.currencyConversions.put(CurrenciesActivity.VALUE_EUR, |
conversionFactors); |
|
conversionFactors = new HashMap<String, Double>(); |
conversionFactors.put(CurrenciesActivity.VALUE_CHF, 0.966996412); |
conversionFactors.put(CurrenciesActivity.VALUE_EUR, 0.742500743); |
CurrenciesDatabase.conversionRates.put(CurrenciesActivity.VALUE_USD, |
CurrenciesDatabase.currencyConversions.put(CurrenciesActivity.VALUE_USD, |
conversionFactors); |
} |
private final CurrenciesActivity context; |
111,7 → 111,7 |
@Override |
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) |
{ |
/* NOTE: We should migrate an existing database instead */ |
/* NOTE: Should migrate database instead */ |
db.execSQL("DROP TABLE IF EXISTS " + CurrenciesDatabase.TABLE); |
this.onCreate(db); |
} |
121,7 → 121,7 |
*/ |
public HashMap<String, HashMap<String, Double>> getConversionRates() |
{ |
return CurrenciesDatabase.conversionRates; |
return CurrenciesDatabase.currencyConversions; |
} |
|
/** |
209,7 → 209,7 |
*/ |
newCurrencyConversions.put(currency1Str, mapForCurrency); |
|
CurrenciesDatabase.conversionRates = newCurrencyConversions; |
CurrenciesDatabase.currencyConversions = newCurrencyConversions; |
} |
} |
catch (IllegalArgumentException e) |