Android Open Source - M3UVideo Settings Util






From Project

Back to project page M3UVideo.

License

The source code is released under:

MIT License

If you think the Android project M3UVideo 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.dkc.m3uvideo;
//from  ww w. j  a  v a2s  .  c o  m
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

/**
 * Created by barbarian on 15.10.13.
 */
public class SettingsUtil {
    public static SharedPreferences getPreferences(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context);
    }

    public static String getStringOption(Context context,String key,String defValue){
        SharedPreferences settings = getPreferences(context);
        return settings.getString(key,defValue);
    }

    public static void setOption(Context context,String key, String value){
        if(context!=null){SharedPreferences settings = getPreferences(context.getApplicationContext());
            SharedPreferences.Editor editor = settings.edit();

            editor.putString(key,value);

            editor.commit();
        }
    }
}




Java Source Code List

com.dkc.m3uvideo.FileDialog.java
com.dkc.m3uvideo.HomeActivity.java
com.dkc.m3uvideo.M3UParser.java
com.dkc.m3uvideo.SettingsUtil.java
com.dkc.m3uvideo.StreamsAdapter.java
com.dkc.m3uvideo.VideoStream.java