rhodes 3.3.3.beta.3 → 3.3.3.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/Manifest.txt +16 -1
  2. data/Rakefile +77 -28
  3. data/doc/build.txt +5 -3
  4. data/doc/configuration.txt +13 -0
  5. data/doc/device-caps.txt +46 -27
  6. data/doc/rhom.txt +2 -2
  7. data/doc/test-log-debug.txt +6 -0
  8. data/doc/ui.txt +13 -0
  9. data/lib/build/jake.rb +11 -11
  10. data/lib/extensions/crypt/crypt/cbc.rb +5 -2
  11. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +14 -4
  12. data/lib/framework/rho/render.rb +17 -4
  13. data/lib/framework/rho/rho.rb +1 -1
  14. data/lib/framework/rho/rhocontroller.rb +11 -1
  15. data/lib/framework/rhomotoapi.rb +110 -0
  16. data/platform/android/Rhodes/jni/Android.mk +2 -5
  17. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
  18. data/platform/android/Rhodes/jni/include/rhodes/fileapi.h +38 -0
  19. data/platform/android/Rhodes/jni/src/callbacks.cpp +7 -26
  20. data/platform/android/Rhodes/jni/src/extmanager.cpp +4 -1
  21. data/platform/android/Rhodes/jni/src/fileapi.cpp +38 -14
  22. data/platform/android/Rhodes/jni/src/mapview.cpp +1 -2
  23. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +10 -0
  24. data/platform/android/Rhodes/jni/src/rhodessystem.cpp +1 -1
  25. data/platform/android/Rhodes/jni/src/signature.cpp +1 -4
  26. data/platform/android/Rhodes/rhobundle.xml +1 -1
  27. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +11 -1
  28. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +4 -3
  29. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -6
  30. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -1
  31. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +70 -0
  32. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +3 -1
  33. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +21 -7
  34. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +19 -10
  35. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +8 -5
  36. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +18 -0
  37. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +168 -31
  38. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +46 -9
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +3 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +27 -53
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +27 -3
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +13 -14
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +12 -5
  44. data/platform/android/build/RhodesSRC_build.files +2 -1
  45. data/platform/android/build/android.rake +48 -17
  46. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +1 -1
  47. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +24 -3
  48. data/platform/iphone/Classes/AppManager/AppManager.m +1 -1
  49. data/platform/iphone/Classes/Camera/PickImageDelegate.m +27 -2
  50. data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
  51. data/platform/iphone/Classes/DateTimePickerDelegate.m +85 -9
  52. data/platform/iphone/Classes/DateTimePickerViewController.h +21 -0
  53. data/platform/iphone/Classes/DateTimePickerViewController.m +75 -0
  54. data/platform/iphone/Classes/GeoLocation/LocationController.h +6 -2
  55. data/platform/iphone/Classes/GeoLocation/LocationController.m +54 -14
  56. data/platform/iphone/Classes/RhoMainView.h +2 -0
  57. data/platform/iphone/Classes/Rhodes.m +11 -5
  58. data/platform/iphone/Classes/Signature/SignatureDelegate.m +13 -12
  59. data/platform/iphone/Classes/Signature/SignatureViewController.m +2 -1
  60. data/platform/iphone/Classes/SimpleMainView.m +3 -0
  61. data/platform/iphone/Classes/SplitView/SplittedMainView.m +3 -0
  62. data/platform/iphone/Classes/TabbedMainView.m +30 -11
  63. data/platform/iphone/rbuild/iphone.rake +7 -1
  64. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +6 -0
  65. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
  66. data/platform/shared/common/BundleManager.cpp +42 -2
  67. data/platform/shared/common/ExtManager.h +7 -0
  68. data/platform/shared/common/RhoFile.cpp +170 -2
  69. data/platform/shared/common/RhoFile.h +4 -0
  70. data/platform/shared/common/RhodesApp.cpp +30 -0
  71. data/platform/shared/common/RhodesApp.h +1 -0
  72. data/platform/shared/common/map/OSMMapEngine.cpp +11 -3
  73. data/platform/shared/common/map/OSMMapEngine.h +3 -0
  74. data/platform/shared/logging/RhoLogConf.cpp +8 -9
  75. data/platform/shared/logging/RhoLogConf.h +5 -7
  76. data/platform/shared/logging/RhoLogSink.cpp +3 -3
  77. data/platform/shared/logging/RhoLogSink.h +1 -1
  78. data/platform/shared/net/HttpServer.cpp +17 -9
  79. data/platform/shared/qt/rhodes/main.cpp +1 -1
  80. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
  81. data/platform/shared/ruby/ext/webview/webview.i +9 -4
  82. data/platform/shared/ruby/ext/webview/webview_wrap.c +2 -2
  83. data/platform/shared/test/Tests.cpp +2 -2
  84. data/platform/wm/build/build_inf.js +75 -47
  85. data/platform/wm/build/wm.rake +50 -53
  86. data/platform/wm/rhodes/Rhodes.cpp +40 -97
  87. data/platform/wm/rhodes/rho/common/ExtManager.cpp +23 -1
  88. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +9 -0
  89. data/platform/wm/tools/detool/detool.cpp +103 -52
  90. data/platform/wp7/RhoRubyExtGen/RhoDateTimePicker.cs +60 -0
  91. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
  92. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +4 -4
  93. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +15 -1
  94. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +12 -2
  95. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +2 -0
  96. data/platform/wp7/RhoRubyLib/common/RhoFile.cs +3 -3
  97. data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +2 -2
  98. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +39 -24
  99. data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +8 -1
  100. data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +3 -3
  101. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +1 -1
  102. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +22 -15
  103. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
  104. data/platform/wp7/RhoRubyLib/rubyext/RhoDateTimePicker.cs +237 -0
  105. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +5 -5
  106. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml +37 -0
  107. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml.cs +59 -0
  108. data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +34 -41
  109. data/platform/wp7/rhodes/App.xaml.cs +1 -0
  110. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +18 -18
  111. data/platform/wp7/rhodes/Rhodes.csproj +5 -1
  112. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Cancel.png +0 -0
  113. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Check.png +0 -0
  114. data/rakefile.rb +77 -28
  115. data/res/build-tools/Microsoft.Phone.Controls.Toolkit.dll +0 -0
  116. data/res/build-tools/YUICompressorLicense.txt +54 -0
  117. data/res/build-tools/detool.exe +0 -0
  118. data/res/build-tools/yuicompressor-2.4.7.jar +0 -0
  119. data/res/generators/templates/application/app/layout.erb +1 -0
  120. data/res/generators/templates/application/public/js/jquery-wp7-patch.js +8 -2
  121. data/res/generators/templates/application/public/js/syncengine.js +147 -0
  122. data/spec/phone_spec/app/Data/septest.json +1 -1
  123. data/spec/phone_spec/app/spec/asynchttp_spec.rb +11 -10
  124. data/spec/phone_spec/app/spec/blobsync_spec.rb +9 -34
  125. data/spec/phone_spec/app/spec/date_spec.rb +6 -6
  126. data/spec/phone_spec/app/spec/rho_spec.rb +1 -6
  127. data/spec/phone_spec/app/spec/rhofile_spec.rb +13 -7
  128. data/spec/phone_spec/app/spec/rhom_object_spec.rb +4 -3
  129. data/spec/phone_spec/app/spec/syncengine_spec.rb +12 -14
  130. data/spec/phone_spec/app/spec_runner.rb +9 -10
  131. data/version +1 -1
  132. metadata +20 -5
  133. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +0 -15
@@ -529,10 +529,11 @@ public class SimpleMainView implements MainView {
529
529
  // webView = v.detachWebView();
530
530
  if (webView == null) {
531
531
  if (Capabilities.WEBKIT_BROWSER_ENABLED) {
532
+ Logger.D(TAG, "Creating Motorola WebKIT view");
532
533
  try {
533
534
  Class<? extends IRhoWebView> viewClass = (Class<? extends IRhoWebView>)Class.forName("com.rhomobile.rhodes.webview.EkiohWebView");
534
- Constructor<? extends IRhoWebView> viewCtor = viewClass.getConstructor(Activity.class);
535
- webView = viewCtor.newInstance(activity);
535
+ Constructor<? extends IRhoWebView> viewCtor = viewClass.getConstructor(Context.class, Runnable.class);
536
+ webView = viewCtor.newInstance(activity, RhodesApplication.AppState.AppStarted.addObserver("MotorolaStartEngineObserver", true));
536
537
  } catch (Throwable e) {
537
538
  Logger.E(TAG, e);
538
539
  RhodesApplication.stop();
@@ -27,13 +27,9 @@
27
27
  package com.rhomobile.rhodes.signature;
28
28
 
29
29
  import java.io.File;
30
- import java.util.Enumeration;
31
30
  import java.util.Map;
32
- import java.util.Vector;
33
31
 
34
32
  import android.content.Intent;
35
- import android.text.method.HideReturnsTransformationMethod;
36
- import android.view.View;
37
33
  import android.view.ViewGroup;
38
34
  import android.webkit.WebView;
39
35
  import android.widget.AbsoluteLayout;
@@ -47,12 +43,13 @@ import com.rhomobile.rhodes.util.ContextFactory;
47
43
  import com.rhomobile.rhodes.util.PerformOnUiThread;
48
44
  import com.rhomobile.rhodes.util.Utils;
49
45
 
46
+ import com.rhomobile.rhodes.extmanager.AbstractRhoExtension;
50
47
  import com.rhomobile.rhodes.extmanager.IRhoExtData;
51
48
  import com.rhomobile.rhodes.extmanager.IRhoExtension;
52
49
  import com.rhomobile.rhodes.extmanager.IRhoExtManager;
53
- import com.rhomobile.rhodes.extmanager.RhoExtManagerSingleton;
50
+ import com.rhomobile.rhodes.extmanager.RhoExtManager;
54
51
 
55
- public class Signature implements IRhoExtension {
52
+ public class Signature extends AbstractRhoExtension implements IRhoExtension {
56
53
 
57
54
  static final String TAG = "Signature";
58
55
 
@@ -89,7 +86,7 @@ public class Signature implements IRhoExtension {
89
86
 
90
87
  public void run() {
91
88
  init();
92
- RhodesActivity ra = RhodesActivity.getInstance();
89
+ RhodesActivity ra = RhodesActivity.safeGetInstance();
93
90
  Intent intent = new Intent(ra, klass);
94
91
  intent.putExtra(INTENT_EXTRA_PREFIX + "callback", getSharedInstance().mProperties.callbackUrl);
95
92
  intent.putExtra(INTENT_EXTRA_PREFIX + "imageFormat", getSharedInstance().mProperties.imageFormat);
@@ -143,9 +140,13 @@ public class Signature implements IRhoExtension {
143
140
  callback(callbackUrl, fp, "", fp.length() == 0);
144
141
  }
145
142
 
146
- public static void inline_signature_visible(int visible, Object params) {
147
- if (visible == 0) {
148
- inline_signature_hide();
143
+ public static void inline_signature_visible(int visible, Object params) {
144
+ inlineSignatureVisible(RhoExtManager.getInstance(), (visible != 0), params);
145
+ }
146
+
147
+ public static void inlineSignatureVisible(final IRhoExtManager extManager, boolean visible, Object params) {
148
+ if (!visible) {
149
+ inlineSignatureHide(extManager);
149
150
  return;
150
151
  }
151
152
 
@@ -155,7 +156,7 @@ public class Signature implements IRhoExtension {
155
156
  public void run() {
156
157
  reportMsg(" $$$ Start make of Signature View");
157
158
 
158
- ViewGroup wv = (WebView)RhodesService.getInstance().getMainView().getWebView(-1).getView();
159
+ ViewGroup wv = (ViewGroup)extManager.getWebView();
159
160
  if ((wv != null) && (ourInlineSignatureView != null)) {
160
161
  wv.removeView(ourInlineSignatureView);
161
162
  ourInlineSignatureView = null;
@@ -196,10 +197,14 @@ public class Signature implements IRhoExtension {
196
197
  if (ourInlineSignatureView != null) {
197
198
  ImageCapture.takeSignature(callback_url, getSharedInstance().mProperties.imageFormat, ourInlineSignatureView.makeBitmap());
198
199
  }
199
- inline_signature_hide();
200
+ inlineSignatureHide(RhoExtManager.getInstance());
200
201
  }
201
202
 
202
203
  public static void inline_signature_clear() {
204
+ inlineSignatureClear(RhoExtManager.getInstance());
205
+ }
206
+
207
+ public static void inlineSignatureClear(IRhoExtManager extmanager) {
203
208
  PerformOnUiThread.exec( new Runnable () {
204
209
  public void run() {
205
210
  if (ourInlineSignatureView != null) {
@@ -215,11 +220,11 @@ public class Signature implements IRhoExtension {
215
220
  });
216
221
  }
217
222
 
218
- public static void inline_signature_hide() {
223
+ public static void inlineSignatureHide(final IRhoExtManager extManager) {
219
224
  PerformOnUiThread.exec( new Runnable () {
220
225
  public void run() {
221
226
  if (ourInlineSignatureView != null) {
222
- ViewGroup wv = (WebView)RhodesService.getInstance().getMainView().getWebView(-1).getView();
227
+ ViewGroup wv = (ViewGroup)extManager.getWebView();
223
228
  if (wv != null) {
224
229
  wv.removeView(ourInlineSignatureView);
225
230
  ourInlineSignatureView = null;
@@ -230,11 +235,12 @@ public class Signature implements IRhoExtension {
230
235
  }
231
236
 
232
237
  @Override
233
- public void onBeforeNavigate(String url, IRhoExtData data) {
234
- inline_signature_hide();
238
+ public void onBeforeNavigate(IRhoExtManager extManager, String url, IRhoExtData data) {
239
+ inlineSignatureHide(extManager);
235
240
  }
236
241
 
237
- public void onSetProperty(String name, String value, IRhoExtData data) {
242
+ @Override
243
+ public void onSetProperty(IRhoExtManager extManager, String name, String value, IRhoExtData data) {
238
244
  if ((name == null) || (value == null)) {
239
245
  return;
240
246
  }
@@ -242,16 +248,16 @@ public class Signature implements IRhoExtension {
242
248
  if ("Visibility".equalsIgnoreCase(name)) {
243
249
  if ("Visible".equalsIgnoreCase(value)) {
244
250
  // show
245
- inline_signature_visible(1, null);
251
+ inlineSignatureVisible(extManager, true, null);
246
252
  }
247
253
  else {
248
254
  // hide;
249
- inline_signature_hide();
255
+ inlineSignatureHide(extManager);
250
256
  }
251
257
  }
252
258
  else if ("Clear".equalsIgnoreCase(name)) {
253
259
  // clear
254
- inline_signature_clear();
260
+ inlineSignatureClear(extManager);
255
261
  }
256
262
  }
257
263
 
@@ -264,43 +270,11 @@ public class Signature implements IRhoExtension {
264
270
  }
265
271
 
266
272
  public static void registerSignatureCaptureExtension() {
267
- RhoExtManagerSingleton.getRhoExtManagerInstance().registerExtension(SIGNATURE_EXT, getSharedInstance());
273
+ RhoExtManager.getInstance().registerExtension(SIGNATURE_EXT, getSharedInstance());
268
274
  }
269
275
 
270
276
  public static native void callback(String callbackUrl, String filePath, String error, boolean cancelled);
271
277
 
272
- @Override
273
- public void onSetPropertiesData(String propId, String data, IRhoExtData ext) {
274
- // Nothing
275
- }
276
-
277
- @Override
278
- public void onNavigateComplete(String urlBeingNavigatedTo, IRhoExtData ext) {
279
- }
280
-
281
- @Override
282
- public void onDocumentComplete(String urlOfDocument, IRhoExtData ext) {
283
- }
284
-
285
- @Override
286
- public long onNavigateTimeout(String urlBeingNavigatedTo, IRhoExtData ext) {
287
- // TODO Auto-generated method stub
288
- return 0;
289
- }
290
-
291
- @Override
292
- public long onSIPState(boolean bSIPState, IRhoExtData ext) {
293
- return 0;
294
- }
295
-
296
- @Override
297
- public long onNavigateError(String urlBeingNavigatedTo, IRhoExtData ext) {
298
- return 0;
299
- }
300
-
301
- @Override
302
- public void onAppActivate(boolean bActivate, IRhoExtData ext) {
303
- }
304
278
  }
305
279
 
306
280
 
@@ -198,7 +198,28 @@ class SignatureView extends SurfaceView implements SurfaceHolder.Callback {
198
198
  }
199
199
  }
200
200
  }
201
-
201
+ {
202
+ PointSequence ps = mCurrentSequence;
203
+ if ((ps != null) && (ps.mPoints != null)) {
204
+ for (p = 1; p < ps.mPoints.size(); p++) {
205
+ PointF prev = ps.mPoints.elementAt(p-1);
206
+ PointF cur = ps.mPoints.elementAt(p);
207
+ if ((prev != null) && (cur != null)) {
208
+ canvas.drawLine(prev.x, prev.y, cur.x, cur.y, mPaint);
209
+ }
210
+ }
211
+ }
212
+ else {
213
+ if (ps == null) {
214
+ //Logger.D(TAG, "################## ps == null !");
215
+ }
216
+ else {
217
+ if (ps.mPoints == null) {
218
+ //Logger.D(TAG, "################## ps.mPoints == null !");
219
+ }
220
+ }
221
+ }
222
+ }
202
223
  // update screen
203
224
  if (redrawOnScreen && (!isTransparency)) {
204
225
  Canvas c = null;
@@ -335,14 +356,17 @@ class SignatureView extends SurfaceView implements SurfaceHolder.Callback {
335
356
  mCurrentSequence.mPoints.add(new PointF(x,y));
336
357
  break;
337
358
  case MotionEvent.ACTION_MOVE:
338
- doDrawSegment(mX,mY, x,y);
359
+ //doDrawSegment(mX,mY, x,y);
339
360
  mCurrentSequence.mPoints.add(new PointF(x,y));
361
+ doFullRedraw(mCanvas, mBitmap, true, true);
362
+ invalidate();
340
363
  break;
341
364
  case MotionEvent.ACTION_UP:
342
- doDrawSegment(mX,mY, x,y);
365
+ //doDrawSegment(mX,mY, x,y);
343
366
  mCurrentSequence.mPoints.add(new PointF(x,y));
344
367
  mSequences.add(mCurrentSequence);
345
368
  mCurrentSequence = new PointSequence();
369
+ doFullRedraw(mCanvas, mBitmap, true, true);
346
370
  break;
347
371
  }
348
372
 
@@ -40,8 +40,6 @@ public class Utils {
40
40
 
41
41
  public static class FileSource {
42
42
 
43
- public FileSource() {}
44
-
45
43
  String[] list(String dir) throws IOException {
46
44
  return new File(dir).list();
47
45
  }
@@ -136,24 +134,25 @@ public class Utils {
136
134
  }
137
135
  }
138
136
 
139
- public static void copyRecursively(FileSource fs, String source, File target, boolean remove) throws IOException
137
+ public static void copyRecursively(FileSource fs, File source, File target, boolean deleteTarget) throws IOException
140
138
  {
141
- if (remove && target.exists())
139
+ if (deleteTarget && target.exists())
142
140
  deleteRecursively(target);
143
141
 
144
- String[] children = fs.list(source);
145
- if (children != null && children.length > 0) {
146
- if (!target.exists())
147
- target.mkdirs();
148
-
149
- for(int i = 0; i != children.length; ++i)
150
- copyRecursively(fs, source + "/" + children[i], new File(target, children[i]), false);
151
- }
152
- else {
142
+ if (source.isDirectory()) {
143
+ String[] children = fs.list(source.getAbsolutePath());
144
+ if (children != null && children.length > 0) {
145
+ if (!target.exists())
146
+ target.mkdirs();
147
+
148
+ for(String child: children)
149
+ copyRecursively(fs, new File(source, child), new File(target, child), false);
150
+ }
151
+ } else if (source.isFile()){
153
152
  InputStream in = null;
154
153
  OutputStream out = null;
155
154
  try {
156
- in = fs.open(source);
155
+ in = fs.open(source.getAbsolutePath());
157
156
  target.getParentFile().mkdirs();
158
157
  out = new FileOutputStream(target);
159
158
 
@@ -30,7 +30,7 @@ import com.rhomobile.rhodes.Logger;
30
30
  import com.rhomobile.rhodes.RhoConf;
31
31
  import com.rhomobile.rhodes.RhodesActivity;
32
32
  import com.rhomobile.rhodes.RhodesService;
33
- import com.rhomobile.rhodes.extmanager.RhoExtManagerSingleton;
33
+ import com.rhomobile.rhodes.extmanager.RhoExtManager;
34
34
 
35
35
  import android.graphics.Bitmap;
36
36
  import android.net.http.SslError;
@@ -51,14 +51,14 @@ public class RhoWebViewClient extends WebViewClient
51
51
 
52
52
  @Override
53
53
  public void onPageStarted(WebView view, String url, Bitmap favicon) {
54
-
55
- RhoExtManagerSingleton.getRhoExtManagerInstance().onBeforeNavigate(url);
54
+ super.onPageStarted(view, url, favicon);
56
55
 
57
56
  if (RhodesActivity.ENABLE_LOADING_INDICATION)
58
57
  RhodesActivity.safeGetInstance().getWindow().setFeatureInt(Window.FEATURE_PROGRESS, 0);
59
58
  else
60
59
  RhodesActivity.safeGetInstance().getWindow().setFeatureInt(Window.FEATURE_PROGRESS, RhodesActivity.MAX_PROGRESS);
61
- super.onPageStarted(view, url, favicon);
60
+
61
+ RhoExtManager.getImplementationInstance().onBeforeNavigate(view, url);
62
62
  }
63
63
 
64
64
  @Override
@@ -69,11 +69,18 @@ public class RhoWebViewClient extends WebViewClient
69
69
  RhodesActivity.safeGetInstance().getWindow().setFeatureInt(
70
70
  Window.FEATURE_PROGRESS, RhodesActivity.MAX_PROGRESS);
71
71
 
72
+ RhoExtManager.getImplementationInstance().onLoadEnd(view, url, 0, 0);
73
+
72
74
  super.onPageFinished(view, url);
73
75
  }
74
76
 
75
- public void onReceivedError(android.webkit.WebView view, int errorCode, java.lang.String description, java.lang.String failingUrl)
77
+ @Override
78
+ public void onReceivedError(WebView view, int errorCode, String description, String failingUrl)
76
79
  {
80
+ super.onReceivedError(view, errorCode, description, failingUrl);
81
+
82
+ RhoExtManager.getImplementationInstance().onLoadError(view);
83
+
77
84
  StringBuilder msg = new StringBuilder(failingUrl);
78
85
  msg.append(" failed: ");
79
86
  msg.append(errorCode);
@@ -98,12 +98,13 @@ platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java
98
98
  platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java
99
99
  platform/android/Rhodes/src/com/rhomobile/rhodes/webview/IRhoWebView.java
100
100
  platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java
101
+ platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java
101
102
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java
102
103
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java
103
104
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java
104
105
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java
105
106
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java
106
- platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java
107
+ platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java
107
108
  platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java
108
109
  platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java
109
110
  platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality02.java
@@ -337,11 +337,17 @@ namespace "config" do
337
337
  end
338
338
 
339
339
  task :android => :set_android_platform do
340
-
340
+
341
341
  Rake::Task["config:common"].invoke
342
342
 
343
343
  $java = $config["env"]["paths"]["java"]
344
344
 
345
+ $neon_root = nil
346
+ $neon_root = $config["env"]["paths"]["neon"] unless $config["env"]["paths"].nil?
347
+ if !($app_config["paths"].nil? or $app_config["paths"]["neon"].nil?)
348
+ $neon_root = $app_config["paths"]["neon"]
349
+ end
350
+
345
351
  $androidsdkpath = $config["env"]["paths"]["android"]
346
352
  unless File.exists? $androidsdkpath
347
353
  puts "Missing or invalid 'android' section in rhobuild.yml: '#{$androidsdkpath}'"
@@ -580,7 +586,8 @@ namespace "config" do
580
586
  $use_google_addon_api = true unless $app_config["capabilities"].index("push").nil?
581
587
 
582
588
  unless $app_config['capabilities'].index('motorola').nil? and $app_config['capabilities'].index('motoroladev').nil?
583
- $use_motosol_barcode_api = true if $app_config['extensions'].index('barcode') or $app_config['extensions'].index('barcode-moto')
589
+ $use_motosol_barcode_api = true #if $app_config['extensions'].index('barcode') or $app_config['extensions'].index('barcode-moto')
590
+ $use_motosol_api_classpath = true unless $app_config['capabilities'].index('motoroladev').nil?
584
591
  raise 'Cannot use Motorola SDK addon and Google SDK addon together!' if $use_google_addon_api
585
592
  end
586
593
 
@@ -592,7 +599,7 @@ namespace "config" do
592
599
  end
593
600
 
594
601
  # Look for Motorola barcode SDK addon
595
- if $use_motosol_barcode_api
602
+ if $use_motosol_api_classpath
596
603
  Dir.glob(File.join($androidsdkpath, 'add-ons', '*')).each do |dir|
597
604
  apijar = File.join(dir, 'libs', 'com.motorolasolutions.scanner.jar')
598
605
  if File.exists? apijar
@@ -748,27 +755,41 @@ namespace "build" do
748
755
  end
749
756
 
750
757
  end
751
- # desc "Build RhoBundle for android"
752
- task :rhobundle => ["config:android","build:bundle:noxruby",:extensions] do
753
- # Rake::Task["build:bundle:noxruby"].execute
754
758
 
755
- assets = File.join(Jake.get_absolute($androidpath), "Rhodes", "assets")
759
+ desc "Build RhoBundle for android"
760
+ task :rhobundle => ["config:android", :extensions] do
761
+
762
+ Rake::Task["build:bundle:noxruby"].invoke
763
+
764
+ #assets = File.join(Jake.get_absolute($androidpath), "Rhodes", "assets")
765
+ assets = File.join $tmpdir, 'assets'
756
766
  rm_rf assets
757
767
  mkdir_p assets
758
768
  hash = nil
759
769
  ["apps", "db", "lib"].each do |d|
760
770
  cp_r File.join($srcdir, d), assets, :preserve => true
761
771
  # Calculate hash of directories
762
- hash = get_dir_hash(File.join(assets, d), hash)
772
+ hash = get_dir_hash(File.join($srcdir, d), hash)
773
+ end
774
+ File.open(File.join($srcdir, "hash"), "w") { |f| f.write(hash.hexdigest) }
775
+ File.open(File.join($srcdir, "name"), "w") { |f| f.write($appname) }
776
+ Jake.build_file_map($srcdir, "rho.dat")
777
+
778
+ ["apps", "db", "lib", "hash", "name", "rho.dat"].each do |d|
779
+ cp_r File.join($srcdir, d), assets, :preserve => true
763
780
  end
764
- File.open(File.join(assets, "hash"), "w") { |f| f.write(hash.hexdigest) }
765
781
 
766
- File.open(File.join(assets, "name"), "w") { |f| f.write($appname) }
767
-
768
- Jake.build_file_map(assets, "rho.dat")
769
782
  end
770
783
 
771
- task :extensions => :genconfig do
784
+ desc "Build RhoBundle for Eclipse project"
785
+ task :eclipsebundle => "build:android:rhobundle" do
786
+ assets = File.join $tmpdir, 'assets'
787
+ eclipse_assets = File.join(Jake.get_absolute($androidpath), "Rhodes", "assets")
788
+ rm_rf eclipse_assets
789
+ cp_r assets, eclipse_assets, :preserve => true
790
+ end
791
+
792
+ task :extensions => ["config:android", :genconfig] do
772
793
 
773
794
  ENV['RHO_PLATFORM'] = 'android'
774
795
  ENV["ANDROID_NDK"] = $androidndkpath
@@ -778,6 +799,7 @@ namespace "build" do
778
799
  ENV["BUILD_DIR"] ||= $startdir + "/platform/android/build"
779
800
  ENV["RHO_INC"] = $appincdir
780
801
  ENV["RHO_ANDROID_TMP_DIR"] = $tmpdir
802
+ ENV["NEON_ROOT"] = $neon_root unless $neon_root.nil?
781
803
 
782
804
  ext_build_files = File.join($extensionsdir, "ext_build.files")
783
805
  if File.exist? ext_build_files
@@ -1460,8 +1482,19 @@ namespace "build" do
1460
1482
  end
1461
1483
  end
1462
1484
 
1485
+ task :upgrade_package => :rhobundle do
1486
+ #puts '$$$$$$$$$$$$$$$$$$'
1487
+ #puts 'targetdir = '+$targetdir.to_s
1488
+ #puts 'bindir = '+$bindir.to_s
1489
+ android_targetdir = File.join($targetdir, 'android')
1490
+ mkdir_p android_targetdir if not File.exists? android_targetdir
1491
+ zip_file_path = File.join(android_targetdir, 'upgrade_bundle.zip')
1492
+ Jake.build_file_map(File.join($srcdir, "apps"), "rhofilelist.txt")
1493
+ Jake.zip_upgrade_bundle($bindir, zip_file_path)
1494
+ end
1495
+
1463
1496
  #desc "build all"
1464
- task :all => [:rhobundle, :rhodes]
1497
+ task :all => ['build:android:rhobundle', :rhodes]
1465
1498
  end
1466
1499
  end
1467
1500
 
@@ -1482,7 +1515,7 @@ namespace "package" do
1482
1515
 
1483
1516
  manifest = $appmanifest
1484
1517
  resource = $appres
1485
- assets = Jake.get_absolute $androidpath + "/Rhodes/assets"
1518
+ assets = File.join($tmpdir, 'assets')
1486
1519
  resourcepkg = $bindir + "/rhodes.ap_"
1487
1520
 
1488
1521
  puts "Packaging Assets and Jars"
@@ -1498,8 +1531,6 @@ namespace "package" do
1498
1531
  end
1499
1532
 
1500
1533
  # Workaround: manually add files starting with '_' because aapt silently ignore such files when creating package
1501
- rm_rf File.join($tmpdir, "assets")
1502
- cp_r assets, $tmpdir
1503
1534
  Dir.glob(File.join($tmpdir, "assets/**/*")).each do |f|
1504
1535
  next unless File.basename(f) =~ /^_/
1505
1536
  relpath = Pathname.new(f).relative_path_from(Pathname.new($tmpdir)).to_s