Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Dead link on Setup-Development-Environment-Of-Crosswalk-Cordova-Android #118

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6d40adf
Update JS snapshot to version 3.5.0-rc1 (via coho)
infil00p May 6, 2014
7ec8d08
Set VERSION to 3.5.0-rc1 (via coho)
infil00p May 6, 2014
a70191a
OkHttp has broken headers. Updating for ASF compliance.
infil00p May 6, 2014
df53dbd
package.json apparently needs to be updated before tagging, re-taggin…
infil00p May 8, 2014
568d3b5
Update JS snapshot to version 3.5.0 (via coho)
stevengill May 8, 2014
82bc714
Set VERSION to 3.5.0 (via coho)
stevengill May 8, 2014
bc84521
Change CordovaWebView to derive from XWalkView.
huningxin Aug 28, 2013
0400bd1
Enable remote debugging.
huningxin Aug 28, 2013
54732fd
Use XWalkSettings
huningxin Aug 30, 2013
39eeb01
Add Looper to the threat that plugin runs in.
gaochun Sep 17, 2013
188cac1
Fix file transfer plugin crash issue.
junmin-zhu Oct 16, 2013
a2a8418
Add more detail comments and TODO for file transfer plugin crash issue.
junmin-zhu Oct 16, 2013
dd36604
Hook activity life-cycle events to XWalkView handlers.
huningxin Oct 25, 2013
74c1b48
Enable the pause and resume timers based on XWalkView.
huningxin Oct 28, 2013
5dcb4f1
Add xwalk extension system to cordova-xwalk-android.
gaochun Oct 18, 2013
c7b8adf
Add xwalk_core_library to git ignore path
Oct 29, 2013
7c2ff25
Add empty implementation for loadDataForTest in CordovaWebView
Oct 30, 2013
944b2c4
Implement the destroyExtension interface
Oct 31, 2013
1aa16fb
Update the README.md according to Crosswalk dependency.
huningxin Oct 29, 2013
ac38189
Use XWalkExtensionManager to reuse the extension system
Nov 6, 2013
f369fb9
Change the CordovaWebView's onGeolocationPermissionsShowPrompt to xwalk.
huningxin Nov 15, 2013
153df46
Bring back the CordovaWebView's WebBackForwardList related code.
junmin-zhu Nov 15, 2013
389d0ea
Fix the unit test build error due to onGeolocationPermissionsShowProm…
huningxin Nov 19, 2013
050dd98
Update the README.md
huningxin Nov 22, 2013
2f91f89
Not to enable remote debugging by default.
huningxin Nov 25, 2013
8af9a6f
Update the README.md according to the wiki link update.
huningxin Dec 3, 2013
8271b24
Fix typo in readme
rscohn2 Dec 17, 2013
8aab9fb
Enable create script for cordova-xwalk container on Linux
Oct 10, 2013
826f060
Copy assets from xwalk core library to cordova app
Oct 21, 2013
04d624e
Move the xwalk_core_library path into framework
huningxin Oct 25, 2013
b2180ec
Execute `android update` with host supported target.
huningxin Nov 13, 2013
29925f3
Fix the build issue due to HttpAuthHandler API change in XwalkCoreLib…
huningxin Dec 24, 2013
d307a3f
Temporarily to remove the APIs missing in the XWalk.
junmin-zhu Dec 24, 2013
97a99a9
1. Don't need to update the xwalk_core_library project second times.
junmin-zhu Dec 24, 2013
c937c59
Modify the CordovaXWalkCoreExtensionBridge API due to the change of
junmin-zhu Dec 25, 2013
fba479d
Run android update in framework
Jan 6, 2014
dc8d83e
Remove duplicate configurarion in the .classpath.
junmin-zhu Jan 8, 2014
e8c942e
Temporarily disable 5 unit test cases for Cordova xwalk
junmin-zhu Jan 22, 2014
583a418
Because testOnScrollChanged test case depends on third party library
junmin-zhu Jan 26, 2014
2d2b62d
Fix testUrl test case failed issue.
junmin-zhu Jan 22, 2014
699e007
Fix that CordovaChromeClient misses all the implementation in xwalk
Feb 12, 2014
3ff4ff9
Exit fullscreen mode first when back key pressed
Feb 12, 2014
21f83ba
Fix that onNewIntent in CordovaWebView should return boolean as in XW…
Feb 28, 2014
c39e563
Refactor the usage after the changes of extension mechanism in core l…
Feb 28, 2014
b57f49c
Enable remote debugging for debug build.
huningxin Mar 13, 2014
e83c0b2
Remove copy asset step from create script
Mar 14, 2014
efcc310
Fix the build error due to the rename of package name.
Mar 19, 2014
4b45a47
Fix the compile error caused by the change of onReceivedSslError.
Mar 28, 2014
f1f6255
Remove unused import for SSL error handler.
Apr 8, 2014
b2f0a8e
Refactor Cordova container to use the new API defined in Crosswalk.
Apr 9, 2014
2b62207
Don't use two classes XWalkUIClientImpl and XWalkResourceClientImpl.
Apr 21, 2014
f13617c
Add two network related permissions to AndroidManifest.xml
kurli Apr 21, 2014
a33426a
Workaround the xwalk_core_library R.java missing issue.
huningxin Apr 24, 2014
fa2530f
Fix XDK APX fails to build issue by bridging internal APIs.
huningxin Apr 29, 2014
e768be0
Fix XWALK-1615 Cordova API test fails due to no JavaScript API exposed
huningxin May 4, 2014
6fe0e77
Fix that cordova activity uses XWalk API with null pointer check
May 12, 2014
2bc2599
Change layout of splash dialog when orientation changed
kurli May 29, 2014
17d25ab
Merge pull request #114 from gaochun/next
huningxin Jun 9, 2014
0e52381
Allow universal access from file URLs for Android 4.0.x
huningxin Jun 4, 2014
18e03fc
Fix onPageStarted/Finished never called in subclass of CordovaWebView…
huningxin Jun 11, 2014
c761501
Merge pull request #116 from huningxin/fix_onpagestarted
huningxin Jun 13, 2014
dd93498
Dead link on Setup-Development-Environment-Of-Crosswalk-Cordova-Android
dotnetwise Jun 17, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ framework/assets/www/phonegap-*.js
framework/libs
framework/javadoc-public
framework/javadoc-private
framework/xwalk_core_library
test/libs
example
./test
Expand Down
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
# under the License.
#
-->
Cordova Android
Crosswalk-based Cordova Android
===

Cordova Android is an Android application library that allows for Cordova-based
Crosswalk-based Cordova Android is derived from [Cordova Android](https://github.com/apache/cordova-android)
and uses [Crosswalk](https://github.com/crosswalk-project/crosswalk) as the
HTML5 runtime. It is an Android application library that allows for Cordova-based
projects to be built for the Android Platform. Cordova based applications are,
at the core, applications written with web technology: HTML, CSS and JavaScript.

Expand All @@ -34,7 +36,13 @@ Requires
- Java JDK 1.5 or greater
- Apache Ant 1.8.0 or greater
- Android SDK [http://developer.android.com](http://developer.android.com)
- Python 2.6 or greater

Setup Crosswalk Dependency
---

This is not a fix but the the following link is dead! And the Issues are disabled!!
Please refer to [Setup Crosswalk Dependency](https://crosswalk-project.org/#wiki/Setup-Development-Environment-Of-Crosswalk-Cordova-Android.

Cordova Android Developer Tools
---
Expand All @@ -57,27 +65,14 @@ These commands live in a generated Cordova Android project. Any interactions wit
./cordova/run ........................ calls `build` then deploys to a connected Android device. If no Android device is detected, will launch an emulator and deploy to it.
./cordova/version ...................... returns the cordova-android version of the current project

Importing a Cordova Android Project into Eclipse
Importing a Crosswalk-based Cordova Android Project into Eclipse
----

1. File > New > Project...
2. Android > Android Project
3. Create project from existing source (point to the generated app found in tmp/android)
4. Right click on libs/cordova.jar and add to build path
5. Right click on the project root: Run as > Run Configurations
6. Click on the Target tab and select Manual (this way you can choose the emulator or device to build to)

Building without the Tooling
---
Note: The Developer Tools handle this. This is only to be done if the tooling fails, or if
you are developing directly against the framework.


To create your `cordova.jar` file, run in the framework directory:

android update project -p . -t android-19
ant jar

1. Import Crosswalk-based Cordova Android and XWalkCoreLibrary library projects by File > Import... > Existing Android Code Into Workspace. Point to `[path_to_cordova_xwalk_android]/framework` and click `Finish`.
2. Build `xwalk_core_library` and `Cordova` projects.
3. Import generated project by File > Import... > Existing Android Code. Point to the generated app path.
4. Right click on the project root: Run as > Run Configurations
5. Click on the Target tab and select Manual (this way you can choose the emulator or device to build to)

Running Tests
----
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.5.0-dev
3.5.0
17 changes: 14 additions & 3 deletions bin/lib/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ var shell = require('shelljs'),
path = require('path'),
fs = require('fs'),
check_reqs = require('./check_reqs'),
ROOT = path.join(__dirname, '..', '..');
ROOT = path.join(__dirname, '..', '..'),
XWALK_LIBRARY_PATH= path.join(ROOT, 'framework', 'xwalk_core_library');

// Returns a promise.
function exec(command, opt_cwd) {
Expand Down Expand Up @@ -72,6 +73,7 @@ function copyJsAndLibrary(projectPath, shared, projectName) {
shell.cp('-f', path.join(ROOT, 'framework', 'AndroidManifest.xml'), nestedCordovaLibPath);
shell.cp('-f', path.join(ROOT, 'framework', 'project.properties'), nestedCordovaLibPath);
shell.cp('-r', path.join(ROOT, 'framework', 'src'), nestedCordovaLibPath);
shell.cp('-r', path.join(ROOT, 'framework', 'xwalk_core_library'), nestedCordovaLibPath);
// Create an eclipse project file and set the name of it to something unique.
// Without this, you can't import multiple CordovaLib projects into the same workspace.
var eclipseProjectFilePath = path.join(nestedCordovaLibPath, '.project');
Expand All @@ -84,12 +86,13 @@ function copyJsAndLibrary(projectPath, shared, projectName) {

function runAndroidUpdate(projectPath, target_api, shared) {
var targetFrameworkDir = getFrameworkDir(projectPath, shared);
exec('android update lib-project -p "' + targetFrameworkDir + '" --target ' + target_api);
return exec('android update project --subprojects --path "' + projectPath + '" --target ' + target_api + ' --library "' + path.relative(projectPath, targetFrameworkDir) + '"');
}

function copyAntRules(projectPath) {
var srcDir = path.join(ROOT, 'bin', 'templates', 'project');
shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath);
//var srcDir = path.join(ROOT, 'bin', 'templates', 'project');
//shell.cp('-f', path.join(srcDir, 'custom_rules.xml'), projectPath);
}

function copyScripts(projectPath) {
Expand Down Expand Up @@ -153,6 +156,14 @@ exports.createProject = function(project_path, package_name, project_name, proje
return Q.reject('Project name cannot be CordovaActivity');
}

// prepare xwalk_core_library
if(fs.existsSync(XWALK_LIBRARY_PATH)) {
exec('android update lib-project --path "' + XWALK_LIBRARY_PATH + '" --target "' + target_api + '"' )
} else {
// TODO(wang16): download xwalk core library here
return Q.reject('No XWalk Library Project found. Please download it and extract it to $XWALK_LIBRARY_PATH')
}

// Check that requirements are met and proper targets are installed
return check_reqs.run()
.then(function() {
Expand Down
2 changes: 1 addition & 1 deletion bin/templates/cordova/version
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
*/

// Coho updates this line:
var VERSION = "3.5.0-dev";
var VERSION = "3.5.0";

console.log(VERSION);
2 changes: 2 additions & 0 deletions bin/templates/project/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
android:anyDensity="true"
/>

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application android:icon="@drawable/icon" android:label="@string/app_name"
Expand Down
110 changes: 108 additions & 2 deletions framework/assets/www/cordova.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Platform: android
// 3.5.0-dev-81f9a00
// 3.5.0
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
Expand All @@ -19,7 +19,7 @@
under the License.
*/
;(function() {
var CORDOVA_JS_BUILD_LABEL = '3.5.0-dev-81f9a00';
var CORDOVA_JS_BUILD_LABEL = '3.5.0';
// file: src/scripts/require.js

/*jshint -W079 */
Expand Down Expand Up @@ -825,6 +825,7 @@ channel.createSticky('onNativeReady');
channel.createSticky('onCordovaReady');

// Event to indicate that all automatically loaded JS plugins are loaded and ready.
// FIXME remove this
channel.createSticky('onPluginsReady');

// Event to indicate that Cordova is ready
Expand Down Expand Up @@ -1245,6 +1246,111 @@ channel.join(function() {
}, platformInitChannelsArray);


});

// file: src/common/init_b.js
define("cordova/init_b", function(require, exports, module) {

var channel = require('cordova/channel');
var cordova = require('cordova');
var platform = require('cordova/platform');

var platformInitChannelsArray = [channel.onDOMContentLoaded, channel.onNativeReady];

// setting exec
cordova.exec = require('cordova/exec');

function logUnfiredChannels(arr) {
for (var i = 0; i < arr.length; ++i) {
if (arr[i].state != 2) {
console.log('Channel not fired: ' + arr[i].type);
}
}
}

window.setTimeout(function() {
if (channel.onDeviceReady.state != 2) {
console.log('deviceready has not fired after 5 seconds.');
logUnfiredChannels(platformInitChannelsArray);
logUnfiredChannels(channel.deviceReadyChannelsArray);
}
}, 5000);

// Replace navigator before any modules are required(), to ensure it happens as soon as possible.
// We replace it so that properties that can't be clobbered can instead be overridden.
function replaceNavigator(origNavigator) {
var CordovaNavigator = function() {};
CordovaNavigator.prototype = origNavigator;
var newNavigator = new CordovaNavigator();
// This work-around really only applies to new APIs that are newer than Function.bind.
// Without it, APIs such as getGamepads() break.
if (CordovaNavigator.bind) {
for (var key in origNavigator) {
if (typeof origNavigator[key] == 'function') {
newNavigator[key] = origNavigator[key].bind(origNavigator);
}
}
}
return newNavigator;
}
if (window.navigator) {
window.navigator = replaceNavigator(window.navigator);
}

if (!window.console) {
window.console = {
log: function(){}
};
}
if (!window.console.warn) {
window.console.warn = function(msg) {
this.log("warn: " + msg);
};
}

// Register pause, resume and deviceready channels as events on document.
channel.onPause = cordova.addDocumentEventHandler('pause');
channel.onResume = cordova.addDocumentEventHandler('resume');
channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready');

// Listen for DOMContentLoaded and notify our channel subscribers.
if (document.readyState == 'complete' || document.readyState == 'interactive') {
channel.onDOMContentLoaded.fire();
} else {
document.addEventListener('DOMContentLoaded', function() {
channel.onDOMContentLoaded.fire();
}, false);
}

// _nativeReady is global variable that the native side can set
// to signify that the native code is ready. It is a global since
// it may be called before any cordova JS is ready.
if (window._nativeReady) {
channel.onNativeReady.fire();
}

// Call the platform-specific initialization.
platform.bootstrap && platform.bootstrap();

/**
* Create all cordova objects once native side is ready.
*/
channel.join(function() {

platform.initialize && platform.initialize();

// Fire event to notify that all objects are created
channel.onCordovaReady.fire();

// Fire onDeviceReady event once page has fully loaded, all
// constructors have run and cordova info has been received from native
// side.
channel.join(function() {
require('cordova').fireDocumentEvent('deviceready');
}, channel.deviceReadyChannelsArray);

}, platformInitChannelsArray);

});

// file: src/common/modulemapper.js
Expand Down
1 change: 1 addition & 0 deletions framework/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ target=android-19
apk-configurations=
renderscript.opt.level=O0
android.library=true
android.library.reference.1=xwalk_core_library
16 changes: 16 additions & 0 deletions framework/src/com/squareup/okhttp/internal/spdy/ErrorCode.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.squareup.okhttp.internal.spdy;

public enum ErrorCode {
Expand Down
16 changes: 16 additions & 0 deletions framework/src/com/squareup/okhttp/internal/spdy/Hpack.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.squareup.okhttp.internal.spdy;

import java.io.DataInputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.squareup.okhttp.internal.spdy;

import com.squareup.okhttp.internal.Util;
Expand Down
2 changes: 1 addition & 1 deletion framework/src/org/apache/cordova/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ else if (value.getClass().equals(Integer.class)) {
* Clear page history for the app.
*/
public void clearHistory() {
this.webView.clearHistory();
this.webView.getNavigationHistory().clear();
}

/**
Expand Down
Loading