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


Java CordovaPreferences.getBoolean方法代碼示例

本文整理匯總了Java中org.apache.cordova.CordovaPreferences.getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java CordovaPreferences.getBoolean方法的具體用法?Java CordovaPreferences.getBoolean怎麽用?Java CordovaPreferences.getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.cordova.CordovaPreferences的用法示例。


在下文中一共展示了CordovaPreferences.getBoolean方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setGlobalPrefs

import org.apache.cordova.CordovaPreferences; //導入方法依賴的package包/類
private static Context setGlobalPrefs(Context context, CordovaPreferences preferences) {
    if (!hasSetStaticPref) {
        hasSetStaticPref = true;
        ApplicationInfo ai = null;
        try {
            ai = context.getPackageManager().getApplicationInfo(context.getApplicationContext().getPackageName(), PackageManager.GET_META_DATA);
        } catch (PackageManager.NameNotFoundException e) {
            throw new RuntimeException(e);
        }
        boolean prefAnimatable = preferences == null ? false : preferences.getBoolean("CrosswalkAnimatable", false);
        boolean manifestAnimatable = ai.metaData == null ? false : ai.metaData.getBoolean("CrosswalkAnimatable");
        // Selects between a TextureView (obeys framework transforms applied to view) or a SurfaceView (better performance).
        XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, prefAnimatable || manifestAnimatable);
        if ((ai.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
            XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
        }
        XWalkPreferences.setValue(XWalkPreferences.JAVASCRIPT_CAN_OPEN_WINDOW, true);
        XWalkPreferences.setValue(XWalkPreferences.ALLOW_UNIVERSAL_ACCESS_FROM_FILE, true);
    }
    return context;
}
 
開發者ID:infil00p,項目名稱:cordova-plugin-crosswalk-webview,代碼行數:22,代碼來源:XWalkCordovaView.java

示例2: Credentials

import org.apache.cordova.CordovaPreferences; //導入方法依賴的package包/類
/**
 * 
 * @param prefs
 * 			the preference values form config.xml with the configuration/credentials
 * 			for the Nuance SpeechKit service
 * 
 * @throws RuntimeError if prefs is missing require Nuance configuration/credential values
 */
protected Credentials(CordovaPreferences prefs) throws RuntimeException {
	
	this.serverUrl 		= prefs.getString(NUANCE_SERVER_URL, null);
	this.port 			= prefs.getInteger(NUANCE_SERVER_PORT, -1);
	this.useSsl	 		= prefs.getBoolean(NUANCE_SERVER_SSL, true);
	this.certSummary 	= prefs.getString(NUANCE_CERT_SUMMARY, null);
	this.certData		= prefs.getString(NUANCE_CERT_DATA, null);
	this.appId 			= prefs.getString(NUANCE_APP_ID, null);
	this.appKey 		= parseToByteArray(prefs.getString(NUANCE_APP_KEY, null));
	
	RuntimeException ex = verify(prefs);
	if(ex != null){
		throw ex;
	}
}
 
開發者ID:mmig,項目名稱:mmir-plugin-speech-nuance,代碼行數:24,代碼來源:Credentials.java


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