1

I have an existing Android Cordova project which uses an embedded WebView. What this means is that the Activity does not extend CordovaActivity, but instead embeds the SystemWebView and initializes within the onCreate.

The following is currently how this is being done:

Within the layout XML file

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

  .... other layout elements not related to Cordova....

    <org.apache.cordova.engine.SystemWebView
        android:id="@+id/cdvWebView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />
</RelativeLayout>

Within the Activity's onCreate:

SystemWebView systemWebView = (SystemWebView) findViewById(R.id.cdvWebView);
CordovaWebView cdvWebView = new CordovaWebViewImpl(new SystemWebViewEngine(systemWebView));

ConfigXmlParser parser = new ConfigXmlParser();
parser.parse(this);

cdvWebView.init(this, parser.getPluginEntries(), parser.getPreferences());

Due to the bug in Lollipop versions 5.0.+ missing the "set" button, I want to implement the Crosswalk plugin into the project.

Unfortunately, all the documentation I'm finding assumes that a typical Cordova install is being used. I haven't been able to get the embedding and initialization of the XWalkWebView working correctly and keep getting a blank white screen.

Has anybody has success with a similar scenario?

SBerg413
  • 14,515
  • 6
  • 62
  • 88

1 Answers1

0

I'm not sure, but this might answer your question. It seems to show implementing an XWalkWebView outside of a typical cordova project:

https://github.com/kurli/crosswalk-website/wiki/How-to-use-Crosswalk-Embedded-API-on-Android

Sam
  • 845
  • 7
  • 20
  • Unfortunately, that example only demonstrates how to implement Crosswalk within a basic Android project and not within an Android project that uses Cordova. Cordova needs to be able to reference the WebView implementation to initiate it's hooks and whatever plugins are installed. – SBerg413 Sep 30 '15 at 20:34
  • I wish I could help. Perhaps restructuring your project in order to make it into a more conventional cordova project might be worth it. :( Not having any information, I don't know what that would mean for your app and how much it would involve. – Sam Oct 02 '15 at 04:15
  • I've solved this particular issue by forcing users to update lower versions of the Android System WebView. Disappointing that I did not hear from official Crosswalk sources here on SO. Although this post did not answer the question, I'm awarding you the bounty since it would otherwise be lost. Thanks for the effort, Samuel. Cheers. – SBerg413 Oct 02 '15 at 17:42