rhodes 3.0.0.beta.6 → 3.0.0.beta.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/Manifest.txt +9 -1
  2. data/doc/device-caps.txt +20 -19
  3. data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +1 -1
  4. data/lib/extensions/nfc/ext/nfc/platform/android/Rakefile +1 -1
  5. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +4 -12
  6. data/platform/android/Rhodes/jni/src/callbacks.cpp +10 -0
  7. data/platform/android/Rhodes/jni/src/rhodes.cpp +3 -3
  8. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +13 -23
  9. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +1 -2
  10. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +61 -33
  11. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/StatusNotification.java +2 -2
  12. data/platform/android/build/android.rake +5 -0
  13. data/platform/iphone/Classes/AppManager/AppManager.m +5 -0
  14. data/platform/shared/common/RhodesApp.cpp +2 -0
  15. data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
  16. data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
  17. data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
  18. data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
  19. data/platform/win32/RhoSimulator/{rhosimulator.exe → RhoSimulator.exe} +0 -0
  20. data/platform/win32/RhoSimulator/codecs/qcncodecs4.dll +0 -0
  21. data/platform/win32/RhoSimulator/codecs/qjpcodecs4.dll +0 -0
  22. data/platform/win32/RhoSimulator/codecs/qkrcodecs4.dll +0 -0
  23. data/platform/win32/RhoSimulator/codecs/qtwcodecs4.dll +0 -0
  24. data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
  25. data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
  26. data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
  27. data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
  28. data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
  29. data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
  30. data/platform/wm/build/wm.rake +1 -0
  31. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +5 -0
  32. data/rhodes.gemspec +1 -1
  33. metadata +13 -5
data/Manifest.txt CHANGED
@@ -4104,14 +4104,22 @@ platform/win32/replaceicon/replaceicon.sln
4104
4104
  platform/win32/replaceicon/replaceicon.vcproj
4105
4105
  platform/win32/replaceicon/stdafx.cpp
4106
4106
  platform/win32/replaceicon/stdafx.h
4107
+ platform/win32/RhoSimulator/codecs/qcncodecs4.dll
4108
+ platform/win32/RhoSimulator/codecs/qjpcodecs4.dll
4109
+ platform/win32/RhoSimulator/codecs/qkrcodecs4.dll
4110
+ platform/win32/RhoSimulator/codecs/qtwcodecs4.dll
4107
4111
  platform/win32/RhoSimulator/imageformats/qgif4.dll
4112
+ platform/win32/RhoSimulator/imageformats/qico4.dll
4108
4113
  platform/win32/RhoSimulator/imageformats/qjpeg4.dll
4114
+ platform/win32/RhoSimulator/imageformats/qmng4.dll
4115
+ platform/win32/RhoSimulator/imageformats/qsvg4.dll
4116
+ platform/win32/RhoSimulator/imageformats/qtiff4.dll
4109
4117
  platform/win32/RhoSimulator/QtCore4.dll
4110
4118
  platform/win32/RhoSimulator/QtGui4.dll
4111
4119
  platform/win32/RhoSimulator/QTLICENSE.LGPL
4112
4120
  platform/win32/RhoSimulator/QtNetwork4.dll
4113
4121
  platform/win32/RhoSimulator/QtWebKit4.dll
4114
- platform/win32/RhoSimulator/rhosimulator.exe
4122
+ platform/win32/RhoSimulator/RhoSimulator.exe
4115
4123
  platform/win32/rubylib/rubylib.vcproj
4116
4124
  platform/win32/RubyWin/RubyWin.sln
4117
4125
  platform/win32/RubyWin/RubyWin.vcproj
data/doc/device-caps.txt CHANGED
@@ -11,26 +11,27 @@ Rhodes provide access to device specific capabilities such as GPS, PIM, camera,
11
11
  <th>Windows Mobile</th>
12
12
  <th>BlackBerry</th>
13
13
  <th>Android</th>
14
+ <th>RhoSimulator</th>
14
15
  </tr>
15
- <tr><td class='cap'>GeoLocation</td><td>0.3</td><td>0.3</td><td>0.3</td><td>1.0</td></tr>
16
- <tr><td class='cap'>PIM Contacts</td><td>0.3</td><td>0.3</td><td>0.3</td><td>1.0</td></tr>
17
- <tr><td class='cap'>PIM Calendar</td><td>2.2</td><td>2.2</td><td>2.2</td><td>2.2</td><tr>
18
- <tr><td class='cap'>Camera</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td></tr>
19
- <tr><td class='cap'>Barcode</td><td>2.1</td><td>2.1</td><td>2.1</td><td>2.1</td></tr>
20
- <tr><td class='cap'>Date/Time picker</td><td>1.2.2</td><td>2.0</td><td>1.2</td><td>1.2</td></tr>
21
- <tr><td class='cap'>Menu</td><td>1.2.2</td><td>2.0</td><td>1.2</td><td>1.5</td><tr>
22
- <tr><td class='cap'>Toolbar</td><td>1.2.2</td><td>2.3</td><td class='tbd'>n/a</td><td>1.5</td><tr>
23
- <tr><td class='cap'>Tab Bar</td><td>1.2.2</td><td class='tbd'>2.5</td><td class='tbd'>n/a</td><td>1.5</td><tr>
24
- <tr><td class='cap'>Nav Bar</td><td>2.0</td><td class='tbd'>2.5</td><td class='tbd'>n/a</td><td>2.0</td><tr>
25
- <tr><td class='cap'>Signature Capture</td><td>2.1</td><td class='tbd'>2.5</td><td class='tbd'>2.5</td><td>2.1</td><tr>
26
- <tr class='tbd'><td class='cap'>Audio/Video capture</td><td>3.0</td><td>3.0</td><td>3.0</td><td>3.0</td><tr>
27
- <tr><td class='cap'>Bluetooth</td><td>2.2</td><td>2.2</td><td>2.2</td><td>2.2</td><tr>
28
- <tr><td class='cap'>NFC</td><td class='tbd'>-</td><td class='tbd'>-</td><td class='tbd'>-</td><td>3.0</td><tr>
29
- <tr><td class='cap'>Push</td><td>1.2</td><td class='tbd'>3.0</td><td>1.2</td><td>2.2</td><tr>
30
- <tr><td class='cap'>Screen rotation</td><td>2.1</td><td class='tbd'>2.5</td><td>2.0</td><td>2.1</td><tr>
31
- <tr><td class='cap'>Native Maps</td><td>1.4</td><td class='tbd'>2.5</td><td>1.4</td><td>1.5</td><tr>
32
- <tr><td class='cap'>Alerts/Audio File Playback</td><td>1.2</td><td>1.5</td><td>1.2</td><td>1.2</td><tr>
33
- <tr><td class='cap'>Ringtones</td><td>2.5</td><td>1.5</td><td>1.5</td><td>1.5</td><tr>
16
+ <tr><td class='cap'>GeoLocation</td><td>0.3</td><td>0.3</td><td>0.3</td><td>1.0</td><td class='tbd'>1.0</td></tr>
17
+ <tr><td class='cap'>PIM Contacts</td><td>0.3</td><td>0.3</td><td>0.3</td><td>1.0</td><td>1.0</td></tr>
18
+ <tr><td class='cap'>PIM Calendar</td><td>2.2</td><td>2.2</td><td>2.2</td><td>2.2</td><td>1.0</td></tr>
19
+ <tr><td class='cap'>Camera</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td></tr>
20
+ <tr><td class='cap'>Barcode</td><td>2.1</td><td>2.1</td><td>2.1</td><td>2.1</td><td class='tbd'>-</td></tr>
21
+ <tr><td class='cap'>Date/Time picker</td><td>1.2.2</td><td>2.0</td><td>1.2</td><td>1.2</td><td>1.0</td></tr>
22
+ <tr><td class='cap'>Menu</td><td>1.2.2</td><td>2.0</td><td>1.2</td><td>1.5</td><td>1.0</td></tr>
23
+ <tr><td class='cap'>Toolbar</td><td>1.2.2</td><td>2.3</td><td class='tbd'>n/a</td><td>1.5</td><td>1.0</td></tr>
24
+ <tr><td class='cap'>Tab Bar</td><td>1.2.2</td><td class='tbd'>2.5</td><td class='tbd'>n/a</td><td>1.5</td><td class='tbd'>-</td></tr>
25
+ <tr><td class='cap'>Nav Bar</td><td>2.0</td><td class='tbd'>2.5</td><td class='tbd'>n/a</td><td>2.0</td><td class='tbd'>-</td></tr>
26
+ <tr><td class='cap'>Signature Capture</td><td>2.1</td><td class='tbd'>2.5</td><td class='tbd'>2.5</td><td>2.1</td><td class='tbd'>-</td></tr>
27
+ <tr class='tbd'><td class='cap'>Audio/Video capture</td><td>3.0</td><td>3.0</td><td>3.0</td><td>3.0</td><td>-</td></tr>
28
+ <tr><td class='cap'>Bluetooth</td><td>2.2</td><td>2.2</td><td>2.2</td><td>2.2</td><td class='tbd'>-</td></tr>
29
+ <tr><td class='cap'>NFC</td><td class='tbd'>-</td><td class='tbd'>-</td><td class='tbd'>-</td><td>3.0</td><td class='tbd'>-</td></tr>
30
+ <tr><td class='cap'>Push</td><td>1.2</td><td class='tbd'>3.0</td><td>1.2</td><td>2.2</td><td>1.0</td></tr>
31
+ <tr><td class='cap'>Screen rotation</td><td>2.1</td><td class='tbd'>2.5</td><td>2.0</td><td>2.1</td><td class='tbd'>-</td></tr>
32
+ <tr><td class='cap'>Native Maps</td><td>1.4</td><td class='tbd'>2.5</td><td>1.4</td><td>1.5</td><td class='tbd'>-</td></tr>
33
+ <tr><td class='cap'>Alerts/Audio File Playback</td><td>1.2</td><td>1.5</td><td>1.2</td><td>1.2</td><td class='tbd'>1.0</td></tr>
34
+ <tr><td class='cap'>Ringtones</td><td>2.5</td><td>1.5</td><td>1.5</td><td>1.5</td><td class='tbd'>1.0</td></tr>
34
35
  </table>
35
36
 
36
37
  ## System class
@@ -97,7 +97,7 @@ namespace "build" do
97
97
  end
98
98
 
99
99
  flname = $targetdir + '/ext_build.files'
100
- File.open(flname, "w") do |f|
100
+ File.open(flname, "a") do |f|
101
101
  javafiles.each do |j|
102
102
  f.puts $barcodedir + '/' + j
103
103
  end
@@ -79,7 +79,7 @@ namespace "build" do
79
79
  end
80
80
 
81
81
  flname = $targetdir + '/ext_build.files'
82
- File.open(flname, "w") do |f|
82
+ File.open(flname, "a") do |f|
83
83
  javafiles.each do |j|
84
84
  f.puts $nfcdir + '/' + j
85
85
  end
@@ -89,7 +89,7 @@ JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_onScreenOrientati
89
89
  * Signature: ()V
90
90
  */
91
91
  JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_callUiCreatedCallback
92
- (JNIEnv *, jobject);
92
+ (JNIEnv *, jclass);
93
93
 
94
94
  /*
95
95
  * Class: com_rhomobile_rhodes_RhodesService
@@ -97,7 +97,7 @@ JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_callUiCreatedCall
97
97
  * Signature: ()V
98
98
  */
99
99
  JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_callUiDestroyedCallback
100
- (JNIEnv *, jobject);
100
+ (JNIEnv *, jclass);
101
101
 
102
102
  /*
103
103
  * Class: com_rhomobile_rhodes_RhodesService
@@ -105,7 +105,7 @@ JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_callUiDestroyedCa
105
105
  * Signature: (Z)V
106
106
  */
107
107
  JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_callActivationCallback
108
- (JNIEnv *, jobject, jboolean);
108
+ (JNIEnv *, jclass, jboolean);
109
109
 
110
110
  /*
111
111
  * Class: com_rhomobile_rhodes_RhodesService
@@ -125,20 +125,12 @@ JNIEXPORT jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_isOnStartPage
125
125
 
126
126
  /*
127
127
  * Class: com_rhomobile_rhodes_RhodesService
128
- * Method: isEnableTitle
128
+ * Method: isTitleEnabled
129
129
  * Signature: ()Z
130
130
  */
131
131
  JNIEXPORT jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_isTitleEnabled
132
132
  (JNIEnv *, jclass);
133
133
 
134
- /*
135
- * Class: com_rhomobile_rhodes_RhodesService
136
- * Method: isEnableTitle
137
- * Signature: ()Z
138
- */
139
- JNIEXPORT jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_isEnableTitle
140
- (JNIEnv *, jclass);
141
-
142
134
  /*
143
135
  * Class: com_rhomobile_rhodes_RhodesService
144
136
  * Method: setPushRegistrationId
@@ -199,6 +199,16 @@ RHO_GLOBAL void rho_sys_bring_to_front()
199
199
  env->CallStaticVoidMethod(cls, mid);
200
200
  }
201
201
 
202
+ RHO_GLOBAL void rho_sys_report_app_started()
203
+ {
204
+ JNIEnv *env = jnienv();
205
+ jclass cls = getJNIClass(RHODES_JAVA_CLASS_RHODES_SERVICE);
206
+ if (!cls) return;
207
+ jmethodID mid = getJNIClassStaticMethod(env, cls, "handleAppStarted", "()V");
208
+ if (!mid) return;
209
+ env->CallStaticVoidMethod(cls, mid);
210
+ }
211
+
202
212
  RHO_GLOBAL void rho_sys_open_url(const char *url)
203
213
  {
204
214
  JNIEnv *env = jnienv();
@@ -678,19 +678,19 @@ RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_onScreenOrientat
678
678
  }
679
679
 
680
680
  RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_callUiCreatedCallback
681
- (JNIEnv *, jobject)
681
+ (JNIEnv *, jclass)
682
682
  {
683
683
  rho_rhodesapp_callUiCreatedCallback();
684
684
  }
685
685
 
686
686
  RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_callUiDestroyedCallback
687
- (JNIEnv *, jobject)
687
+ (JNIEnv *, jclass)
688
688
  {
689
689
  rho_rhodesapp_callUiDestroyedCallback();
690
690
  }
691
691
 
692
692
  RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_callActivationCallback
693
- (JNIEnv *, jobject, jboolean active)
693
+ (JNIEnv *, jclass, jboolean active)
694
694
  {
695
695
  rho_rhodesapp_callAppActiveCallback(active);
696
696
  }
@@ -1,7 +1,5 @@
1
1
  package com.rhomobile.rhodes;
2
2
 
3
- import com.rhomobile.rhodes.alert.StatusNotification;
4
-
5
3
  import android.app.Activity;
6
4
  import android.content.BroadcastReceiver;
7
5
  import android.content.Context;
@@ -10,15 +8,12 @@ import android.os.Bundle;
10
8
  import android.util.Log;
11
9
 
12
10
  public class PushReceiver extends BroadcastReceiver {
13
-
14
- private static final String TAG = PushReceiver.class.getSimpleName();
15
-
11
+ private static final boolean DEBUG = false;
12
+
13
+ private static final String TAG = PushReceiver.class.getSimpleName();
14
+
16
15
  private static final String REG_ID = "registration_id";
17
16
 
18
- private static final String NOTIFICATION_NONE = "none";
19
- private static final String NOTIFICATION_BACKGROUND = "background";
20
- private static final String NOTIFICATION_ALWAYS = "always";
21
-
22
17
  public static final String INTENT_SOURCE = PushReceiver.class.getName();
23
18
 
24
19
  private static final String INTENT_PREFIX = PushReceiver.class.getPackage().getName();
@@ -55,24 +50,19 @@ public class PushReceiver extends BroadcastReceiver {
55
50
 
56
51
  private void handleMessage(Context context, Intent intent) {
57
52
  Bundle extras = intent.getExtras();
58
- Log.d(TAG, "Message: " + extras);
53
+
54
+ if (DEBUG) {
55
+ Log.d(TAG, "Message: " + extras.toString());
56
+ for (String key: extras.keySet()) {
57
+ Log.d(TAG, key + ": " + extras.get(key).toString());
58
+ }
59
+ }
60
+
59
61
  Intent serviceIntent = new Intent(context, RhodesService.class);
60
62
  serviceIntent.putExtra(RhodesService.INTENT_SOURCE, INTENT_SOURCE);
61
63
  serviceIntent.putExtra(INTENT_TYPE, INTENT_TYPE_MESSAGE);
62
64
  serviceIntent.putExtra(INTENT_EXTRAS, extras);
63
- String alert = extras.getString("alert");
64
- String from = extras.getString("from");
65
-
66
- boolean statusNotification = false;
67
- if (Push.PUSH_NOTIFICATIONS.equals(NOTIFICATION_ALWAYS))
68
- statusNotification = true;
69
- else if (Push.PUSH_NOTIFICATIONS.equals(NOTIFICATION_BACKGROUND))
70
- statusNotification = !RhodesService.isRhodesActivityStarted();
71
-
72
- if (statusNotification)
73
- StatusNotification.simpleNotification(TAG, INTENT_TYPE_MESSAGE, context, serviceIntent, "PUSH message from: " + from, alert);
74
- else
75
- context.startService(serviceIntent);
65
+ context.startService(serviceIntent);
76
66
  }
77
67
 
78
68
  @Override
@@ -27,7 +27,6 @@ public class RhodesApplication extends Application{
27
27
  public static void start()
28
28
  {
29
29
  startRhodesApp();
30
- stateChanged(AppState.AppStarted);
31
30
  }
32
31
 
33
32
  public static boolean canStart(String strCmdLine)
@@ -70,7 +69,7 @@ public class RhodesApplication extends Application{
70
69
  @Override
71
70
  public boolean canHandle(AppState state) { return (state == this) || (state == AppStarted); }
72
71
  },
73
- AppDeactivated("AppDEactivated") {
72
+ AppDeactivated("AppDeactivated") {
74
73
  @Override
75
74
  public boolean canHandle(AppState state) { return (state == this) || (state == AppStarted); }
76
75
  };
@@ -17,7 +17,9 @@ import java.util.TimeZone;
17
17
  import java.util.UUID;
18
18
  import java.util.Vector;
19
19
 
20
+ import com.rhomobile.rhodes.RhodesApplication.AppState;
20
21
  import com.rhomobile.rhodes.alert.Alert;
22
+ import com.rhomobile.rhodes.alert.StatusNotification;
21
23
  import com.rhomobile.rhodes.event.EventStore;
22
24
  import com.rhomobile.rhodes.file.RhoFileApi;
23
25
  import com.rhomobile.rhodes.geolocation.GeoLocation;
@@ -86,7 +88,11 @@ public class RhodesService extends Service {
86
88
 
87
89
  private static final String ACTION_ASK_CANCEL_DOWNLOAD = "com.rhomobile.rhodes.DownloadManager.ACTION_ASK_CANCEL_DOWNLOAD";
88
90
  private static final String ACTION_CANCEL_DOWNLOAD = "com.rhomobile.rhodes.DownloadManager.ACTION_CANCEL_DOWNLOAD";
89
-
91
+
92
+ private static final String NOTIFICATION_NONE = "none";
93
+ private static final String NOTIFICATION_BACKGROUND = "background";
94
+ private static final String NOTIFICATION_ALWAYS = "always";
95
+
90
96
  private static RhodesService sInstance = null;
91
97
 
92
98
  private final IBinder mBinder = new LocalBinder();
@@ -232,9 +238,9 @@ public class RhodesService extends Service {
232
238
 
233
239
  public static native void onScreenOrientationChanged(int width, int height, int angle);
234
240
 
235
- public native void callUiCreatedCallback();
236
- public native void callUiDestroyedCallback();
237
- public native void callActivationCallback(boolean active);
241
+ public static native void callUiCreatedCallback();
242
+ public static native void callUiDestroyedCallback();
243
+ public static native void callActivationCallback(boolean active);
238
244
 
239
245
  public static native String getBuildConfig(String key);
240
246
 
@@ -413,6 +419,11 @@ public class RhodesService extends Service {
413
419
  handleAppActivation();
414
420
  }
415
421
 
422
+ public static void handleAppStarted()
423
+ {
424
+ RhodesApplication.stateChanged(AppState.AppStarted);
425
+ }
426
+
416
427
  private void setFullscreenParameters() {
417
428
  boolean fullScreen = true;
418
429
  if (RhoConf.isExist("full_screen"))
@@ -1158,33 +1169,50 @@ public class RhodesService extends Service {
1158
1169
  Logger.W(TAG, "Empty PUSH message received");
1159
1170
  return;
1160
1171
  }
1161
-
1162
- StringBuilder builder = new StringBuilder();
1163
-
1164
- Set<String> keys = extras.keySet();
1165
- // Remove system related keys
1166
- keys.remove("collapse_key");
1167
- keys.remove("from");
1168
-
1169
- for (String key : keys) {
1170
- Logger.D(TAG, "PUSH item: " + key);
1171
- Object value = extras.get(key);
1172
- if (builder.length() > 0)
1173
- builder.append("&");
1174
- builder.append(key);
1175
- builder.append("=");
1176
- if (value != null)
1177
- builder.append(value.toString());
1178
- }
1179
-
1180
- String data = builder.toString();
1181
- Logger.D(TAG, "Received PUSH message: " + data);
1182
- if (callPushCallback(data)) {
1183
- Logger.T(TAG, "Push message completely handled in callback");
1184
- return;
1185
- }
1186
-
1187
- final String alert = extras.getString("alert");
1172
+
1173
+ StringBuilder builder = new StringBuilder();
1174
+ Set<String> keys = extras.keySet();
1175
+
1176
+ for (String key : keys) {
1177
+
1178
+ // Skip system related keys
1179
+ if(key.equals("from"))
1180
+ continue;
1181
+ if(key.equals("collapse_key"))
1182
+ continue;
1183
+
1184
+ Logger.D(TAG, "PUSH item: " + key);
1185
+ Object value = extras.get(key);
1186
+ if (builder.length() > 0)
1187
+ builder.append("&");
1188
+ builder.append(key);
1189
+ if (value != null) {
1190
+ builder.append("=");
1191
+ builder.append(value.toString());
1192
+ }
1193
+ }
1194
+ String data = builder.toString();
1195
+
1196
+ Logger.D(TAG, "Received PUSH message: " + data);
1197
+ if (callPushCallback(data)) {
1198
+ Logger.T(TAG, "Push message completely handled in callback");
1199
+ return;
1200
+ }
1201
+
1202
+ final String alert = extras.getString("alert");
1203
+ final String from = extras.getString("from");
1204
+
1205
+ boolean statusNotification = false;
1206
+ if (Push.PUSH_NOTIFICATIONS.equals(NOTIFICATION_ALWAYS))
1207
+ statusNotification = true;
1208
+ else if (Push.PUSH_NOTIFICATIONS.equals(NOTIFICATION_BACKGROUND))
1209
+ statusNotification = !isRhodesActivityStarted();
1210
+
1211
+ if (statusNotification) {
1212
+ Intent intent = new Intent(getContext(), RhodesActivity.class);
1213
+ StatusNotification.simpleNotification(TAG, 0, getContext(), intent, "PUSH message from: " + from, alert);
1214
+ }
1215
+
1188
1216
  if (alert != null) {
1189
1217
  Logger.D(TAG, "PUSH: Alert: " + alert);
1190
1218
  RhodesApplication.runWhen(
@@ -1245,7 +1273,7 @@ public class RhodesService extends Service {
1245
1273
  } else {
1246
1274
  final String arg_source = source.trim();
1247
1275
  RhodesApplication.runWhen(
1248
- RhodesApplication.AppState.AppActivated,
1276
+ RhodesApplication.AppState.AppStarted,
1249
1277
  new RhodesApplication.StateHandler() {
1250
1278
  @Override
1251
1279
  public boolean run() {
@@ -1258,7 +1286,7 @@ public class RhodesService extends Service {
1258
1286
 
1259
1287
  if (syncAll) {
1260
1288
  RhodesApplication.runWhen(
1261
- RhodesApplication.AppState.AppActivated,
1289
+ RhodesApplication.AppState.AppStarted,
1262
1290
  new RhodesApplication.StateHandler() {
1263
1291
  @Override
1264
1292
  public boolean run() {
@@ -21,13 +21,13 @@ public class StatusNotification
21
21
  public static Notification simpleNotification(String tag, int notificationId, Context ctx, Intent intent, String title, String text)
22
22
  {
23
23
  Notification notification = makeNotification(text);
24
- PendingIntent contentIntent = PendingIntent.getService(ctx, 0, intent, 0);
24
+ PendingIntent contentIntent = PendingIntent.getActivity(ctx, 0, intent, 0);
25
25
 
26
26
  notification.setLatestEventInfo(ctx, title, text, contentIntent);
27
27
  notification.defaults = Notification.DEFAULT_ALL;
28
28
  notification.flags |= Notification.FLAG_AUTO_CANCEL;
29
29
 
30
- customNotification(tag, notificationId, ctx,notification);
30
+ customNotification(tag, notificationId, ctx, notification);
31
31
 
32
32
  return notification;
33
33
  }
@@ -703,6 +703,11 @@ namespace "build" do
703
703
  ENV["RHO_INC"] = $appincdir
704
704
  ENV["RHO_ANDROID_TMP_DIR"] = $tmpdir
705
705
 
706
+ ext_build_files = File.join($extensionsdir, "ext_build.files")
707
+ if File.exist? ext_build_files
708
+ rm ext_build_files
709
+ end
710
+
706
711
  mkdir_p $extensionsdir unless File.directory? $extensionsdir
707
712
 
708
713
  $app_config["extensions"].each do |ext|
@@ -479,6 +479,11 @@ void rho_sys_bring_to_front()
479
479
  RAWLOG_INFO("rho_sys_bring_to_front has no implementation on iPhone.");
480
480
  }
481
481
 
482
+ void rho_sys_report_app_started()
483
+ {
484
+ RAWLOG_INFO("rho_sys_report_app_started has no implementation on iPhone.");
485
+ }
486
+
482
487
 
483
488
  extern VALUE rho_sys_has_network();
484
489
 
@@ -31,6 +31,7 @@ void rho_map_location(char* query);
31
31
  void rho_appmanager_load( void* httpContext, const char* szQuery);
32
32
  void rho_db_init_attr_manager();
33
33
  void rho_sys_app_exit();
34
+ void rho_sys_report_app_started();
34
35
  }
35
36
 
36
37
  namespace rho {
@@ -182,6 +183,7 @@ void CAppCallbacksQueue::processCommand(IQueueCommand* pCmd)
182
183
 
183
184
  case local_server_started:
184
185
  m_expected = ui_created;
186
+ rho_sys_report_app_started();
185
187
  break;
186
188
  case ui_created:
187
189
  {
Binary file
@@ -359,6 +359,7 @@ namespace "run" do
359
359
  end
360
360
 
361
361
  namespace "win32" do
362
+ desc "Run application on RhoSimulator"
362
363
  task :rhosimulator => "config:common" do
363
364
  $appname = $app_config["name"].nil? ? "Rhodes" : $app_config["name"]
364
365
 
@@ -640,6 +640,11 @@ void rho_sys_bring_to_front()
640
640
  LOG(INFO) + "rho_sys_bring_to_front() has no implementation on Win Mobile.";
641
641
  }
642
642
 
643
+ void rho_sys_report_app_started()
644
+ {
645
+ LOG(INFO) + "rho_sys_report_app_started() has no implementation on Win Mobile.";
646
+ }
647
+
643
648
  int rho_sys_is_app_installed(const char *appname)
644
649
  {
645
650
  int nRet = 0;
data/rhodes.gemspec CHANGED
@@ -3,7 +3,7 @@ require "lib/rhodes.rb"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = %q{rhodes}
6
- s.version = "3.0.0.beta.6"
6
+ s.version = "3.0.0.beta.7"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Rhomobile"]
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhodes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196431
4
+ hash: 62196429
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 6
12
- version: 3.0.0.beta.6
11
+ - 7
12
+ version: 3.0.0.beta.7
13
13
  platform: ruby
14
14
  authors:
15
15
  - Rhomobile
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-09 00:00:00 -07:00
20
+ date: 2011-05-10 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -4236,14 +4236,22 @@ files:
4236
4236
  - platform/win32/replaceicon/replaceicon.vcproj
4237
4237
  - platform/win32/replaceicon/stdafx.cpp
4238
4238
  - platform/win32/replaceicon/stdafx.h
4239
+ - platform/win32/RhoSimulator/codecs/qcncodecs4.dll
4240
+ - platform/win32/RhoSimulator/codecs/qjpcodecs4.dll
4241
+ - platform/win32/RhoSimulator/codecs/qkrcodecs4.dll
4242
+ - platform/win32/RhoSimulator/codecs/qtwcodecs4.dll
4239
4243
  - platform/win32/RhoSimulator/imageformats/qgif4.dll
4244
+ - platform/win32/RhoSimulator/imageformats/qico4.dll
4240
4245
  - platform/win32/RhoSimulator/imageformats/qjpeg4.dll
4246
+ - platform/win32/RhoSimulator/imageformats/qmng4.dll
4247
+ - platform/win32/RhoSimulator/imageformats/qsvg4.dll
4248
+ - platform/win32/RhoSimulator/imageformats/qtiff4.dll
4241
4249
  - platform/win32/RhoSimulator/QtCore4.dll
4242
4250
  - platform/win32/RhoSimulator/QtGui4.dll
4243
4251
  - platform/win32/RhoSimulator/QTLICENSE.LGPL
4244
4252
  - platform/win32/RhoSimulator/QtNetwork4.dll
4245
4253
  - platform/win32/RhoSimulator/QtWebKit4.dll
4246
- - platform/win32/RhoSimulator/rhosimulator.exe
4254
+ - platform/win32/RhoSimulator/RhoSimulator.exe
4247
4255
  - platform/win32/rubylib/rubylib.vcproj
4248
4256
  - platform/win32/RubyWin/RubyWin.sln
4249
4257
  - platform/win32/RubyWin/RubyWin.vcproj