當前位置: 首頁>>代碼示例>>Java>>正文


Java PreferencesWrapper類代碼示例

本文整理匯總了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);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:26,代碼來源:MainPrefs.java

示例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();
	}
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:25,代碼來源:PrefsFast.java

示例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();
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:17,代碼來源:SipHome.java

示例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");
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:27,代碼來源:FreephoneLineCa.java

示例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");
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:25,代碼來源:Sonetel.java

示例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);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:19,代碼來源:Betamax.java

示例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;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:11,代碼來源:SipService.java

示例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;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:40,代碼來源:PreferenceProvider.java

示例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");
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:Ingetel.java

示例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);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:MainPrefs.java

示例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;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:16,代碼來源:PrefsLogic.java

示例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");
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:GatherCall.java

示例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);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:Ippi.java

示例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");
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:VoipPlanet.java

示例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");
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:9,代碼來源:Aaisp.java


注:本文中的com.csipsimple.utils.PreferencesWrapper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。