rhodes 3.0.0 → 3.0.1.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/CHANGELOG +4 -0
  2. data/Rakefile +9 -2
  3. data/doc/application.txt +1 -1
  4. data/doc/build.txt +49 -70
  5. data/doc/device-caps.txt +22 -97
  6. data/doc/extensions.txt +1 -1
  7. data/doc/nfc.txt +542 -0
  8. data/doc/rhom.txt +7 -5
  9. data/doc/simulator.txt +116 -0
  10. data/doc/ui.txt +1 -1
  11. data/lib/build/jake.rb +5 -5
  12. data/lib/extensions/debugger/debugger.rb +63 -35
  13. data/lib/extensions/nfc/ext/nfc/platform/android/AndroidManifest.xml +8 -6
  14. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +1070 -249
  15. data/lib/extensions/nfc/ext/nfc/platform/android/res/xml/filter_nfc.xml +1 -5
  16. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +894 -72
  17. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcActivity.java +82 -18
  18. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcMessage.java +65 -0
  19. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcRecord.java +88 -24
  20. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java +3 -0
  21. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i +204 -3
  22. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +1047 -5
  23. data/lib/extensions/nfc/nfc.rb +635 -91
  24. data/lib/extensions/rhoxml/rexml/encodings/CP-1252.rb +103 -0
  25. data/lib/extensions/rhoxml/rexml/encodings/ISO-8859-1.rb +7 -0
  26. data/lib/framework/dateME.rb +26 -0
  27. data/lib/framework/rho/render.rb +21 -9
  28. data/lib/framework/rho/rho.rb +12 -0
  29. data/lib/framework/rho/rhoevent_bb.rb +3 -0
  30. data/lib/framework/rho/rhoevent_c.rb +3 -0
  31. data/lib/framework/rhodes.rb +1 -1
  32. data/lib/framework/rhom/rhom_db_adapter.rb +9 -9
  33. data/lib/framework/rhosystem.rb +17 -0
  34. data/lib/framework/stringio.rb +18 -0
  35. data/lib/framework/version.rb +1 -1
  36. data/lib/rhodes.rb +1 -1
  37. data/platform/android/Rhodes/AndroidManifest.xml +2 -2
  38. data/platform/android/Rhodes/res/xml/filter_nfc.xml +1 -5
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +0 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +10 -6
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +29 -18
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +67 -12
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +14 -0
  44. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +102 -28
  45. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +35 -66
  46. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +5 -5
  47. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +69 -41
  48. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +7 -5
  49. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +68 -35
  50. data/platform/android/build/RhodesSRC_build.files +1 -0
  51. data/platform/android/build/android.rake +2 -2
  52. data/platform/bb/RubyVM/src/com/rho/RhoConf.java +1 -0
  53. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +18 -6
  54. data/platform/bb/build/bb.rake +1 -1
  55. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +5 -4
  56. data/platform/iphone/Classes/SimpleMainView.m +1 -1
  57. data/platform/iphone/Info.plist +1 -1
  58. data/platform/shared/common/RhodesApp.cpp +9 -3
  59. data/platform/shared/curl/lib/rhossl.c +5 -2
  60. data/platform/shared/db/DBAdapter.cpp +9 -0
  61. data/platform/shared/net/CURLNetRequest.cpp +8 -3
  62. data/platform/shared/net/iphone/sslimpl.cpp +3 -2
  63. data/platform/shared/net/ssl.cpp +8 -0
  64. data/platform/shared/ruby/ext/rho/rhoruby.c +10 -0
  65. data/platform/shared/ruby/ext/rho/rhoruby.h +1 -0
  66. data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +3 -4
  67. data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
  68. data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
  69. data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
  70. data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
  71. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  72. data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
  73. data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
  74. data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
  75. data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
  76. data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
  77. data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
  78. data/platform/win32/RhoSimulator/libeay32.dll +0 -0
  79. data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
  80. data/platform/wm/build/wm.rake +27 -3
  81. data/platform/wm/rhodes/Rhodes.cpp +4 -0
  82. data/platform/wm/rhodes/emulator/MainWindowCallback.h +1 -0
  83. data/platform/wm/rhodes/emulator/MainWindowProxy.cpp +3 -1
  84. data/platform/wm/rhodes/emulator/MainWindowQt.cpp +23 -12
  85. data/platform/wm/rhodes/emulator/MainWindowQt.h +5 -1
  86. data/platform/wm/rhodes/emulator/QtMainWindow.cpp +39 -6
  87. data/platform/wm/rhodes/emulator/QtMainWindow.h +1 -1
  88. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +5 -0
  89. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/IronRuby.Libraries.dll +0 -0
  90. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/IronRuby.dll +0 -0
  91. data/platform/wp7/IronRuby/bin/Silverlight3Release/Microsoft.Dynamic.dll +0 -0
  92. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/Microsoft.Scripting.Core.dll +0 -0
  93. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/Microsoft.Scripting.dll +0 -0
  94. data/platform/wp7/RhoAppRunner/Program.cs +2 -2
  95. data/platform/wp7/RhoRubyLib/RhoRuby.cs +8 -0
  96. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +29 -7
  97. data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +5 -2
  98. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +12 -0
  99. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +2 -0
  100. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
  101. data/platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs +52 -7
  102. data/platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs +85 -18
  103. data/platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs +38 -3
  104. data/platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs +27 -2
  105. data/platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs +111 -15
  106. data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +330 -55
  107. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +61 -4
  108. data/platform/wp7/build/wp.rake +89 -72
  109. data/platform/wp7/rhodes/App.xaml.cs +1 -1
  110. data/rakefile.rb +9 -2
  111. data/rhodes.gemspec +1 -3
  112. data/spec/phone_spec/app/spec/asynchttp_spec.rb +7 -9
  113. data/spec/phone_spec/app/spec/uri_spec.rb +75 -0
  114. data/spec/phone_spec/app/spec_runner.rb +4 -0
  115. metadata +21 -15
  116. data/Manifest.txt +0 -6403
  117. data/platform/win32/RhoSimulator/codecs/qcncodecs4.dll +0 -0
  118. data/platform/win32/RhoSimulator/codecs/qjpcodecs4.dll +0 -0
  119. data/platform/win32/RhoSimulator/codecs/qkrcodecs4.dll +0 -0
  120. data/platform/win32/RhoSimulator/codecs/qtwcodecs4.dll +0 -0
  121. data/platform/wp7/IronRuby/Bin/Silverlight3Release/Microsoft.Dynamic.dll +0 -0
@@ -90,7 +90,7 @@ public class WebView {
90
90
 
91
91
  public static void navigate(String url, int index) {
92
92
  try {
93
- PerformOnUiThread.exec(new NavigateTask(url, index), false);
93
+ PerformOnUiThread.exec(new NavigateTask(url, index));
94
94
  }
95
95
  catch (Exception e) {
96
96
  reportFail("navigate", e);
@@ -99,7 +99,7 @@ public class WebView {
99
99
 
100
100
  public static void navigateBack() {
101
101
  try {
102
- PerformOnUiThread.exec(new NavigateBackTask(activeTab()), false);
102
+ PerformOnUiThread.exec(new NavigateBackTask(activeTab()));
103
103
  }
104
104
  catch (Exception e) {
105
105
  reportFail("navigateBack", e);
@@ -108,7 +108,7 @@ public class WebView {
108
108
 
109
109
  public static void refresh(int index) {
110
110
  try {
111
- PerformOnUiThread.exec(new RefreshTask(index), false);
111
+ PerformOnUiThread.exec(new RefreshTask(index));
112
112
  }
113
113
  catch (Exception e) {
114
114
  reportFail("refresh", e);
@@ -129,7 +129,7 @@ public class WebView {
129
129
 
130
130
  public static void executeJs(String js, int index) {
131
131
  try {
132
- PerformOnUiThread.exec(new NavigateTask("javascript:" + js, index), false);
132
+ PerformOnUiThread.exec(new NavigateTask("javascript:" + js, index));
133
133
  }
134
134
  catch (Exception e) {
135
135
  reportFail("executeJs", e);
@@ -138,7 +138,7 @@ public class WebView {
138
138
 
139
139
  public static void setCookie(String url, String cookie) {
140
140
  try {
141
- PerformOnUiThread.exec(new SetCookieTask(url, cookie), false);
141
+ PerformOnUiThread.exec(new SetCookieTask(url, cookie));
142
142
  }
143
143
  catch (Exception e) {
144
144
  reportFail("setCookie", e);
@@ -29,6 +29,7 @@ import android.os.Vibrator;
29
29
 
30
30
  import com.rhomobile.rhodes.Capabilities;
31
31
  import com.rhomobile.rhodes.Logger;
32
+ import com.rhomobile.rhodes.RhodesApplication;
32
33
  import com.rhomobile.rhodes.RhodesService;
33
34
  import com.rhomobile.rhodes.file.RhoFileApi;
34
35
  import com.rhomobile.rhodes.util.PerformOnUiThread;
@@ -43,48 +44,75 @@ public class Alert {
43
44
  Logger.E(TAG, "Call of \"" + name + "\" failed: " + e.getMessage());
44
45
  }
45
46
 
46
- public static void showPopup(final Object params) {
47
- try {
48
- Logger.T(TAG, "showPopup");
49
- PerformOnUiThread.exec(new Runnable() {
50
- public void run() {
51
- PopupActivity.showDialog(params);
52
- }
53
- }, false);
54
- }
55
- catch (Exception e) {
56
- reportFail("showPopup", e);
57
- }
58
- }
59
-
60
- public static void hidePopup() {
61
- try {
62
- Logger.T(TAG, "hidePopup");
63
- PerformOnUiThread.exec(new Runnable() {
64
- public void run() {
65
- PopupActivity.hidePopup();
66
- }
67
- }, false);
68
- }
69
- catch (Exception e) {
70
- reportFail("hidePopup", e);
71
- }
72
- }
47
+ public static void showPopup(final Object params) {
48
+ RhodesApplication.runWhen(
49
+ RhodesApplication.AppState.AppActivated,
50
+ new RhodesApplication.StateHandler(true) {
51
+ @Override
52
+ public void run() {
53
+ try {
54
+ Logger.T(TAG, "showPopup");
55
+ //PerformOnUiThread.exec(new Runnable() {
56
+ // @Override
57
+ // public void run() {
58
+ PopupActivity.showDialog(params);
59
+ // }
60
+ //});
61
+ }
62
+ catch (Exception e) {
63
+ reportFail("showPopup", e);
64
+ setError(e);
65
+ }
66
+ }
67
+ });
68
+ }
69
+
70
+ public static void hidePopup() {
71
+ RhodesApplication.runWhen(
72
+ RhodesApplication.AppState.AppActivated,
73
+ new RhodesApplication.StateHandler(true) {
74
+ @Override
75
+ public void run() {
76
+ try {
77
+ Logger.T(TAG, "hidePopup");
78
+ //PerformOnUiThread.exec(new Runnable() {
79
+ // @Override
80
+ // public void run() {
81
+ PopupActivity.hidePopup();
82
+ // }
83
+ //});
84
+ }
85
+ catch (Exception e) {
86
+ reportFail("hidePopup", e);
87
+ setError(e);
88
+ }
89
+ }
90
+ });
91
+ }
92
+
93
+ public static void showStatusPopup(final String title, final String message, final String hide) {
94
+ RhodesApplication.runWhen(
95
+ RhodesApplication.AppState.AppActivated,
96
+ new RhodesApplication.StateHandler(true) {
97
+ @Override
98
+ public void run() {
99
+ try {
100
+ Logger.I(TAG, "showStatusPopup");
101
+ //PerformOnUiThread.exec(new Runnable() {
102
+ // @Override
103
+ // public void run() {
104
+ PopupActivity.showStatusDialog(title, message, hide);
105
+ // }
106
+ //});
107
+ }
108
+ catch (Exception e) {
109
+ reportFail("showStatusPopup", e);
110
+ setError(e);
111
+ }
112
+ }
113
+ });
114
+ }
73
115
 
74
- public static void showStatusPopup(final String title, final String message, final String hide) {
75
- try {
76
- Logger.I(TAG, "showStatusPopup");
77
- PerformOnUiThread.exec(new Runnable() {
78
- public void run() {
79
- PopupActivity.showStatusDialog(title, message, hide);
80
- }
81
- }, false);
82
- }
83
- catch (Exception e) {
84
- reportFail("showStatusPopup", e);
85
- }
86
- }
87
-
88
116
  public static void vibrate(int duration) {
89
117
  try {
90
118
  if (!Capabilities.VIBRATE_ENABLED)
@@ -160,9 +160,11 @@ public class PopupActivity extends Activity {
160
160
  createDialog(title, message, icon, buttons, callback);
161
161
  }
162
162
 
163
- private void createDialog(String title, String message, Drawable icon, Vector<CustomButton> buttons, String callback) {
163
+ synchronized private void createDialog(String title, String message, Drawable icon, Vector<CustomButton> buttons, String callback) {
164
164
  Context ctx = this;
165
165
 
166
+ Logger.T(TAG, "Creating dialog{ title: " + title + ", message: " + message + ", buttons cnt: " + buttons.size() + ", callback: " + callback);
167
+
166
168
  int nTopPadding = 10;
167
169
 
168
170
  Dialog dialog = new Dialog(ctx);
@@ -250,7 +252,7 @@ public class PopupActivity extends Activity {
250
252
  }
251
253
 
252
254
  @SuppressWarnings("unchecked")
253
- public static void showDialog(Context ctx, Object params) {
255
+ public static void showDialog(RhodesService ctx, Object params) {
254
256
  String title = "";
255
257
  String message = null;
256
258
  String icon = null;
@@ -316,7 +318,7 @@ public class PopupActivity extends Activity {
316
318
  }
317
319
 
318
320
  Intent intent = new Intent(ctx, PopupActivity.class);
319
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION);
321
+ //intent.addFlags(/*Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION*/);
320
322
  intent.putExtra(INTENT_EXTRA_PREFIX + ".title", title);
321
323
  intent.putExtra(INTENT_EXTRA_PREFIX + ".message", message);
322
324
  intent.putExtra(INTENT_EXTRA_PREFIX + ".icon", icon);
@@ -337,7 +339,7 @@ public class PopupActivity extends Activity {
337
339
  }
338
340
 
339
341
  Intent intent = new Intent(ctx, PopupActivity.class);
340
- intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION);
342
+ //intent.addFlags(/*Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION*/);
341
343
  intent.putExtra(INTENT_EXTRA_PREFIX + ".title", title);
342
344
  intent.putExtra(INTENT_EXTRA_PREFIX + ".message", message);
343
345
  intent.putExtra(INTENT_EXTRA_PREFIX + ".buttons.ids", new String[] {hide});
@@ -345,7 +347,7 @@ public class PopupActivity extends Activity {
345
347
  ctx.startActivity(intent);
346
348
  }
347
349
 
348
- public static void hidePopup() {
350
+ public synchronized static void hidePopup() {
349
351
  if (currentAlert == null)
350
352
  return;
351
353
  currentAlert.dismiss();
@@ -2,6 +2,7 @@ package com.rhomobile.rhodes.util;
2
2
 
3
3
  import com.rhomobile.rhodes.Logger;
4
4
  import com.rhomobile.rhodes.RhodesActivity;
5
+ import com.rhomobile.rhodes.RhodesApplication;
5
6
 
6
7
  public class PerformOnUiThread implements Runnable {
7
8
 
@@ -27,39 +28,71 @@ public class PerformOnUiThread implements Runnable {
27
28
  }
28
29
  }
29
30
 
30
- public static void exec(Runnable r, int delay) {
31
- try {
32
- RhodesActivity ra = RhodesActivity.getInstance();
33
- ra.post(r, delay);
34
- }
35
- catch (Exception e) {
36
- Logger.E(TAG, "exec failed: " + e.getMessage());
37
- }
38
- }
39
-
40
- public static void exec(Runnable r, boolean wait) {
41
- try {
42
- RhodesActivity ra = RhodesActivity.getInstance();
43
- if (!wait) {
44
- ra.post(r);
45
- }
46
- else {
47
- long thrId = Thread.currentThread().getId();
48
- if (ra.getUiThreadId() == thrId) {
49
- // We are already in UI thread
50
- r.run();
51
- }
52
- else {
53
- // Post request to UI thread and wait when it would be done
54
- synchronized (r) {
55
- ra.post(new PerformOnUiThread(r));
56
- r.wait();
57
- }
58
- }
59
- }
60
- }
61
- catch (Exception e) {
62
- Logger.E(TAG, "exec failed: " + e.getMessage());
63
- }
64
- }
31
+ public static void exec(final Runnable r, final int delay) {
32
+ RhodesApplication.runWhen(
33
+ RhodesApplication.UiState.MainActivityCreated,
34
+ new RhodesApplication.StateHandler(true) {
35
+ @Override
36
+ public void run() {
37
+ try {
38
+ RhodesActivity.safeGetInstance().post(r, delay);
39
+ }
40
+ catch (Exception e) {
41
+ Logger.E(TAG, "exec failed: " + e.getMessage());
42
+ setError(e);
43
+ }
44
+ }
45
+ });
46
+ }
47
+
48
+ @Deprecated
49
+ public static void exec(final Runnable r, final boolean wait) {
50
+ if (wait)
51
+ sync_exec(r);
52
+ else
53
+ exec(r);
54
+ }
55
+
56
+ public static void exec(final Runnable r) {
57
+ RhodesApplication.runWhen(
58
+ RhodesApplication.UiState.MainActivityCreated,
59
+ new RhodesApplication.StateHandler(true) {
60
+ @Override
61
+ public void run() {
62
+ try {
63
+ RhodesActivity.safeGetInstance().post(r);
64
+ } catch (Exception e) {
65
+ Logger.E(TAG, "exec failed: " + e.getMessage());
66
+ setError(e);
67
+ }
68
+ }
69
+ });
70
+ }
71
+
72
+
73
+ // Special exec edition for RhoBluetoothManager
74
+ //TODO: Use future pattern to return result and wait
75
+ @Deprecated
76
+ public static void sync_exec(final Runnable r)
77
+ {
78
+ try {
79
+ RhodesActivity ra = RhodesActivity.safeGetInstance();
80
+
81
+ long thrId = Thread.currentThread().getId();
82
+ if (ra.getUiThreadId() == thrId) {
83
+ // We are already in UI thread
84
+ r.run();
85
+ }
86
+ else {
87
+ // Post request to UI thread and wait when it would be done
88
+ synchronized (r) {
89
+ ra.post(new PerformOnUiThread(r));
90
+ r.wait();
91
+ }
92
+ }
93
+ } catch (Exception e) {
94
+ Logger.E(TAG, "exec failed: " + e.getMessage());
95
+ Thread.dumpStack();
96
+ }
97
+ }
65
98
  };
@@ -15,6 +15,7 @@ platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java
15
15
  platform/android/Rhodes/src/com/rhomobile/rhodes/RhoLogConf.java
16
16
  platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java
17
17
  platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java
18
+ platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java
18
19
  platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java
19
20
  platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java
20
21
  platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java
@@ -7,7 +7,7 @@ USE_OWN_STLPORT = false
7
7
 
8
8
  ANDROID_API_LEVEL_TO_MARKET_VERSION = {}
9
9
  ANDROID_MARKET_VERSION_TO_API_LEVEL = {}
10
- {2 => "1.1", 3 => "1.5", 4 => "1.6", 5 => "2.0", 6 => "2.0.1", 7 => "2.1", 8 => "2.2", 9 => "2.3.1", 10 => "2.3.3", 11 => "3.0" }.each do |k,v|
10
+ {2 => "1.1", 3 => "1.5", 4 => "1.6", 5 => "2.0", 6 => "2.0.1", 7 => "2.1", 8 => "2.2", 9 => "2.3.1", 10 => "2.3.3", 11 => "3.0", 12 => "3.1" }.each do |k,v|
11
11
  ANDROID_API_LEVEL_TO_MARKET_VERSION[k] = v
12
12
  ANDROID_MARKET_VERSION_TO_API_LEVEL[v] = k
13
13
  end
@@ -1570,7 +1570,7 @@ namespace "run" do
1570
1570
  device_flag = '-e'
1571
1571
 
1572
1572
  logclear(device_flag)
1573
- run_emulator :hidden => true
1573
+ run_emulator( :hidden => true ) if device_flag == '-e'
1574
1574
  do_uninstall(device_flag)
1575
1575
 
1576
1576
  # Failsafe to prevent eternal hangs
@@ -402,6 +402,7 @@ public class RhoConf {
402
402
 
403
403
  NetResponse resp = null;
404
404
  try{
405
+ nq.sslVerifyPeer(false);
405
406
  resp = nq.pushMultipartData(strQuery, oItem, com.rho.sync.SyncThread.getSyncEngine(), null );
406
407
  }catch(Exception exc)
407
408
  {
@@ -57,8 +57,11 @@ public class DBAdapter extends RubyBasic
57
57
  public void close()
58
58
  {
59
59
  try{
60
- m_dbStorage.close();
61
- m_dbStorage = null;
60
+ if ( m_dbStorage != null )
61
+ {
62
+ m_dbStorage.close();
63
+ m_dbStorage = null;
64
+ }
62
65
  }catch(Exception exc)
63
66
  {
64
67
  LOG.ERROR("DB close failed.", exc);
@@ -1179,10 +1182,19 @@ public class DBAdapter extends RubyBasic
1179
1182
 
1180
1183
  }
1181
1184
  });
1182
- /*klass.defineMethod( "close", new RubyNoArgMethod(){
1183
- protected RubyValue run(RubyValue receiver, RubyBlock block ){
1184
- return ((DBAdapter)receiver).rb_close();}
1185
- });*/
1185
+ klass.defineMethod( "close", new RubyNoArgMethod(){
1186
+ protected RubyValue run(RubyValue receiver, RubyBlock block )
1187
+ {
1188
+ try{
1189
+ ((DBAdapter)receiver).close();
1190
+ return ObjectFactory.createInteger(0);
1191
+ }catch( Exception e ){
1192
+ LOG.ERROR("close failed.", e);
1193
+ throw (e instanceof RubyException ? (RubyException)e : new RubyException(e.getMessage()));
1194
+ }
1195
+ }
1196
+ });
1197
+
1186
1198
  klass.defineMethod( "execute", new RubyVarArgMethod(){
1187
1199
  protected RubyValue run(RubyValue receiver, RubyArray args, RubyBlock block ){
1188
1200
  return ((DBAdapter)receiver).rb_execute(args.get(0), args.get(1),
@@ -250,7 +250,7 @@ namespace "build" do
250
250
  def runPreverify(args)
251
251
  jdehome = $config["env"]["paths"][$bbver]["jde"]
252
252
 
253
- startdir = pwd
253
+ startdir = Dir.pwd()
254
254
  chdir $tmpdir
255
255
  puts Jake.run(File.join(jdehome,"bin/preverify"),args)
256
256
  chdir startdir
@@ -480,15 +480,16 @@ final public class RhodesApplication extends RhodesApplicationPlatform implement
480
480
  if ( ClientRegister.getInstance() != null )
481
481
  ClientRegister.getInstance().Destroy();
482
482
 
483
- if ( SyncThread.getInstance() != null )
484
- SyncThread.getInstance().Destroy();
485
-
486
483
  RhoRuby.rho_ruby_deactivateApp();
487
484
  RhoRuby.rho_ruby_uiDestroyed();
488
485
 
489
486
  GeoLocation.stop();
487
+
488
+ if ( SyncThread.getInstance() != null )
489
+ SyncThread.getInstance().Destroy();
490
+
490
491
  RhoRuby.RhoRubyStop();
491
-
492
+
492
493
  try{
493
494
  RhoClassFactory.getNetworkAccess().close();
494
495
  }catch(IOException exc){
@@ -616,7 +616,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
616
616
  self.webView.backgroundColor = bc;
617
617
  self.view.backgroundColor = bc;
618
618
 
619
- NSString* data = [NSString stringWithFormat:@"<body bgcolor=\"#%X\"></body>", bkg_color];
619
+ NSString* data = [NSString stringWithFormat:@"<body bgcolor=\"#%6$X\"></body>", bkg_color];
620
620
 
621
621
  self.webView.hidden = YES;
622
622