Android Open Source - googletv_ncid Config






From Project

Back to project page googletv_ncid.

License

The source code is released under:

Apache License

If you think the Android project googletv_ncid 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 net.cwfk.ig88.ncid;
/*from  w  w  w  .j  a v a  2 s.  c om*/
import android.content.Context;
import android.content.SharedPreferences;

public class Config {

    private static final String PrefsName = "prefs_ncid";
    private static final String Address = "pref_address";
    private static final String Port = "pref_port";

    private final Context context;

    public Config( Context context ) {
        this.context = context;
    }

    public String getAddress() {
        return prefs().getString( Address, "ncid.local" );
    }

    public void setAddress( String address ) {
        prefs().edit().putString( Address, address ).commit();
    }

    public Integer getPort() {
        return prefs().getInt( Port, 3333 );
    }

    public void setPort( Integer port ) {
        prefs().edit().putInt( Port, port ).commit();
    }

    private SharedPreferences prefs() {
        return context.getSharedPreferences(PrefsName, Context.MODE_PRIVATE);
    }
}




Java Source Code List

net.cwfk.ig88.ncid.CIDHandler.java
net.cwfk.ig88.ncid.Config.java
net.cwfk.ig88.ncid.DisplayActivity.java
net.cwfk.ig88.ncid.MainActivity.java
net.cwfk.ig88.ncid.NCIDClient.java
net.cwfk.ig88.ncid.NCIDService.java
net.cwfk.ig88.ncid.ServiceStarter.java
net.cwfk.ig88.ncid.StatusHandler.java