From 2db7369014649cc0cf30635db5af9c470d24b910 Mon Sep 17 00:00:00 2001 From: Lin Sun Date: Tue, 31 Mar 2015 09:45:14 +0800 Subject: [PATCH] Support shared mode for crosswalk library Shared mode allows multiple xwalk apps to share one xwalk runtime library. Each xwalk app is bundled with a reflection layer instead of the whole runtime library, whereas there is a library apk to be installed on device for xwalk apps to use. --- .gitignore | 1 + bin/templates/project/Activity.java | 4 ++++ bin/templates/project/AndroidManifest.xml | 4 +++- .../org/apache/cordova/CordovaActivity.java | 7 +++++- .../apache/cordova/CordovaApplication.java | 24 +++++++++++++++++++ .../apache/cordova/CordovaWebViewClient.java | 1 - .../src/org/apache/cordova/DroidGap.java | 3 +++ 7 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 framework/src/org/apache/cordova/CordovaApplication.java diff --git a/.gitignore b/.gitignore index f7416c82..12ab855f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ framework/libs framework/javadoc-public framework/javadoc-private framework/xwalk_core_library +framework/xwalk_shared_library test/libs example ./test diff --git a/bin/templates/project/Activity.java b/bin/templates/project/Activity.java index 55395197..b30ce61c 100644 --- a/bin/templates/project/Activity.java +++ b/bin/templates/project/Activity.java @@ -28,6 +28,10 @@ public class __ACTIVITY__ extends CordovaActivity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + } + + @Override + protected void onXWalkReady() { super.init(); // Set by in config.xml loadUrl(launchUrl); diff --git a/bin/templates/project/AndroidManifest.xml b/bin/templates/project/AndroidManifest.xml index 7317622d..9bb274d4 100644 --- a/bin/templates/project/AndroidManifest.xml +++ b/bin/templates/project/AndroidManifest.xml @@ -31,8 +31,10 @@ + -