本文整理匯總了Java中org.apache.cordova.CordovaPreferences類的典型用法代碼示例。如果您正苦於以下問題:Java CordovaPreferences類的具體用法?Java CordovaPreferences怎麽用?Java CordovaPreferences使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CordovaPreferences類屬於org.apache.cordova包,在下文中一共展示了CordovaPreferences類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: X5WebViewEngine
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public X5WebViewEngine(Context context, CordovaPreferences preferences) {
if(!isInit)
{
QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
@Override
public void onViewInitFinished(boolean arg0) {
}
@Override
public void onCoreInitFinished() {
isInit = true;
}
};
QbSdk.initX5Environment(context, cb);
}
this.preferences = preferences;
this.webView = new X5WebView(context);
cookieManager = new X5CookieManager(webView);
}
示例2: 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;
}
示例3: init
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
@Override
public void init(CordovaInterface cordova, List<PluginEntry> pluginEntries,
Whitelist whitelist, CordovaPreferences preferences) {
if (this.cordova != null) {
throw new IllegalStateException();
}
this.cordova = cordova;
this.whitelist = whitelist;
this.preferences = preferences;
pluginManager = new PluginManager(this, this.cordova, pluginEntries);
resourceApi = new CordovaResourceApi(webview.getContext(), pluginManager);
bridge = new CordovaBridge(pluginManager, new NativeToJsMessageQueue(this, cordova));
pluginManager.addService("App", "org.apache.cordova.CoreAndroid");
initWebViewSettings();
webview.init(this);
exposeJsInterface();
}
示例4: 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;
}
}
示例5: verify
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
private RuntimeException verify(CordovaPreferences prefs){
String err = "";
if(this.serverUrl == null){
err += NUANCE_SERVER_URL+" is missing! ";
}
if(this.port == -1){
err += NUANCE_SERVER_PORT+" is missing! ";
}
if(this.appId == null){
err += NUANCE_APP_ID+" is missing! ";
}
if(this.appKey == null){
String keyVal = prefs.getString(NUANCE_APP_KEY, null);
if(keyVal != null)
err += NUANCE_APP_KEY+" has wrong data: \""+keyVal+"\" ";
else
err += NUANCE_APP_KEY+" is missing! ";
}
if(err.length() > 0){
return new RuntimeException("Missing config.xml preferences value(s): "+err);
}
return null;
}
示例6: createInstance
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
public static boolean createInstance(Context ctx, CordovaPreferences prefs) {
boolean isRecreated = false;
if(instance == null){
instance = new NuanceEngine(ctx, prefs);
isRecreated = true;
}
else if(ctx != instance._context){
instance.releaseResources();
instance = new NuanceEngine(ctx, prefs);
isRecreated = true;
}
else if(!instance.isInitializedResources()){
instance.initializeResources();
isRecreated = true;
}
return isRecreated;
}
示例7: onCreate
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupSimplePreferencesScreen();
Preference button = (Preference)findPreference("clearCache");
button.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
ConfigXmlParser parser = new ConfigXmlParser();
parser.parse(SettingsActivity.this);
CordovaPreferences preferences = parser.getPreferences();
preferences.setPreferencesBundle(SettingsActivity.this.getIntent().getExtras());
CordovaWebView webView = new CordovaWebViewImpl(CordovaWebViewImpl.createEngine(SettingsActivity.this, preferences));
webView.clearCache();
return true;
}
});
}
示例8: checkBackgroundIntentCheck
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
@Test
public void checkBackgroundIntentCheck() {
StandardActivity activity = (StandardActivity) mActivityRule.getActivity();
final SystemWebView webView = (SystemWebView) activity.getWindow().getCurrentFocus();
CordovaWebView webInterface = webView.getCordovaWebView();
CordovaPreferences prefs = webInterface.getPreferences();
assertFalse(prefs.getInteger("backgroundcolor", Color.BLACK) == Color.GREEN);
}
示例9: XWalkWebViewEngine
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public XWalkWebViewEngine(Context context, CordovaPreferences preferences) {
this.preferences = preferences;
Runnable cancelCommand = new Runnable() {
@Override
public void run() {
cordova.getActivity().finish();
}
};
Runnable completeCommand = new Runnable() {
@Override
public void run() {
cookieManager = new XWalkCordovaCookieManager();
initWebViewSettings();
exposeJsInterface(webView, bridge);
loadUrl(startUrl, true);
// Send the massage of xwalk's ready to plugin.
if (pluginManager != null) {
pluginManager.postMessage("onXWalkReady", this);
}
}
};
activityDelegate = new XWalkActivityDelegate((Activity) context, cancelCommand, completeCommand);
webView = new XWalkCordovaView(context, preferences);
}
示例10: getLogLevel
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
private static int getLogLevel(CordovaPreferences preferences) {
String logLevel = preferences.getString("LogLevel", "ERROR");
if ("VERBOSE".equals(logLevel)) {
return android.util.Log.VERBOSE;
} else if ("DEBUG".equals(logLevel)) {
return android.util.Log.DEBUG;
} else if ("INFO".equals(logLevel)) {
return android.util.Log.INFO;
} else if ("WARN".equals(logLevel)) {
return android.util.Log.WARN;
} else {
return android.util.Log.ERROR;
}
}
示例11: InjectWebViewEngine
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public InjectWebViewEngine(Context context, CordovaPreferences preferences) {
this(new InjectWebView(context));
//super(context, preferences);
Log.w("inject", "InjectWebViewEngine");
}
示例12: CordovaGeckoViewEngine
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public CordovaGeckoViewEngine(Context context, CordovaPreferences preferences) {
mCtx = context;
webView = new CordovaGeckoView(this);
//testView = new SystemWebView(context);
prefs = preferences;
}
示例13: SystemWebViewEngine
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public SystemWebViewEngine(Context context, CordovaPreferences preferences) {
this(new SystemWebView(context), preferences);
}
示例14: X5WebViewEngine
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public X5WebViewEngine(Context context, CordovaPreferences preferences) {
this(new X5WebView(context), preferences);
}
示例15: X5WebViewEngine
import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/**
* Used when created via reflection.
*/
public X5WebViewEngine(Context context, CordovaPreferences preferences) {
this(new X5WebView(context), preferences);
}