Example usage for org.apache.cordova ConfigXmlParser getPluginEntries

List of usage examples for org.apache.cordova ConfigXmlParser getPluginEntries

Introduction

In this page you can find the example usage for org.apache.cordova ConfigXmlParser getPluginEntries.

Prototype

public ArrayList<PluginEntry> getPluginEntries() 

Source Link

Usage

From source file:com.easycom.cordova.moodstocksScanner.CordovaFragment.java

License:Open Source License

protected void loadConfig() {
    ConfigXmlParser parser = new ConfigXmlParser();
    parser.parse(getActivity());//w w w  .ja v a2s.  c  om
    preferences = parser.getPreferences();
    preferences.setPreferencesBundle(getActivity().getIntent().getExtras());
    //        preferences.copyIntoIntentExtras(getActivity());
    launchUrl = parser.getLaunchUrl();
    pluginEntries = parser.getPluginEntries();
    //         Config.parser = parser;
}

From source file:com.example.administrator.myapplication.fragment.CordovaFragment2.java

License:Apache License

@SuppressWarnings("deprecation")
protected void loadConfig() {
    ConfigXmlParser parser = new ConfigXmlParser();
    parser.parse(this.getActivity());
    preferences = parser.getPreferences();
    preferences.setPreferencesBundle(getActivity().getIntent().getExtras());
    launchUrl = parser.getLaunchUrl();// w ww .  j  ava2 s  .c om
    pluginEntries = parser.getPluginEntries();
    //        Config.parser = parser;
}

From source file:com.mobicage.rogerthat.cordova.CordovaActionScreenActivity.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent intent = getIntent();// ww  w .j a  v  a2  s . c om
    mEmbeddedApp = intent.getStringExtra(EMBEDDED_APP);
    mEmbeddedAppId = intent.getStringExtra(EMBEDDED_APP_ID);

    mBrandingType = intent.getStringExtra(ActionScreenActivity.BRANDING_TYPE);
    mBrandingKey = intent.getStringExtra(ActionScreenActivity.BRANDING_KEY);
    mServiceEmail = intent.getStringExtra(ActionScreenActivity.SERVICE_EMAIL);
    mItemTagHash = intent.getStringExtra(ActionScreenActivity.ITEM_TAG_HASH);
    mItemLabel = intent.getStringExtra(ActionScreenActivity.ITEM_LABEL);
    mItemCoords = intent.getLongArrayExtra(ActionScreenActivity.ITEM_COORDS);
    mRunInBackground = intent.getBooleanExtra(ActionScreenActivity.RUN_IN_BACKGROUND, true);
    mContext = intent.getStringExtra(ActionScreenActivity.CONTEXT);

    if (mEmbeddedAppId != null) {
        mType = CordovaAppType.DYNAMIC_EMBEDDED_APP;
    } else if (mEmbeddedApp == null) {
        mType = CordovaAppType.BRANDING;
    } else {
        mType = CordovaAppType.PACKAGED_EMBEDDED_APP;
    }

    setContentViewWithoutNavigationBar(R.layout.cordova_action_screen);

    final int configId = getCordovaConfigId();
    final ConfigXmlParser parser = new ConfigXmlParser();
    parser.parse(this.getResources().getXml(configId));

    mBranding = (SystemWebView) findViewById(R.id.branding);
    SystemWebViewEngine parentEngine = new SystemWebViewEngine(mBranding);
    mBranding.setWebChromeClient(new CordovaWebChromeClient(parentEngine));
    mWebInterface = new CordovaWebViewImpl(parentEngine);
    mWebInterface.init(mCordovaInterface, parser.getPluginEntries(), parser.getPreferences());

    setTitle(mItemLabel);
    setActivityName("click|" + mItemTagHash);
}

From source file:io.syng.fragment.WebViewFragment.java

License:Mozilla Public License

@SuppressWarnings("deprecation")
protected void loadConfig() {
    ConfigXmlParser parser = new ConfigXmlParser();
    parser.parse(getActivity());// ww  w  . j  a  va  2 s.  com
    preferences = parser.getPreferences();
    preferences.setPreferencesBundle(getActivity().getIntent().getExtras());
    //preferences.set("webview", "io.syng.cordova.plugin.WebViewEngine");
    pluginEntries = parser.getPluginEntries();
    Config.init(getActivity());
}

From source file:org.apache.appharness.AppHarnessUI.java

License:Apache License

private void setPluginEntries(Set<String> pluginIdWhitelist, Uri configXmlUri) {
    CordovaActivity activity = (CordovaActivity) cordova.getActivity();
    // Extract the <feature> from CADT's config.xml, and filter out unwanted plugins.
    ConfigXmlParser parser = new ConfigXmlParser();
    parser.parse(activity);/*w  w  w.  ja  va 2 s .  c o  m*/
    ArrayList<PluginEntry> pluginEntries = new ArrayList<PluginEntry>(parser.getPluginEntries());
    for (int i = 0; i < pluginEntries.size();) {
        PluginEntry p = pluginEntries.get(i);
        if (!pluginIdWhitelist.contains(p.service)) {
            pluginEntries.remove(p);
            continue;
        } else if (WhitelistPlugin.class.getCanonicalName().equals(p.pluginClass)) {
            pluginEntries.set(i, new PluginEntry(p.service, createWhitelistPlugin(configXmlUri)));
        }
        ++i;
    }
    slaveWebView.getPluginManager().setPluginEntries(pluginEntries);
    // This is added by cordova-android in code, so we need to re-add it likewise.
    // Note that we re-route navigator.app.exitApp() in JS to close the webview rather than close the Activity.
    slaveWebView.getPluginManager().addService("CoreAndroid", "org.apache.cordova.CoreAndroid");
}