Android Open Source - Give-Me-Ltc-Android-App Pref Manager From Project Back to project page Give-Me-Ltc-Android-App .
License The source code is released under:
Apache License
If you think the Android project Give-Me-Ltc-Android-App 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.hpritch5.give_me_ltc;
/ / f r o m w w w . j a v a 2 s . c o m
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
public class PrefManager {
private static SharedPreferences getSharedPreferences(Context context) {
return context.getSharedPreferences(context.getApplicationContext().getPackageName(), Context.MODE_PRIVATE);
}
/*
* Application's preferences
*/
public static String getApiKey(Context context) {
return getPreference(context, "API_KEY" , "" );
}
public static void setApiKey(Context context, String value) {
setPreference(context, "API_KEY" , value);
}
/*
* Android preference helpers
*/
private static void setPreference(Context context, String key, String value) {
Editor editor = getSharedPreferences(context).edit();
editor.putString(key, value);
editor.commit();
}
private static String getPreference(Context context, String key, String defaultValue) {
return getSharedPreferences(context).getString(key, defaultValue);
}
}
Java Source Code List com.google.cloud.backend.android.CloudBackendActivity.java com.google.cloud.backend.android.CloudBackendAsync.java com.google.cloud.backend.android.CloudBackendMessaging.java com.google.cloud.backend.android.CloudBackend.java com.google.cloud.backend.android.CloudCallbackHandler.java com.google.cloud.backend.android.CloudEndpointUtils.java com.google.cloud.backend.android.CloudEntity.java com.google.cloud.backend.android.CloudQuery.java com.google.cloud.backend.android.Consts.java com.google.cloud.backend.android.F.java com.google.cloud.backend.android.GCMIntentService.java com.google.cloud.backend.android.mobilebackend.MobilebackendRequestInitializer.java com.google.cloud.backend.android.mobilebackend.MobilebackendRequest.java com.google.cloud.backend.android.mobilebackend.Mobilebackend.java com.google.cloud.backend.android.mobilebackend.model.EntityDto.java com.google.cloud.backend.android.mobilebackend.model.EntityListDto.java com.google.cloud.backend.android.mobilebackend.model.FilterDto.java com.google.cloud.backend.android.mobilebackend.model.Filter.java com.google.cloud.backend.android.mobilebackend.model.QueryDto.java com.hpritch5.give_me_ltc.ChatActivity.java com.hpritch5.give_me_ltc.HomeActivity.java com.hpritch5.give_me_ltc.IntentIntegrator.java com.hpritch5.give_me_ltc.IntentResult.java com.hpritch5.give_me_ltc.MainActivity.java com.hpritch5.give_me_ltc.Miner.java com.hpritch5.give_me_ltc.MiningWorker.java com.hpritch5.give_me_ltc.PrefManager.java