本文整理汇总了Java中com.csipsimple.utils.PreferencesWrapper类的典型用法代码示例。如果您正苦于以下问题:Java PreferencesWrapper类的具体用法?Java PreferencesWrapper怎么用?Java PreferencesWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PreferencesWrapper类属于com.csipsimple.utils包,在下文中一共展示了PreferencesWrapper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
prefsWrapper = new PreferencesWrapper(this);
List<PrefGroup> prefs_list = new ArrayList<PrefGroup>();
prefs_list.add(new PrefGroup(R.string.prefs_fast, R.string.prefs_fast_desc,
R.drawable.ic_prefs_fast, new Intent(SipManager.ACTION_UI_PREFS_FAST)));
prefs_list.add(new PrefGroup(R.string.prefs_network, R.string.prefs_network_desc,
R.drawable.ic_prefs_network, getIntentForType(PrefsLogic.TYPE_NETWORK)));
prefs_list.add(new PrefGroup(R.string.prefs_media, R.string.prefs_media_desc,
R.drawable.ic_prefs_media, getIntentForType(PrefsLogic.TYPE_MEDIA)));
prefs_list.add(new PrefGroup(R.string.prefs_ui, R.string.prefs_ui_desc,
R.drawable.ic_prefs_ui, getIntentForType(PrefsLogic.TYPE_UI)));
prefs_list.add(new PrefGroup(R.string.prefs_calls, R.string.prefs_calls_desc,
R.drawable.ic_prefs_calls, getIntentForType(PrefsLogic.TYPE_CALLS)));
prefs_list.add(new PrefGroup(R.string.filters, R.string.filters_desc,
R.drawable.ic_prefs_filter, new Intent(this, PrefsFilters.class)));
adapter = new PrefGroupAdapter(this, prefs_list);
setListAdapter(adapter);
getListView().setOnCreateContextMenuListener(this);
}
示例2: onClick
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void onClick(View v) {
int id = v.getId();
if(id == R.id.glob_profile_always || id == R.id.row_glob_profile_always) {
setProfile(Profile.ALWAYS);
}else if(id == R.id.glob_profile_wifi || id == R.id.row_glob_profile_wifi) {
setProfile(Profile.WIFI);
}else if(id == R.id.glob_profile_never || id == R.id.row_glob_profile_never) {
setProfile(Profile.NEVER);
return;
}else if( id == R.id.row_glob_integrate ) {
globIntegrate.toggle();
}else if( id == R.id.row_glob_tg ) {
globGsm.toggle();
}else if (id == R.id.save_bt) {
if(!SipConfigManager.getPreferenceBooleanValue(this, PreferencesWrapper.HAS_ALREADY_SETUP, false) ) {
SipConfigManager.setPreferenceBooleanValue(this, PreferencesWrapper.HAS_ALREADY_SETUP, true);
}
applyPrefs();
finish();
}
}
示例3: onResume
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
protected void onResume() {
Log.d(THIS_FILE, "On Resume SIPHOME");
super.onResume();
onForeground = true;
prefProviderWrapper.setPreferenceBooleanValue(PreferencesWrapper.HAS_BEEN_QUIT, false);
// Set visible the currently selected account
sendFragmentVisibilityChange(mViewPager.getCurrentItem(), true);
Log.d(THIS_FILE, "WE CAN NOW start SIP service");
startSipService();
applyTheme();
}
示例4: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
super.setDefaultParams(prefs);
//Only G711u on WB
prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_WB,"245");
prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_WB, "0");
//On NB set for g729 high priority
prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_NB, "0");
prefs.setCodecPriority("G729/8000/1", SipConfigManager.CODEC_NB, "245");
}
示例5: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_STUN, true);
//Only G711a/u on WB & NB
prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_WB,"245");
prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_WB,"244");
prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_WB,"0");
prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_WB, "0");
prefs.setCodecPriority("PCMU/8000/1", SipConfigManager.CODEC_NB,"245");
prefs.setCodecPriority("PCMA/8000/1", SipConfigManager.CODEC_NB,"244");
prefs.setCodecPriority("G722/16000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("iLBC/8000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("speex/8000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("speex/16000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("speex/32000/1", SipConfigManager.CODEC_NB,"0");
prefs.setCodecPriority("GSM/8000/1", SipConfigManager.CODEC_NB, "0");
}
示例6: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
super.setDefaultParams(prefs);
// Disable ICE and turn on STUN!!!
prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_STUN, true);
String provider = providerListPref.getValue();
if (provider != null) {
String[] set = providers.get(provider);
if (!TextUtils.isEmpty(set[1])) {
prefs.addStunServer(set[1]);
}
}
prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_ICE, false);
}
示例7: isConnectivityValid
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
public boolean isConnectivityValid() {
if(prefsWrapper.getPreferenceBooleanValue(PreferencesWrapper.HAS_BEEN_QUIT, false)) {
return false;
}
boolean valid = prefsWrapper.isValidConnectionForIncoming();
if(activitiesForOutgoing.size() > 0) {
valid |= prefsWrapper.isValidConnectionForOutgoing();
}
return valid;
}
示例8: query
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String order) {
MatrixCursor resCursor = new MatrixCursor(new String[] { SipConfigManager.FIELD_NAME, SipConfigManager.FIELD_VALUE });
if (URI_MATCHER.match(uri) == PREF_ID) {
String name = uri.getLastPathSegment();
Class<?> aClass = null;
if (TextUtils.isEmpty(selection)) {
aClass = PreferencesWrapper.gPrefClass(name);
} else {
try {
aClass = Class.forName(selection);
} catch (ClassNotFoundException e) {
Log.e(THIS_FILE, "Impossible to retrieve class from selection");
}
}
Object value = null;
if (aClass == String.class) {
value = prefs.getPreferenceStringValue(name);
} else if (aClass == Float.class) {
value = prefs.getPreferenceFloatValue(name);
} else if (aClass == Boolean.class) {
Boolean v = prefs.getPreferenceBooleanValue(name);
if(v != null) {
value = v ? 1 : 0;
}else {
value = -1;
}
} else if(aClass == Integer.class) {
value = prefs.getPreferenceIntegerValue(name);
}
if (value != null) {
resCursor.addRow(new Object[] { name, value });
} else {
resCursor = null;
}
}
return resCursor;
}
示例9: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
super.setDefaultParams(prefs);
prefs.setCodecPriority("g729/8000/1", SipConfigManager.CODEC_NB, "240");
prefs.setCodecPriority("g729/8000/1", SipConfigManager.CODEC_WB, "240");
}
示例10: onCreate
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
prefsWrapper = new PreferencesWrapper(this);
// TODO -- enable display home as up
//getActionBar().setDisplayHomeAsUpEnabled(true);
}
示例11: onMainActivityOptionsItemSelected
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
public static boolean onMainActivityOptionsItemSelected(MenuItem item, Context ctxt, PreferencesWrapper prefsWrapper) {
int id = item.getItemId();
if (id == R.id.audio_test) {
ctxt.startActivity(new Intent(ctxt, AudioTester.class));
return true;
} else if (id == R.id.reset_settings) {
prefsWrapper.resetAllDefaultValues();
return true;
} else if (id == R.id.expert) {
prefsWrapper.toogleExpertMode();
return true;
}
return false;
}
示例12: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
super.setDefaultParams(prefs);
prefs.setCodecPriority("g729/8000/1", SipConfigManager.CODEC_NB, "240");
prefs.setCodecPriority("g729/8000/1", SipConfigManager.CODEC_WB, "240");
}
示例13: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
super.setDefaultParams(prefs);
// Add stun server
prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_ICE, false); /* Seems to produce problems with TCP ? -- specific? */
prefs.setPreferenceBooleanValue(SipConfigManager.USE_COMPACT_FORM, true);
}
示例14: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
super.setDefaultParams(prefs);
prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_STUN, true);
prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_DNS_SRV, true);
prefs.setPreferenceStringValue(SipConfigManager.STUN_SERVER, "stun.voipplanet.nl:3478");
}
示例15: setDefaultParams
import com.csipsimple.utils.PreferencesWrapper; //导入依赖的package包/类
@Override
public void setDefaultParams(PreferencesWrapper prefs) {
super.setDefaultParams(prefs);
// Add stun server
prefs.setPreferenceBooleanValue(SipConfigManager.ENABLE_STUN, true);
prefs.addStunServer("stun.aa.net.uk");
}