当前位置: 首页>>代码示例>>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;未经允许,请勿转载。