rhodes 3.3.0.beta.1 → 3.3.0.beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/doc/build.txt CHANGED
@@ -1174,3 +1174,49 @@ So if you change icon of application, you have to restart device/simulator(unins
1174
1174
 
1175
1175
  ### Symbian
1176
1176
  You can change icon for your Symbian application replacing icon.svg which is in your application icon folder with a new one.
1177
+
1178
+ ## Upgrade application
1179
+ Rhodes 3.3 support application code upgrade for iPhone(non AppStore distribution) and Windows Mobile.
1180
+
1181
+ ### Prepare application package
1182
+
1183
+ To prepare upgrade package for iPhone run in application folder:
1184
+
1185
+ :::term
1186
+ $ rake build:iphone:upgrade_package
1187
+
1188
+ Application package will be placed to <app_root>/bin/target/iphone
1189
+
1190
+ To prepare upgrade package for Windows Mobile run in application folder:
1191
+
1192
+ :::term
1193
+ $ rake build:wm:upgrade_package
1194
+
1195
+ Application package will be placed to <app_root>/bin/target/wmp6
1196
+
1197
+ ### Upgrade package from running application
1198
+
1199
+ Download package:
1200
+ :::ruby
1201
+ if !::Rho::RhoSupport.rhobundle_download(url_to_package, url_for(:action => :httpdownload_callback))
1202
+ render :action =>:error
1203
+ else
1204
+ render :action => :wait_download, :back => '/app'
1205
+ end
1206
+
1207
+ Unzip and replace package:
1208
+ :::ruby
1209
+ if System.unzip_file(::Rho::RhoSupport.rhobundle_getfilename())==0
1210
+ System.replace_current_bundle( File.dirname(::Rho::RhoSupport.rhobundle_getfilename()) )
1211
+ render :action => :wait_replace, :back => '/app'
1212
+ else
1213
+ WebView.navigate url_for :action => :error
1214
+ end
1215
+
1216
+ Application will restart automatically.
1217
+
1218
+ NOTE: On iPhone application has to be manually started.
1219
+
1220
+
1221
+ ### Sample
1222
+ See [Reload bundle demo](http://github.com/rhomobile/ReloadBundleDemo) for more information.
data/doc/device-caps.txt CHANGED
@@ -627,6 +627,71 @@ In callback:
627
627
  ### Sample
628
628
  See controller and view in the /app/BarcodeRecognizer folder of the [System API Samples application](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/BarcodeRecognizer/controller.rb) for more information.
629
629
 
630
+ ## Barcode for Motorola devices
631
+ Rhodes 3.3 and RhoElements 2.0 support Motorola barcode scanner devices. Install RhoElements gem or RhoStudio and start developing for Motorola Windows Mobile, Windows CE and Android(ET1) devices .
632
+
633
+ To enable add to build.yml:
634
+
635
+ capabilities:
636
+ -motorola
637
+
638
+ extensions: ["barcode-moto"]
639
+
640
+ Barcode API :
641
+
642
+ Get a list of scanners present on the device. Return array of hashes ('name','id'):
643
+
644
+ :::ruby
645
+ Barcode.enumerate
646
+
647
+ Enables the scanner. barcode_callback get the same parameters as Barcode.take_barcode:
648
+
649
+ :::ruby
650
+ Barcode.enable(url_for(:action => :barcode_callback), {:name=>name_from_enumerate})
651
+
652
+ Callback parameters:
653
+
654
+ * "status" - "ok" or "cancel"
655
+ * "barcode" - recognized barcode string
656
+
657
+ Disables the currently enabled scanner. This reverts the scanner to its default state and flushes any current decoder settings
658
+
659
+ :::ruby
660
+ Barcode.disable
661
+
662
+ Performs a soft trigger start. If the scan does not result in a decode it is necessary to perform a soft stop before another soft start
663
+
664
+ :::ruby
665
+ Barcode.start
666
+
667
+ Performs a soft trigger stop
668
+
669
+ :::ruby
670
+ Barcode.stop
671
+
672
+ Enables the scanner and start scanner. Before callback is called scanner is disabled:
673
+
674
+ :::ruby
675
+ Barcode.take_barcode(url_for(:action => :barcode_callback), {:name=>name_from_enumerate})
676
+
677
+ Callback parameters:
678
+
679
+ * "status" - "ok" or "cancel"
680
+ * "barcode" - recognized barcode string
681
+
682
+ ### Sample
683
+ See controller and view in the /app/BarcodeRecognizerMoto folder of the [System API Samples application](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/BarcodeRecognizerMoto/controller.rb) for more information.
684
+
685
+ ## WebKit browser for Motorola devices
686
+ Rhodes 3.3 and RhoElements 2.0 support Motorola WebKit browser for Windows Mobile, Windows CE and Android (ET1) devices.
687
+
688
+ To enable: install RhoElements gem or RhoStudio and add to build.yml
689
+
690
+ capabilities:
691
+ -motorola
692
+
693
+ extensions: ["webkit-browser"]
694
+
630
695
  ## Signature Capture
631
696
 
632
697
  The Signature Capture API allow take a signature and save it as an image:
@@ -164,7 +164,7 @@ public class RhoLogger {
164
164
  makeStringSize(m_category,15) + "| ";
165
165
  }
166
166
 
167
- private void logMessage( int severity, String msg ){
167
+ public void logMessage( int severity, String msg ){
168
168
  logMessage(severity, msg, null, false );
169
169
  }
170
170
  private void logMessage( int severity, String msg, Throwable e ){
@@ -683,6 +683,9 @@ public class RhoConnection implements IHttpConnection {
683
683
  }else if ( model.equalsIgnoreCase("resetDBOnSyncUserChanged") ){
684
684
  RhoAppAdapter.resetDBOnSyncUserChanged();
685
685
  return true;
686
+ }else if ( model.equalsIgnoreCase("logger") ){
687
+ processLogger();
688
+ return true;
686
689
  }
687
690
 
688
691
  }else if ( application.equalsIgnoreCase("shared") )
@@ -690,6 +693,37 @@ public class RhoConnection implements IHttpConnection {
690
693
 
691
694
  return false;
692
695
  }
696
+
697
+ void processLogger()
698
+ {
699
+ int nLevel = 0;
700
+ String strMsg = "", strCategory = "";
701
+
702
+ Tokenizer oTokenizer = new Tokenizer(uri.getQueryString(), "&");
703
+ while (oTokenizer.hasMoreTokens())
704
+ {
705
+ String tok = oTokenizer.nextToken();
706
+ if (tok.length() == 0)
707
+ continue;
708
+
709
+ if ( tok.startsWith("level=") )
710
+ {
711
+ String strLevel = tok.substring(6);
712
+ nLevel = Integer.parseInt(strLevel);
713
+ }else if ( tok.startsWith("msg=") )
714
+ {
715
+ strMsg = URI.urlDecode(tok.substring(4));
716
+ }else if ( tok.startsWith( "cat=") )
717
+ {
718
+ strCategory = URI.urlDecode(tok.substring(4));
719
+ }
720
+ }
721
+
722
+ RhoLogger log = new RhoLogger(strCategory);
723
+ log.logMessage(nLevel, strMsg );
724
+
725
+ respondOK();
726
+ }
693
727
 
694
728
  void showGeoLocation(){
695
729
  String location = "";
@@ -1306,6 +1306,12 @@ import com.rho.Tokenizer;
1306
1306
  for (int index=0; index < len ; index++)
1307
1307
  {
1308
1308
  char c1 = fullPath.charAt(index);
1309
+ if (c1 == '+')
1310
+ {
1311
+ sb.append(' ');
1312
+ continue;
1313
+ }
1314
+
1309
1315
  if (c1 != '%')
1310
1316
  {
1311
1317
  sb.append(c1);
@@ -102,7 +102,7 @@ public class BrowserAdapter5 implements IBrowserAdapter
102
102
  if ( url.startsWith("http:/") && !url.startsWith("http://") )
103
103
  url = RhodesApp.getInstance().getHomeUrl() + url.substring(5);
104
104
 
105
- if ( RhodesApp.getInstance().isRhodesAppUrl(url) || URI.isLocalData(url) )
105
+ if ( RhodesApp.getInstance().isRhodesAppUrl(url) ) //|| URI.isLocalData(url) )
106
106
  {
107
107
  HttpConnection connection = Utilities.makeConnection(url, request.getHeaders(), null, null);
108
108
 
@@ -275,7 +275,9 @@ public class BrowserAdapter implements RenderingApplication, IBrowserAdapter
275
275
 
276
276
  try
277
277
  {
278
- if (referrer == null || URI.isLocalData(url) || !m_bLoadImageAsync)
278
+ if ( URI.isLocalData(url) )
279
+ SecondaryResourceFetchThread.enqueue(resource, referrer);
280
+ else if (referrer == null || /*URI.isLocalData(url) ||*/ !m_bLoadImageAsync)
279
281
  {
280
282
  boolean bLocalHost = RhodesApp.getInstance().isRhodesAppUrl(url);
281
283
  if ( bLocalHost && m_connResource!= null)
@@ -102,7 +102,7 @@ public class BrowserAdapter5 implements IBrowserAdapter
102
102
  if ( url.startsWith("http:/") && !url.startsWith("http://") )
103
103
  url = RhodesApp.getInstance().getHomeUrl() + url.substring(5);
104
104
 
105
- if ( RhodesApp.getInstance().isRhodesAppUrl(url) || URI.isLocalData(url) )
105
+ if ( RhodesApp.getInstance().isRhodesAppUrl(url) ) //|| URI.isLocalData(url) )
106
106
  {
107
107
  HttpConnection connection = Utilities.makeConnection(url, request.getHeaders(), null, null);
108
108
 
@@ -210,6 +210,9 @@ public class NetworkAccess implements INetworkAccess {
210
210
  return new RhoConnection(uri);
211
211
  }
212
212
 
213
+ if ( URI.isLocalData(url) )
214
+ return new BBHttpConnection((HttpConnection)Connector.open(url));
215
+
213
216
  int fragment = url.indexOf('#');
214
217
  if (-1 != fragment) {
215
218
  url = url.substring(0, fragment);
@@ -609,13 +609,12 @@ int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
609
609
  return 1;
610
610
  }
611
611
  #endif
612
- UIDevice *device = [UIDevice currentDevice];
613
- NSString *version = [device systemVersion];
614
- if ([version length] >= 2 && [[version substringToIndex:2] isEqualToString:@"4."])
612
+ if (get_scale() > 1.2) {
615
613
  *resValue = rho_ruby_create_double(RHO_IPHONE4_PPI);
616
- else
614
+ }
615
+ else {
617
616
  *resValue = rho_ruby_create_double(RHO_IPHONE_PPI);
618
-
617
+ }
619
618
  return 1;
620
619
  }
621
620
  else if (strcasecmp("device_name", szPropName) == 0) {
@@ -403,21 +403,21 @@ VALUE get_camera_info(const char* camera_type) {
403
403
  w = 1600;
404
404
  h = 1200;
405
405
  }
406
- }
406
+ } else
407
407
  if ([platform isEqualToString:@"iPhone1,2"]) {
408
408
  // iPhone 3G
409
409
  if (!isFront) {
410
410
  w = 1600;
411
411
  h = 1200;
412
412
  }
413
- }
413
+ } else
414
414
  if ([platform hasPrefix:@"iPhone2"]) {
415
415
  // iPhone 3GS
416
416
  if (!isFront) {
417
417
  w = 2048;
418
418
  h = 1536;
419
419
  }
420
- }
420
+ } else
421
421
  if ([platform hasPrefix:@"iPhone3"]) {
422
422
  // iPhone 4
423
423
  if (!isFront) {
@@ -428,18 +428,30 @@ VALUE get_camera_info(const char* camera_type) {
428
428
  w = 640;
429
429
  h = 480;
430
430
  }
431
- }
431
+ } else
432
432
  if ([platform hasPrefix:@"iPhone4"]) {
433
- // iPhone 5
433
+ // iPhone 4S
434
434
  if (!isFront) {
435
- w = 2592;
436
- h = 1936;
435
+ w = 2448;
436
+ h = 3264;
437
437
  }
438
438
  else {
439
439
  w = 640;
440
440
  h = 480;
441
441
  }
442
- }
442
+ } else
443
+ if ([platform hasPrefix:@"iPhone"]) {
444
+ // iPhone 5 ?
445
+ if (!isFront) {
446
+ w = 2448;
447
+ h = 3264;
448
+ }
449
+ else {
450
+ w = 640;
451
+ h = 480;
452
+ }
453
+ } else
454
+
443
455
 
444
456
  if ([platform isEqualToString:@"iPod1,1"]) {
445
457
  // iPod Touch 1
@@ -38,7 +38,7 @@
38
38
  <key>CFBundleSignature</key>
39
39
  <string>????</string>
40
40
  <key>CFBundleVersion</key>
41
- <string>3.2.1</string>
41
+ <string>3.3.0</string>
42
42
  <key>LSRequiresIPhoneOS</key>
43
43
  <true/>
44
44
  <key>UILaunchImageFile</key>
@@ -43,6 +43,7 @@
43
43
  #include "rubyext/GeoLocation.h"
44
44
  #include "common/app_build_configs.h"
45
45
  #include "unzip/unzip.h"
46
+ #include "common/Tokenizer.h"
46
47
 
47
48
  #include <algorithm>
48
49
 
@@ -664,6 +665,36 @@ static void callback_syncdb(void *arg, String const &/*query*/ )
664
665
  rho_http_sendresponse(arg, "");
665
666
  }
666
667
 
668
+ static void callback_logger(void *arg, String const &query )
669
+ {
670
+ int nLevel = 0;
671
+ String strMsg, strCategory;
672
+
673
+ CTokenizer oTokenizer(query, "&");
674
+ while (oTokenizer.hasMoreTokens())
675
+ {
676
+ String tok = oTokenizer.nextToken();
677
+ if (tok.length() == 0)
678
+ continue;
679
+
680
+ if ( String_startsWith( tok, "level=") )
681
+ {
682
+ String strLevel = tok.substr(6);
683
+ convertFromStringA( strLevel.c_str(), nLevel );
684
+ }else if ( String_startsWith( tok, "msg=") )
685
+ {
686
+ strMsg = rho::net::URI::urlDecode(tok.substr(4));
687
+ }else if ( String_startsWith( tok, "cat=") )
688
+ {
689
+ strCategory = rho::net::URI::urlDecode(tok.substr(4));
690
+ }
691
+ }
692
+
693
+ rhoPlainLog( "", 0, nLevel, strCategory.c_str(), strMsg.c_str() );
694
+
695
+ rho_http_sendresponse(arg, "");
696
+ }
697
+
667
698
  static void callback_redirect_to(void *arg, String const &strQuery )
668
699
  {
669
700
  size_t nUrl = strQuery.find("url=");
@@ -761,6 +792,7 @@ void CRhodesApp::initHttpServer()
761
792
  m_httpServer->register_uri("/system/loadserversources", callback_loadserversources);
762
793
  m_httpServer->register_uri("/system/resetDBOnSyncUserChanged", callback_resetDBOnSyncUserChanged);
763
794
  m_httpServer->register_uri("/system/loadallsyncsources", callback_loadallsyncsources);
795
+ m_httpServer->register_uri("/system/logger", callback_logger);
764
796
  }
765
797
 
766
798
  const char* CRhodesApp::getFreeListeningPort()
@@ -230,6 +230,11 @@ String URI::urlEncode(const String& fullPath)
230
230
  /*static*/ void URI::urlDecode(const String &url, String& ret )
231
231
  {
232
232
  for (const char *s = url.c_str(); *s != '\0'; ++s) {
233
+ if (*s == '+') {
234
+ ret.push_back(' ');
235
+ continue;
236
+ }
237
+
233
238
  if (*s != '%') {
234
239
  ret.push_back(*s);
235
240
  continue;
@@ -28,6 +28,7 @@ SOURCES += \
28
28
  ../../shared/common/RhodesApp.cpp \
29
29
  ../../shared/common/RhoConf.cpp \
30
30
  ../../shared/common/AppMenu.cpp \
31
+ ../../shared/common/BundleManager.cpp \
31
32
  ../../shared/logging/RhoPlainLog.cpp \
32
33
  ../../shared/logging/RhoLogSink.cpp \
33
34
  ../../shared/logging/RhoLogConf.cpp \
Binary file
data/version CHANGED
@@ -1 +1 @@
1
- 3.3.0.beta.1
1
+ 3.3.0.beta.2
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: 62196465
4
+ hash: 62196471
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - beta
11
- - 1
12
- version: 3.3.0.beta.1
11
+ - 2
12
+ version: 3.3.0.beta.2
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-12-24 00:00:00 -08:00
20
+ date: 2011-12-27 00:00:00 -08:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -1063,6 +1063,7 @@ files:
1063
1063
  - lib/test/rho_stubs.rb
1064
1064
  - lib/test/syncdb.sqlite
1065
1065
  - LICENSE
1066
+ - Manifest.txt
1066
1067
  - platform/android/build/android.rake
1067
1068
  - platform/android/build/android_tools.rb
1068
1069
  - platform/android/build/androidcommon.rb
@@ -4942,6 +4943,7 @@ files:
4942
4943
  - res/icons/rhosim.psd
4943
4944
  - rhobuild.yml.example
4944
4945
  - rhodes.gemspec
4946
+ - rhomobile-debug-1.0.6.gem
4945
4947
  - rhomobile-debug.gemspec
4946
4948
  - spec/framework_spec/app/application.rb
4947
4949
  - spec/framework_spec/app/index.erb