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.
- data/CHANGELOG +4 -0
- data/Rakefile +9 -2
- data/doc/application.txt +1 -1
- data/doc/build.txt +49 -70
- data/doc/device-caps.txt +22 -97
- data/doc/extensions.txt +1 -1
- data/doc/nfc.txt +542 -0
- data/doc/rhom.txt +7 -5
- data/doc/simulator.txt +116 -0
- data/doc/ui.txt +1 -1
- data/lib/build/jake.rb +5 -5
- data/lib/extensions/debugger/debugger.rb +63 -35
- data/lib/extensions/nfc/ext/nfc/platform/android/AndroidManifest.xml +8 -6
- data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +1070 -249
- data/lib/extensions/nfc/ext/nfc/platform/android/res/xml/filter_nfc.xml +1 -5
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +894 -72
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcActivity.java +82 -18
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcMessage.java +65 -0
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcRecord.java +88 -24
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java +3 -0
- data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i +204 -3
- data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +1047 -5
- data/lib/extensions/nfc/nfc.rb +635 -91
- data/lib/extensions/rhoxml/rexml/encodings/CP-1252.rb +103 -0
- data/lib/extensions/rhoxml/rexml/encodings/ISO-8859-1.rb +7 -0
- data/lib/framework/dateME.rb +26 -0
- data/lib/framework/rho/render.rb +21 -9
- data/lib/framework/rho/rho.rb +12 -0
- data/lib/framework/rho/rhoevent_bb.rb +3 -0
- data/lib/framework/rho/rhoevent_c.rb +3 -0
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhom/rhom_db_adapter.rb +9 -9
- data/lib/framework/rhosystem.rb +17 -0
- data/lib/framework/stringio.rb +18 -0
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/res/xml/filter_nfc.xml +1 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +0 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +10 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +29 -18
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +67 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +14 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +102 -28
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +35 -66
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +5 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +69 -41
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +7 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +68 -35
- data/platform/android/build/RhodesSRC_build.files +1 -0
- data/platform/android/build/android.rake +2 -2
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +1 -0
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +18 -6
- data/platform/bb/build/bb.rake +1 -1
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +5 -4
- data/platform/iphone/Classes/SimpleMainView.m +1 -1
- data/platform/iphone/Info.plist +1 -1
- data/platform/shared/common/RhodesApp.cpp +9 -3
- data/platform/shared/curl/lib/rhossl.c +5 -2
- data/platform/shared/db/DBAdapter.cpp +9 -0
- data/platform/shared/net/CURLNetRequest.cpp +8 -3
- data/platform/shared/net/iphone/sslimpl.cpp +3 -2
- data/platform/shared/net/ssl.cpp +8 -0
- data/platform/shared/ruby/ext/rho/rhoruby.c +10 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +1 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +3 -4
- data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
- data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
- data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
- data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
- data/platform/win32/RhoSimulator/libeay32.dll +0 -0
- data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
- data/platform/wm/build/wm.rake +27 -3
- data/platform/wm/rhodes/Rhodes.cpp +4 -0
- data/platform/wm/rhodes/emulator/MainWindowCallback.h +1 -0
- data/platform/wm/rhodes/emulator/MainWindowProxy.cpp +3 -1
- data/platform/wm/rhodes/emulator/MainWindowQt.cpp +23 -12
- data/platform/wm/rhodes/emulator/MainWindowQt.h +5 -1
- data/platform/wm/rhodes/emulator/QtMainWindow.cpp +39 -6
- data/platform/wm/rhodes/emulator/QtMainWindow.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +5 -0
- data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/IronRuby.Libraries.dll +0 -0
- data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/IronRuby.dll +0 -0
- data/platform/wp7/IronRuby/bin/Silverlight3Release/Microsoft.Dynamic.dll +0 -0
- data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/Microsoft.Scripting.Core.dll +0 -0
- data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/Microsoft.Scripting.dll +0 -0
- data/platform/wp7/RhoAppRunner/Program.cs +2 -2
- data/platform/wp7/RhoRubyLib/RhoRuby.cs +8 -0
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +29 -7
- data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +5 -2
- data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +12 -0
- data/platform/wp7/RhoRubyLib/net/HttpServer.cs +2 -0
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
- data/platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs +52 -7
- data/platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs +85 -18
- data/platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs +38 -3
- data/platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs +27 -2
- data/platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs +111 -15
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +330 -55
- data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +61 -4
- data/platform/wp7/build/wp.rake +89 -72
- data/platform/wp7/rhodes/App.xaml.cs +1 -1
- data/rakefile.rb +9 -2
- data/rhodes.gemspec +1 -3
- data/spec/phone_spec/app/spec/asynchttp_spec.rb +7 -9
- data/spec/phone_spec/app/spec/uri_spec.rb +75 -0
- data/spec/phone_spec/app/spec_runner.rb +4 -0
- metadata +21 -15
- data/Manifest.txt +0 -6403
- data/platform/win32/RhoSimulator/codecs/qcncodecs4.dll +0 -0
- data/platform/win32/RhoSimulator/codecs/qjpcodecs4.dll +0 -0
- data/platform/win32/RhoSimulator/codecs/qkrcodecs4.dll +0 -0
- data/platform/win32/RhoSimulator/codecs/qtwcodecs4.dll +0 -0
- 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)
|
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())
|
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)
|
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)
|
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)
|
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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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(
|
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
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
@@ -57,8 +57,11 @@ public class DBAdapter extends RubyBasic
|
|
57
57
|
public void close()
|
58
58
|
{
|
59
59
|
try{
|
60
|
-
m_dbStorage
|
61
|
-
|
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
|
-
|
1183
|
-
protected RubyValue run(RubyValue receiver, RubyBlock block )
|
1184
|
-
|
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),
|
data/platform/bb/build/bb.rake
CHANGED
@@ -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
|
|