mobile_template 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. data/lib/mobile_template/version.rb +1 -1
  2. data/mobile_template.gemspec +1 -1
  3. data/templates/assets/Gemfile +1 -1
  4. data/templates/assets/source/javascripts/vendor/cordova.js +2106 -1975
  5. data/templates/assets/source/javascripts/vendor/jquery.js +614 -477
  6. data/templates/assets/source/javascripts/vendor/jquery.mobile.js +519 -378
  7. data/templates/assets/source/stylesheets/vendor/jquery.mobile.css.scss +683 -502
  8. data/templates/cordova_android/VERSION +1 -1
  9. data/templates/cordova_android/bin/create +5 -1
  10. data/templates/cordova_android/bin/templates/project/cordova/create +5 -0
  11. data/templates/cordova_android/bin/templates/project/cordova/debug +1 -1
  12. data/templates/cordova_android/bin/templates/project/cordova/templates/project/AndroidManifest.xml +18 -25
  13. data/templates/cordova_android/bin/templates/project/cordova/templates/project/assets/www/index.html +6 -6
  14. data/templates/cordova_android/framework/assets/js/cordova.android.js +2106 -1975
  15. data/templates/cordova_android/framework/assets/www/index.html +1 -1
  16. data/templates/cordova_android/framework/build.xml +2 -42
  17. data/templates/cordova_android/framework/project.properties +1 -1
  18. data/templates/cordova_android/framework/res/drawable/splash.png +0 -0
  19. data/templates/cordova_android/framework/res/drawable-hdpi/icon.png +0 -0
  20. data/templates/cordova_android/framework/res/drawable-ldpi/icon.png +0 -0
  21. data/templates/cordova_android/framework/res/drawable-mdpi/icon.png +0 -0
  22. data/templates/cordova_android/framework/res/xml/plugins.xml +2 -1
  23. data/templates/cordova_android/framework/src/com/phonegap/api/PluginManager.java +1 -0
  24. data/templates/cordova_android/framework/src/org/apache/cordova/AudioPlayer.java +24 -16
  25. data/templates/cordova_android/framework/src/org/apache/cordova/CameraLauncher.java +35 -10
  26. data/templates/cordova_android/framework/src/org/apache/cordova/ContactAccessor.java +2 -1
  27. data/templates/cordova_android/framework/src/org/apache/cordova/ContactAccessorSdk5.java +67 -65
  28. data/templates/cordova_android/framework/src/org/apache/cordova/ContactManager.java +51 -63
  29. data/templates/cordova_android/framework/src/org/apache/cordova/CordovaChromeClient.java +3 -0
  30. data/templates/cordova_android/framework/src/org/apache/cordova/CordovaWebViewClient.java +6 -2
  31. data/templates/cordova_android/framework/src/org/apache/cordova/Device.java +108 -108
  32. data/templates/cordova_android/framework/src/org/apache/cordova/DroidGap.java +110 -77
  33. data/templates/cordova_android/framework/src/org/apache/cordova/FileTransfer.java +90 -44
  34. data/templates/cordova_android/framework/src/org/apache/cordova/FileUtils.java +20 -20
  35. data/templates/cordova_android/framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java +2 -2
  36. data/templates/cordova_android/framework/src/org/apache/cordova/NetworkManager.java +7 -8
  37. data/templates/cordova_android/framework/src/org/apache/cordova/Notification.java +2 -2
  38. data/templates/cordova_android/framework/src/org/apache/cordova/SplashScreen.java +23 -0
  39. data/templates/cordova_android/framework/src/org/apache/cordova/Storage.java +3 -3
  40. data/templates/cordova_android/framework/src/org/apache/cordova/api/CordovaInterface.java +2 -0
  41. data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginEntry.java +119 -0
  42. data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginManager.java +260 -258
  43. data/templates/cordova_android/framework/src/org/apache/cordova/api/PluginResult.java +2 -2
  44. data/templates/cordova_android/releasenotes.md +42 -0
  45. data/templates/cordova_android/test/.classpath +8 -0
  46. data/templates/cordova_android/test/.project +33 -0
  47. data/templates/cordova_android/test/AndroidManifest.xml +87 -0
  48. data/templates/cordova_android/test/README.md +23 -0
  49. data/templates/cordova_android/test/ant.properties +17 -0
  50. data/templates/cordova_android/test/assets/www/backbuttonmultipage/index.html +23 -0
  51. data/templates/cordova_android/test/assets/www/backbuttonmultipage/sample2.html +23 -0
  52. data/templates/cordova_android/test/assets/www/backbuttonmultipage/sample3.html +26 -0
  53. data/templates/cordova_android/test/assets/www/background/index.html +99 -0
  54. data/templates/cordova_android/test/assets/www/background/index2.html +98 -0
  55. data/templates/cordova_android/test/assets/www/cordova-1.6.0.js +4985 -0
  56. data/templates/cordova_android/test/assets/www/cordova.js +2 -0
  57. data/templates/cordova_android/test/assets/www/htmlnotfound/error.html +1 -0
  58. data/templates/cordova_android/test/assets/www/iframe/index.html +33 -0
  59. data/templates/cordova_android/test/assets/www/iframe/index2.html +24 -0
  60. data/templates/cordova_android/test/assets/www/index.html +47 -0
  61. data/templates/cordova_android/test/assets/www/jqmtabbackbutton/index.html +49 -0
  62. data/templates/cordova_android/test/assets/www/jqmtabbackbutton/tab1.html +29 -0
  63. data/templates/cordova_android/test/assets/www/jqmtabbackbutton/tab2.html +30 -0
  64. data/templates/cordova_android/test/assets/www/jqmtabbackbutton/tab3.html +30 -0
  65. data/templates/cordova_android/test/assets/www/lifecycle/index.html +108 -0
  66. data/templates/cordova_android/test/assets/www/lifecycle/index2.html +104 -0
  67. data/templates/cordova_android/test/assets/www/main.js +150 -0
  68. data/templates/cordova_android/test/assets/www/master.css +117 -0
  69. data/templates/cordova_android/test/assets/www/menus/index.html +29 -0
  70. data/templates/cordova_android/test/assets/www/splashscreen/index.html +22 -0
  71. data/templates/cordova_android/test/assets/www/userwebview/index.html +49 -0
  72. data/templates/cordova_android/test/assets/www/whitelist/index.html +29 -0
  73. data/templates/cordova_android/test/assets/www/whitelist/index2.html +23 -0
  74. data/templates/cordova_android/test/assets/www/xhr/index.html +48 -0
  75. data/templates/cordova_android/test/build.xml +85 -0
  76. data/templates/cordova_android/test/libs/cordova-1.6.0.jar +0 -0
  77. data/templates/cordova_android/test/project.properties +11 -0
  78. data/templates/cordova_android/{framework → test}/res/drawable/icon.png +0 -0
  79. data/templates/cordova_android/test/res/drawable/sandy.jpg +0 -0
  80. data/templates/cordova_android/test/res/drawable-hdpi/ic_launcher.png +0 -0
  81. data/templates/cordova_android/test/res/drawable-ldpi/ic_launcher.png +0 -0
  82. data/templates/cordova_android/test/res/drawable-mdpi/ic_launcher.png +0 -0
  83. data/templates/cordova_android/test/res/layout/main.xml +13 -0
  84. data/templates/cordova_android/test/res/values/strings.xml +4 -0
  85. data/templates/cordova_android/{bin/templates/project/cordova/templates/project → test}/res/xml/cordova.xml +0 -0
  86. data/templates/cordova_android/{bin/templates/project/cordova/templates/project → test}/res/xml/plugins.xml +1 -1
  87. data/templates/cordova_android/test/src/org/apache/cordova/test/ActivityPlugin.java +81 -0
  88. data/templates/cordova_android/test/src/org/apache/cordova/test/FixWebView.java +43 -0
  89. data/templates/cordova_android/test/src/org/apache/cordova/test/backbuttonmultipage.java +30 -0
  90. data/templates/cordova_android/test/src/org/apache/cordova/test/background.java +34 -0
  91. data/templates/cordova_android/test/src/org/apache/cordova/test/errorurl.java +32 -0
  92. data/templates/cordova_android/test/src/org/apache/cordova/test/htmlnotfound.java +31 -0
  93. data/templates/cordova_android/test/src/org/apache/cordova/test/iframe.java +30 -0
  94. data/templates/cordova_android/test/src/org/apache/cordova/test/jqmtabbackbutton.java +30 -0
  95. data/templates/cordova_android/test/src/org/apache/cordova/test/lifecycle.java +30 -0
  96. data/templates/cordova_android/test/src/org/apache/cordova/test/loading.java +31 -0
  97. data/templates/cordova_android/test/src/org/apache/cordova/test/menus.java +80 -0
  98. data/templates/cordova_android/test/src/org/apache/cordova/test/splashscreen.java +35 -0
  99. data/templates/cordova_android/test/src/org/apache/cordova/test/tests.java +32 -0
  100. data/templates/cordova_android/test/src/org/apache/cordova/test/timeout.java +34 -0
  101. data/templates/cordova_android/test/src/org/apache/cordova/test/userwebview.java +72 -0
  102. data/templates/cordova_android/test/src/org/apache/cordova/test/whitelist.java +51 -0
  103. data/templates/cordova_android/test/src/org/apache/cordova/test/xhr.java +30 -0
  104. metadata +83 -30
  105. data/templates/cordova_android/framework/assets/js/accelerometer.js +0 -137
  106. data/templates/cordova_android/framework/assets/js/app.js +0 -89
  107. data/templates/cordova_android/framework/assets/js/battery.js +0 -134
  108. data/templates/cordova_android/framework/assets/js/camera.js +0 -168
  109. data/templates/cordova_android/framework/assets/js/capture.js +0 -203
  110. data/templates/cordova_android/framework/assets/js/compass.js +0 -168
  111. data/templates/cordova_android/framework/assets/js/contact.js +0 -310
  112. data/templates/cordova_android/framework/assets/js/cordova.js.base +0 -924
  113. data/templates/cordova_android/framework/assets/js/crypto.js +0 -54
  114. data/templates/cordova_android/framework/assets/js/device.js +0 -83
  115. data/templates/cordova_android/framework/assets/js/file.js +0 -1082
  116. data/templates/cordova_android/framework/assets/js/filetransfer.js +0 -125
  117. data/templates/cordova_android/framework/assets/js/geolocation.js +0 -209
  118. data/templates/cordova_android/framework/assets/js/header.txt +0 -19
  119. data/templates/cordova_android/framework/assets/js/media.js +0 -233
  120. data/templates/cordova_android/framework/assets/js/network.js +0 -100
  121. data/templates/cordova_android/framework/assets/js/notification.js +0 -133
  122. data/templates/cordova_android/framework/assets/js/position.js +0 -100
  123. 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
+ }