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


Java CordovaPreferences類代碼示例

本文整理匯總了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);
}
 
開發者ID:Im-Kevin,項目名稱:cordova.plugins.X5WebView,代碼行數:23,代碼來源:X5WebViewEngine.java

示例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;
}
 
開發者ID:infil00p,項目名稱:cordova-plugin-crosswalk-webview,代碼行數:22,代碼來源:XWalkCordovaView.java

示例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();
}
 
開發者ID:ZachMoreno,項目名稱:krakn,代碼行數:20,代碼來源:XWalkCordovaWebView.java

示例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;
	}
}
 
開發者ID:mmig,項目名稱:mmir-plugin-speech-nuance,代碼行數:24,代碼來源:Credentials.java

示例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;
}
 
開發者ID:mmig,項目名稱:mmir-plugin-speech-nuance,代碼行數:26,代碼來源:Credentials.java

示例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;
}
 
開發者ID:mmig,項目名稱:mmir-plugin-speech-nuance,代碼行數:21,代碼來源:NuanceEngine.java

示例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;
        }
    });
}
 
開發者ID:status-im,項目名稱:syng-client,代碼行數:21,代碼來源:SettingsActivity.java

示例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);
}
 
開發者ID:alex-shpak,項目名稱:keemob,代碼行數:9,代碼來源:StandardActivityTest.java

示例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);
}
 
開發者ID:infil00p,項目名稱:cordova-photosphere-example,代碼行數:29,代碼來源:XWalkWebViewEngine.java

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

示例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");

}
 
開發者ID:fastrde,項目名稱:cordova-plugin-fastrde-injectview,代碼行數:8,代碼來源:InjectWebViewEngine.java

示例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;
}
 
開發者ID:infil00p,項目名稱:cordova-mozillaview-engine,代碼行數:8,代碼來源:CordovaGeckoViewEngine.java

示例13: SystemWebViewEngine

import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public SystemWebViewEngine(Context context, CordovaPreferences preferences) {
    this(new SystemWebView(context), preferences);
}
 
開發者ID:Andy-Ta,項目名稱:COB,代碼行數:5,代碼來源:SystemWebViewEngine.java

示例14: X5WebViewEngine

import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/** Used when created via reflection. */
public X5WebViewEngine(Context context, CordovaPreferences preferences) {
    this(new X5WebView(context), preferences);
}
 
開發者ID:runner525,項目名稱:x5webview-cordova-plugin,代碼行數:5,代碼來源:X5WebViewEngine.java

示例15: X5WebViewEngine

import org.apache.cordova.CordovaPreferences; //導入依賴的package包/類
/**
 * Used when created via reflection.
 */
public X5WebViewEngine(Context context, CordovaPreferences preferences) {
  this(new X5WebView(context), preferences);
}
 
開發者ID:zsxsoft,項目名稱:cordova-plugin-x5-tbs,代碼行數:7,代碼來源:X5WebViewEngine.java


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