mobile_template 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mobile_template/version.rb +1 -1
- data/mobile_template.gemspec +1 -1
- data/templates/assets/Gemfile +1 -1
- data/templates/assets/source/javascripts/vendor/cordova.js +2106 -1975
- data/templates/assets/source/javascripts/vendor/jquery.js +614 -477
- data/templates/assets/source/javascripts/vendor/jquery.mobile.js +519 -378
- data/templates/assets/source/stylesheets/vendor/jquery.mobile.css.scss +683 -502
- data/templates/cordova_android/VERSION +1 -1
- data/templates/cordova_android/bin/create +5 -1
- data/templates/cordova_android/bin/templates/project/cordova/create +5 -0
- data/templates/cordova_android/bin/templates/project/cordova/debug +1 -1
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/AndroidManifest.xml +18 -25
- data/templates/cordova_android/bin/templates/project/cordova/templates/project/assets/www/index.html +6 -6
- data/templates/cordova_android/framework/assets/js/cordova.android.js +2106 -1975
- data/templates/cordova_android/framework/assets/www/index.html +1 -1
- data/templates/cordova_android/framework/build.xml +2 -42
- data/templates/cordova_android/framework/project.properties +1 -1
- data/templates/cordova_android/framework/res/drawable/splash.png +0 -0
- data/templates/cordova_android/framework/res/drawable-hdpi/icon.png +0 -0
- data/templates/cordova_android/framework/res/drawable-ldpi/icon.png +0 -0
- data/templates/cordova_android/framework/res/drawable-mdpi/icon.png +0 -0
- data/templates/cordova_android/framework/res/xml/plugins.xml +2 -1
- data/templates/cordova_android/framework/src/com/phonegap/api/PluginManager.java +1 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/AudioPlayer.java +24 -16
- data/templates/cordova_android/framework/src/org/apache/cordova/CameraLauncher.java +35 -10
- data/templates/cordova_android/framework/src/org/apache/cordova/ContactAccessor.java +2 -1
- data/templates/cordova_android/framework/src/org/apache/cordova/ContactAccessorSdk5.java +67 -65
- data/templates/cordova_android/framework/src/org/apache/cordova/ContactManager.java +51 -63
- data/templates/cordova_android/framework/src/org/apache/cordova/CordovaChromeClient.java +3 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/CordovaWebViewClient.java +6 -2
- data/templates/cordova_android/framework/src/org/apache/cordova/Device.java +108 -108
- data/templates/cordova_android/framework/src/org/apache/cordova/DroidGap.java +110 -77
- data/templates/cordova_android/framework/src/org/apache/cordova/FileTransfer.java +90 -44
- data/templates/cordova_android/framework/src/org/apache/cordova/FileUtils.java +20 -20
- data/templates/cordova_android/framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java +2 -2
- data/templates/cordova_android/framework/src/org/apache/cordova/NetworkManager.java +7 -8
- data/templates/cordova_android/framework/src/org/apache/cordova/Notification.java +2 -2
- data/templates/cordova_android/framework/src/org/apache/cordova/SplashScreen.java +23 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/Storage.java +3 -3
- data/templates/cordova_android/framework/src/org/apache/cordova/api/CordovaInterface.java +2 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginEntry.java +119 -0
- data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginManager.java +260 -258
- data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginResult.java +2 -2
- data/templates/cordova_android/releasenotes.md +42 -0
- data/templates/cordova_android/test/.classpath +8 -0
- data/templates/cordova_android/test/.project +33 -0
- data/templates/cordova_android/test/AndroidManifest.xml +87 -0
- data/templates/cordova_android/test/README.md +23 -0
- data/templates/cordova_android/test/ant.properties +17 -0
- data/templates/cordova_android/test/assets/www/backbuttonmultipage/index.html +23 -0
- data/templates/cordova_android/test/assets/www/backbuttonmultipage/sample2.html +23 -0
- data/templates/cordova_android/test/assets/www/backbuttonmultipage/sample3.html +26 -0
- data/templates/cordova_android/test/assets/www/background/index.html +99 -0
- data/templates/cordova_android/test/assets/www/background/index2.html +98 -0
- data/templates/cordova_android/test/assets/www/cordova-1.6.0.js +4985 -0
- data/templates/cordova_android/test/assets/www/cordova.js +2 -0
- data/templates/cordova_android/test/assets/www/htmlnotfound/error.html +1 -0
- data/templates/cordova_android/test/assets/www/iframe/index.html +33 -0
- data/templates/cordova_android/test/assets/www/iframe/index2.html +24 -0
- data/templates/cordova_android/test/assets/www/index.html +47 -0
- data/templates/cordova_android/test/assets/www/jqmtabbackbutton/index.html +49 -0
- data/templates/cordova_android/test/assets/www/jqmtabbackbutton/tab1.html +29 -0
- data/templates/cordova_android/test/assets/www/jqmtabbackbutton/tab2.html +30 -0
- data/templates/cordova_android/test/assets/www/jqmtabbackbutton/tab3.html +30 -0
- data/templates/cordova_android/test/assets/www/lifecycle/index.html +108 -0
- data/templates/cordova_android/test/assets/www/lifecycle/index2.html +104 -0
- data/templates/cordova_android/test/assets/www/main.js +150 -0
- data/templates/cordova_android/test/assets/www/master.css +117 -0
- data/templates/cordova_android/test/assets/www/menus/index.html +29 -0
- data/templates/cordova_android/test/assets/www/splashscreen/index.html +22 -0
- data/templates/cordova_android/test/assets/www/userwebview/index.html +49 -0
- data/templates/cordova_android/test/assets/www/whitelist/index.html +29 -0
- data/templates/cordova_android/test/assets/www/whitelist/index2.html +23 -0
- data/templates/cordova_android/test/assets/www/xhr/index.html +48 -0
- data/templates/cordova_android/test/build.xml +85 -0
- data/templates/cordova_android/test/libs/cordova-1.6.0.jar +0 -0
- data/templates/cordova_android/test/project.properties +11 -0
- data/templates/cordova_android/{framework → test}/res/drawable/icon.png +0 -0
- data/templates/cordova_android/test/res/drawable/sandy.jpg +0 -0
- data/templates/cordova_android/test/res/drawable-hdpi/ic_launcher.png +0 -0
- data/templates/cordova_android/test/res/drawable-ldpi/ic_launcher.png +0 -0
- data/templates/cordova_android/test/res/drawable-mdpi/ic_launcher.png +0 -0
- data/templates/cordova_android/test/res/layout/main.xml +13 -0
- data/templates/cordova_android/test/res/values/strings.xml +4 -0
- data/templates/cordova_android/{bin/templates/project/cordova/templates/project → test}/res/xml/cordova.xml +0 -0
- data/templates/cordova_android/{bin/templates/project/cordova/templates/project → test}/res/xml/plugins.xml +1 -1
- data/templates/cordova_android/test/src/org/apache/cordova/test/ActivityPlugin.java +81 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/FixWebView.java +43 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/backbuttonmultipage.java +30 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/background.java +34 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/errorurl.java +32 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/htmlnotfound.java +31 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/iframe.java +30 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/jqmtabbackbutton.java +30 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/lifecycle.java +30 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/loading.java +31 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/menus.java +80 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/splashscreen.java +35 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/tests.java +32 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/timeout.java +34 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/userwebview.java +72 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/whitelist.java +51 -0
- data/templates/cordova_android/test/src/org/apache/cordova/test/xhr.java +30 -0
- metadata +83 -30
- data/templates/cordova_android/framework/assets/js/accelerometer.js +0 -137
- data/templates/cordova_android/framework/assets/js/app.js +0 -89
- data/templates/cordova_android/framework/assets/js/battery.js +0 -134
- data/templates/cordova_android/framework/assets/js/camera.js +0 -168
- data/templates/cordova_android/framework/assets/js/capture.js +0 -203
- data/templates/cordova_android/framework/assets/js/compass.js +0 -168
- data/templates/cordova_android/framework/assets/js/contact.js +0 -310
- data/templates/cordova_android/framework/assets/js/cordova.js.base +0 -924
- data/templates/cordova_android/framework/assets/js/crypto.js +0 -54
- data/templates/cordova_android/framework/assets/js/device.js +0 -83
- data/templates/cordova_android/framework/assets/js/file.js +0 -1082
- data/templates/cordova_android/framework/assets/js/filetransfer.js +0 -125
- data/templates/cordova_android/framework/assets/js/geolocation.js +0 -209
- data/templates/cordova_android/framework/assets/js/header.txt +0 -19
- data/templates/cordova_android/framework/assets/js/media.js +0 -233
- data/templates/cordova_android/framework/assets/js/network.js +0 -100
- data/templates/cordova_android/framework/assets/js/notification.js +0 -133
- data/templates/cordova_android/framework/assets/js/position.js +0 -100
- data/templates/cordova_android/framework/assets/js/storage.js +0 -439
@@ -0,0 +1,32 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class errorurl extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.init();
|
29
|
+
this.setStringProperty("errorUrl", "file:///android_asset/www/htmlnotfound/error.html");
|
30
|
+
super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class htmlnotfound extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.init();
|
29
|
+
super.loadUrl("file:///android_asset/www/htmlnotfound/index.html");
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class iframe extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.loadUrl("file:///android_asset/www/iframe/index.html");
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class jqmtabbackbutton extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.loadUrl("file:///android_asset/www/jqmtabbackbutton/index.html");
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class lifecycle extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.loadUrl("file:///android_asset/www/lifecycle/index.html");
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class loading extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.setStringProperty("loadingDialog", "Testing,Loading...");
|
29
|
+
super.loadUrl("http://www.google.com");
|
30
|
+
}
|
31
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import android.view.ContextMenu;
|
23
|
+
import android.view.Menu;
|
24
|
+
import android.view.MenuItem;
|
25
|
+
import android.view.View;
|
26
|
+
import android.view.ContextMenu.ContextMenuInfo;
|
27
|
+
|
28
|
+
import org.apache.cordova.*;
|
29
|
+
import org.apache.cordova.api.LOG;
|
30
|
+
|
31
|
+
public class menus extends DroidGap {
|
32
|
+
@Override
|
33
|
+
public void onCreate(Bundle savedInstanceState) {
|
34
|
+
super.onCreate(savedInstanceState);
|
35
|
+
super.init();
|
36
|
+
super.registerForContextMenu(super.appView);
|
37
|
+
super.loadUrl("file:///android_asset/www/menus/index.html");
|
38
|
+
}
|
39
|
+
|
40
|
+
// Demonstrate how to add your own menus to app
|
41
|
+
|
42
|
+
@Override
|
43
|
+
public boolean onCreateOptionsMenu(Menu menu) {
|
44
|
+
super.onCreateOptionsMenu(menu);
|
45
|
+
int base = Menu.FIRST;
|
46
|
+
// Group, item id, order, title
|
47
|
+
menu.add(base, base, base, "Item1");
|
48
|
+
menu.add(base, base + 1, base + 1, "Item2");
|
49
|
+
menu.add(base, base + 2, base + 2, "Item3");
|
50
|
+
return true;
|
51
|
+
}
|
52
|
+
|
53
|
+
@Override
|
54
|
+
public boolean onOptionsItemSelected(MenuItem item) {
|
55
|
+
LOG.d("menus", "Item " + item.getItemId() + " pressed.");
|
56
|
+
this.appView.loadUrl("javascript:alert('Menu " + item.getItemId() + " pressed.')");
|
57
|
+
return super.onOptionsItemSelected(item);
|
58
|
+
}
|
59
|
+
|
60
|
+
@Override
|
61
|
+
public boolean onPrepareOptionsMenu(Menu menu) {
|
62
|
+
LOG.d("menus", "onPrepareOptionsMenu()");
|
63
|
+
// this.appView.loadUrl("javascript:alert('onPrepareOptionsMenu()')");
|
64
|
+
return true;
|
65
|
+
}
|
66
|
+
|
67
|
+
@Override
|
68
|
+
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo info) {
|
69
|
+
LOG.d("menus", "onCreateContextMenu()");
|
70
|
+
menu.setHeaderTitle("Test Context Menu");
|
71
|
+
menu.add(200, 200, 200, "Context Item1");
|
72
|
+
}
|
73
|
+
|
74
|
+
@Override
|
75
|
+
public boolean onContextItemSelected(MenuItem item) {
|
76
|
+
this.appView.loadUrl("javascript:alert('Context Menu " + item.getItemId() + " pressed.')");
|
77
|
+
return true;
|
78
|
+
}
|
79
|
+
|
80
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class splashscreen extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.init();
|
29
|
+
|
30
|
+
// Show splashscreen
|
31
|
+
this.setIntegerProperty("splashscreen", R.drawable.sandy);
|
32
|
+
|
33
|
+
super.loadUrl("file:///android_asset/www/splashscreen/index.html", 2000);
|
34
|
+
}
|
35
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class tests extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.init();
|
29
|
+
super.pluginManager.addService("Activity", "org.apache.cordova.test.ActivityPlugin");
|
30
|
+
super.loadUrl("file:///android_asset/www/index.html");
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class timeout extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.init();
|
29
|
+
|
30
|
+
// Short timeout to cause error
|
31
|
+
this.setIntegerProperty("loadUrlTimeoutValue", 10);
|
32
|
+
super.loadUrl("http://www.google.com");
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import android.webkit.WebView;
|
23
|
+
import android.webkit.GeolocationPermissions.Callback;
|
24
|
+
|
25
|
+
import org.apache.cordova.*;
|
26
|
+
import org.apache.cordova.api.LOG;
|
27
|
+
|
28
|
+
public class userwebview extends DroidGap {
|
29
|
+
@Override
|
30
|
+
public void onCreate(Bundle savedInstanceState) {
|
31
|
+
super.onCreate(savedInstanceState);
|
32
|
+
super.init(new WebView(this), new TestViewClient(this), new TestChromeClient(this));
|
33
|
+
super.loadUrl("file:///android_asset/www/userwebview/index.html");
|
34
|
+
}
|
35
|
+
|
36
|
+
public class TestChromeClient extends CordovaChromeClient {
|
37
|
+
public TestChromeClient(DroidGap arg0) {
|
38
|
+
super(arg0);
|
39
|
+
LOG.d("userwebview", "TestChromeClient()");
|
40
|
+
}
|
41
|
+
|
42
|
+
@Override
|
43
|
+
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
|
44
|
+
LOG.d("userwebview", "onGeolocationPermissionsShowPrompt(" + origin + ")");
|
45
|
+
super.onGeolocationPermissionsShowPrompt(origin, callback);
|
46
|
+
callback.invoke(origin, true, false);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
/**
|
51
|
+
* This class can be used to override the GapViewClient and receive notification of webview events.
|
52
|
+
*/
|
53
|
+
public class TestViewClient extends CordovaWebViewClient {
|
54
|
+
public TestViewClient(DroidGap arg0) {
|
55
|
+
super(arg0);
|
56
|
+
LOG.d("userwebview", "TestViewClient()");
|
57
|
+
}
|
58
|
+
|
59
|
+
@Override
|
60
|
+
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
61
|
+
LOG.d("userwebview", "shouldOverrideUrlLoading(" + url + ")");
|
62
|
+
return super.shouldOverrideUrlLoading(view, url);
|
63
|
+
}
|
64
|
+
|
65
|
+
@Override
|
66
|
+
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
|
67
|
+
LOG.d("userwebview", "onReceivedError: Error code=" + errorCode + " Description=" + description + " URL=" + failingUrl);
|
68
|
+
super.onReceivedError(view, errorCode, description, failingUrl);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import android.webkit.WebView;
|
23
|
+
|
24
|
+
import org.apache.cordova.*;
|
25
|
+
import org.apache.cordova.api.LOG;
|
26
|
+
|
27
|
+
public class whitelist extends DroidGap {
|
28
|
+
@Override
|
29
|
+
public void onCreate(Bundle savedInstanceState) {
|
30
|
+
super.onCreate(savedInstanceState);
|
31
|
+
super.init(new WebView(this), new TestViewClient(this), new CordovaChromeClient(this));
|
32
|
+
super.loadUrl("file:///android_asset/www/whitelist/index.html");
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* This class can be used to override the GapViewClient and receive notification of webview events.
|
37
|
+
*/
|
38
|
+
public class TestViewClient extends CordovaWebViewClient {
|
39
|
+
|
40
|
+
public TestViewClient(DroidGap arg0) {
|
41
|
+
super(arg0);
|
42
|
+
}
|
43
|
+
|
44
|
+
@Override
|
45
|
+
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
46
|
+
LOG.d("whitelist", "shouldOverrideUrlLoading(" + url + ")");
|
47
|
+
LOG.d("whitelist", "originalUrl=" + view.getOriginalUrl());
|
48
|
+
return super.shouldOverrideUrlLoading(view, url);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/*
|
2
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
or more contributor license agreements. See the NOTICE file
|
4
|
+
distributed with this work for additional information
|
5
|
+
regarding copyright ownership. The ASF licenses this file
|
6
|
+
to you under the Apache License, Version 2.0 (the
|
7
|
+
"License"); you may not use this file except in compliance
|
8
|
+
with the License. You may obtain a copy of the License at
|
9
|
+
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
|
12
|
+
Unless required by applicable law or agreed to in writing,
|
13
|
+
software distributed under the License is distributed on an
|
14
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
KIND, either express or implied. See the License for the
|
16
|
+
specific language governing permissions and limitations
|
17
|
+
under the License.
|
18
|
+
*/
|
19
|
+
package org.apache.cordova.test;
|
20
|
+
|
21
|
+
import android.os.Bundle;
|
22
|
+
import org.apache.cordova.*;
|
23
|
+
|
24
|
+
public class xhr extends DroidGap {
|
25
|
+
@Override
|
26
|
+
public void onCreate(Bundle savedInstanceState) {
|
27
|
+
super.onCreate(savedInstanceState);
|
28
|
+
super.loadUrl("file:///android_asset/www/xhr/index.html");
|
29
|
+
}
|
30
|
+
}
|