本文整理匯總了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;
}
示例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;
}
}