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
data/Manifest.txt CHANGED
@@ -938,6 +938,7 @@ lib/framework/rhom/rhom_object.rb
938
938
  lib/framework/rhom/rhom_object_factory.rb
939
939
  lib/framework/rhom/rhom_source.rb
940
940
  lib/framework/rhom.rb
941
+ lib/framework/rhomotoapi.rb
941
942
  lib/framework/rhosystem.rb
942
943
  lib/framework/singleton.rb
943
944
  lib/framework/stringio.rb
@@ -973,6 +974,7 @@ platform/android/Rhodes/jni/Android.mk
973
974
  platform/android/Rhodes/jni/Application.mk
974
975
  platform/android/Rhodes/jni/genconfig.h
975
976
  platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc
977
+ platform/android/Rhodes/jni/include/rhodes/fileapi.h
976
978
  platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_alert_Alert.h
977
979
  platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_alert_PopupActivity.h
978
980
  platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_bluetooth_RhoBluetoothManager.h
@@ -1106,12 +1108,13 @@ platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java
1106
1108
  platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java
1107
1109
  platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java
1108
1110
  platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java
1111
+ platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java
1109
1112
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java
1110
1113
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java
1111
1114
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java
1112
1115
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java
1116
+ platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java
1113
1117
  platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java
1114
- platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java
1115
1118
  platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java
1116
1119
  platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java
1117
1120
  platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java
@@ -1879,6 +1882,8 @@ platform/iphone/Classes/DateTime.m
1879
1882
  platform/iphone/Classes/DateTimePicker.m
1880
1883
  platform/iphone/Classes/DateTimePickerDelegate.h
1881
1884
  platform/iphone/Classes/DateTimePickerDelegate.m
1885
+ platform/iphone/Classes/DateTimePickerViewController.h
1886
+ platform/iphone/Classes/DateTimePickerViewController.m
1882
1887
  platform/iphone/Classes/Dispatcher/Dispatcher.c
1883
1888
  platform/iphone/Classes/Dispatcher/Dispatcher.h
1884
1889
  platform/iphone/Classes/Event/Event.h
@@ -4478,6 +4483,8 @@ platform/wp7/rhodes/Properties/AssemblyInfo.cs
4478
4483
  platform/wp7/rhodes/Properties/WMAppManifest.xml
4479
4484
  platform/wp7/rhodes/Rhodes.csproj
4480
4485
  platform/wp7/rhodes/SplashScreenImage.jpg
4486
+ platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Cancel.png
4487
+ platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Check.png
4481
4488
  platform/wp7/rhodes.sln
4482
4489
  platform/wp7/RhoLogServer/Program.cs
4483
4490
  platform/wp7/RhoLogServer/Properties/AssemblyInfo.cs
@@ -4490,6 +4497,7 @@ platform/wp7/RhoRubyExtGen/RhoAsyncHttp.cs
4490
4497
  platform/wp7/RhoRubyExtGen/RhoCamera.cs
4491
4498
  platform/wp7/RhoRubyExtGen/RhoConfig.cs
4492
4499
  platform/wp7/RhoRubyExtGen/RhoDatabase.cs
4500
+ platform/wp7/RhoRubyExtGen/RhoDateTimePicker.cs
4493
4501
  platform/wp7/RhoRubyExtGen/RhoJSON.cs
4494
4502
  platform/wp7/RhoRubyExtGen/RhoNativeBar.cs
4495
4503
  platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj
@@ -4548,6 +4556,7 @@ platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs
4548
4556
  platform/wp7/RhoRubyLib/rubyext/RhoCamera.cs
4549
4557
  platform/wp7/RhoRubyLib/rubyext/RhoConfig.cs
4550
4558
  platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs
4559
+ platform/wp7/RhoRubyLib/rubyext/RhoDateTimePicker.cs
4551
4560
  platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs
4552
4561
  platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs
4553
4562
  platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs
@@ -4562,6 +4571,8 @@ platform/wp7/RhoRubyLib/sync/SyncNotify.cs
4562
4571
  platform/wp7/RhoRubyLib/sync/SyncProtocol_3.cs
4563
4572
  platform/wp7/RhoRubyLib/sync/SyncSource.cs
4564
4573
  platform/wp7/RhoRubyLib/sync/SyncThread.cs
4574
+ platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml
4575
+ platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml.cs
4565
4576
  platform/wp7/RhoRubyLib/views/RhoTabHeader.xaml
4566
4577
  platform/wp7/RhoRubyLib/views/RhoTabHeader.xaml.cs
4567
4578
  platform/wp7/RhoRubyLib/views/RhoView.xaml
@@ -4677,6 +4688,7 @@ res/build-tools/iphonesim/Source/main.m
4677
4688
  res/build-tools/iphonesim/Source/nsprintf.h
4678
4689
  res/build-tools/iphonesim/Source/nsprintf.m
4679
4690
  res/build-tools/make.exe
4691
+ res/build-tools/Microsoft.Phone.Controls.Toolkit.dll
4680
4692
  res/build-tools/RhoAppRunner.exe
4681
4693
  res/build-tools/rhodes_pid.key
4682
4694
  res/build-tools/RhoLogServer.exe
@@ -4698,6 +4710,8 @@ res/build-tools/swig_patch/README
4698
4710
  res/build-tools/wmdc_connect.exe
4699
4711
  res/build-tools/wp7explorer.exe
4700
4712
  res/build-tools/xruby-0.3.3.jar
4713
+ res/build-tools/yuicompressor-2.4.7.jar
4714
+ res/build-tools/YUICompressorLicense.txt
4701
4715
  res/generators/rhogen.rb
4702
4716
  res/generators/templates/application/app/application.rb
4703
4717
  res/generators/templates/application/app/helpers/application_helper.rb
@@ -4803,6 +4817,7 @@ res/generators/templates/application/public/js/jquery-wp7-patch.js
4803
4817
  res/generators/templates/application/public/js/rho.js
4804
4818
  res/generators/templates/application/public/js/rhogeolocation-wm.js
4805
4819
  res/generators/templates/application/public/js/rhogeolocation.js
4820
+ res/generators/templates/application/public/js/syncengine.js
4806
4821
  res/generators/templates/application/public/js/wp7.js
4807
4822
  res/generators/templates/application/Rakefile
4808
4823
  res/generators/templates/application/rhoconfig.txt
data/Rakefile CHANGED
@@ -150,8 +150,6 @@ def make_application_build_capabilities_header_file
150
150
  Jake.modify_file_if_content_changed(File.join($startdir, "platform", "shared", "common", "app_build_capabilities.h"), f)
151
151
  end
152
152
 
153
-
154
-
155
153
  def make_application_build_config_java_file
156
154
 
157
155
  f = StringIO.new("", "w+")
@@ -265,15 +263,12 @@ namespace "config" do
265
263
 
266
264
  application_build_configs = {}
267
265
 
268
- #Process motorola extensions
269
- if capabilities.index("motorola")
270
- $app_config["capabilities"] += ["webkit_browser"] if $app_config["extensions"].index("webkit-browser")
271
- $app_config["extensions"] += ["rhoelements"]
272
-
273
- idx_barcode = $app_config["extensions"].index("barcode")
274
- $app_config["extensions"][idx_barcode] = "barcode-moto" if idx_barcode
275
-
276
- $app_config["capabilities"] += ["barcode"] if $app_config["extensions"].index("barcode-moto")
266
+ #Process rhoelements settings
267
+ if $app_config["app_type"] == 'rhoelements'
268
+ $app_config["capabilities"] += ["motorola"] unless $app_config["capabilities"].index("motorola")
269
+ $app_config["extensions"] += ["rhoelementsext"] if $current_platform == 'wm'
270
+ $app_config["extensions"] += ["motoapi"] #extension with plug-ins
271
+ $app_config["extensions"] += ['webkit-browser'] unless $app_config["extensions"].index("webkit-browser")
277
272
 
278
273
  #check for RE2 plugins
279
274
  plugins = ""
@@ -284,7 +279,20 @@ namespace "config" do
284
279
  end
285
280
  end
286
281
 
282
+ if plugins.length() == 0
283
+ plugins = "ALL"
284
+ end
285
+
287
286
  application_build_configs['moto-plugins'] = plugins if plugins.length() > 0
287
+
288
+ end
289
+
290
+ if $app_config["capabilities"].index("motorola")
291
+ if $app_config["extensions"].index("webkit-browser")
292
+ $app_config["capabilities"] += ["webkit_browser"]
293
+ $app_config["extensions"].delete("webkit-browser")
294
+ end
295
+ $app_config["extensions"] += ["rhoelements"]
288
296
  end
289
297
 
290
298
  puts "$app_config['extensions'] : #{$app_config['extensions'].inspect}"
@@ -318,6 +326,10 @@ namespace "config" do
318
326
  $rhologhostport = 52363 unless $rhologhostport
319
327
  $rhologhostaddr = Jake.localip()
320
328
 
329
+ $obfuscate_js = (($app_config["obfuscate"].nil? || $app_config["obfuscate"]["js"].nil?) ? nil : 1 )
330
+ $obfuscate_css = (($app_config["obfuscate"].nil? || $app_config["obfuscate"]["css"].nil?) ? nil : 1 )
331
+ $obfuscate_exclude = ($app_config["obfuscate"].nil? ? nil : $app_config["obfuscate"]["exclude_dirs"] )
332
+ $obfuscator = 'res/build-tools/yuicompressor-2.4.7.jar'
321
333
  end
322
334
 
323
335
  task :qt do
@@ -401,6 +413,8 @@ def set_linker_flags
401
413
  end
402
414
 
403
415
  def add_extension(path,dest)
416
+ puts 'add_extension - ' + path.to_s + " - " + dest.to_s
417
+
404
418
  start = pwd
405
419
  chdir path if File.directory?(path)
406
420
 
@@ -417,6 +431,8 @@ def init_extensions(startdir, dest)
417
431
 
418
432
  puts 'init extensions'
419
433
  $app_config["extensions"].each do |extname|
434
+ puts 'ext - ' + extname
435
+
420
436
  extpath = nil
421
437
  extpaths.each do |p|
422
438
  ep = File.join(p, extname)
@@ -425,19 +441,24 @@ def init_extensions(startdir, dest)
425
441
  break
426
442
  end
427
443
  end
444
+
445
+ puts '1'
428
446
 
429
447
  if extpath.nil?
430
448
  begin
431
449
  $rhodes_extensions = nil
432
450
  require extname
433
- extpath = $rhodes_extensions[0] unless $rhodes_extensions.nil?
434
- $app_config["extpaths"] << extpath
451
+ puts '1-2'
452
+ if $rhodes_extensions
453
+ extpath = $rhodes_extensions[0]
454
+ $app_config["extpaths"] << extpath
455
+ end
435
456
  rescue Exception => e
436
457
  puts "exception"
437
458
  end
438
459
  end
439
-
440
- unless extpath.nil?
460
+
461
+ unless extpath.nil?
441
462
  add_extension(extpath, dest) unless dest.nil?
442
463
 
443
464
  if $config["platform"] != "bb"
@@ -469,8 +490,10 @@ def init_extensions(startdir, dest)
469
490
  extlibs += libs
470
491
  end
471
492
  end
472
- end
493
+ end
494
+
473
495
  end
496
+
474
497
  end
475
498
 
476
499
  exts = File.join($startdir, "platform", "shared", "ruby", "ext", "rho", "extensions.c")
@@ -519,6 +542,8 @@ def init_extensions(startdir, dest)
519
542
  nativelib.each { |lib| add_linker_library(lib) }
520
543
 
521
544
  set_linker_flags
545
+
546
+ #exit
522
547
  end
523
548
 
524
549
  unless $app_config["constants"].nil?
@@ -539,6 +564,28 @@ def init_extensions(startdir, dest)
539
564
 
540
565
  end
541
566
 
567
+ def public_folder_cp_r(src_dir,dst_dir,level,obfuscate)
568
+ mkdir_p dst_dir if not File.exists? dst_dir
569
+ Dir.foreach(src_dir) do |filename|
570
+ next if filename.eql?('.') || filename.eql?('..')
571
+ filepath = src_dir + '/' + filename
572
+ dst_path = dst_dir + '/' + filename
573
+ if File.directory?(filepath)
574
+ public_folder_cp_r(filepath,dst_path,(level+1),((obfuscate==1) && ((level>0) || $obfuscate_exclude.nil? || !$obfuscate_exclude.include?(filename)) ? 1 : 0))
575
+ else
576
+ if (obfuscate==1) && (((!$obfuscate_js.nil?) && File.extname(filename).eql?(".js")) || ((!$obfuscate_css.nil?) && File.extname(filename).eql?(".css")))
577
+ puts Jake.run('java',['-jar', $obfuscator, filepath, '-o', dst_path])
578
+ unless $? == 0
579
+ puts "Obfuscation error"
580
+ exit 1
581
+ end
582
+ else
583
+ cp filepath, dst_path, :preserve => true
584
+ end
585
+ end
586
+ end
587
+ end
588
+
542
589
  def common_bundle_start(startdir, dest)
543
590
  puts "common_bundle_start"
544
591
 
@@ -569,8 +616,14 @@ def common_bundle_start(startdir, dest)
569
616
  chdir startdir
570
617
  #throw "ME"
571
618
  cp_r app + '/app',File.join($srcdir,'apps'), :preserve => true
572
- cp_r app + '/public', File.join($srcdir,'apps'), :preserve => true if File.exists? app + '/public'
573
- cp app + '/rhoconfig.txt', File.join($srcdir,'apps'), :preserve => true
619
+ if File.exists? app + '/public'
620
+ if $obfuscate_js.nil? && $obfuscate_css.nil?
621
+ cp_r app + '/public', File.join($srcdir,'apps'), :preserve => true
622
+ else
623
+ public_folder_cp_r app + '/public', File.join($srcdir,'apps/public'), 0, 1
624
+ end
625
+ end
626
+ cp app + '/rhoconfig.txt', File.join($srcdir,'apps'), :preserve => true
574
627
 
575
628
  app_version = "\r\napp_version='#{$app_config["version"]}'"
576
629
  File.open(File.join($srcdir,'apps/rhoconfig.txt'), "a"){ |f| f.write(app_version) }
@@ -601,7 +654,7 @@ def common_bundle_start(startdir, dest)
601
654
  end
602
655
 
603
656
  Dir.glob("**/*.wm.*").each { |f| rm f }
604
- Dir.glob("**/*.wp7.*").each { |f| rm f }
657
+ Dir.glob("**/*.wp7.*").each { |f| rm f }
605
658
  Dir.glob("**/*.iphone.*").each { |f| rm f }
606
659
  Dir.glob("**/*.bb.*").each { |f| rm f }
607
660
  Dir.glob("**/*.bb6.*").each { |f| rm f }
@@ -637,11 +690,11 @@ def process_exclude_folders
637
690
  excl << $config["excludedirs"][exclude_platform] if $config["excludedirs"][exclude_platform]
638
691
  end
639
692
 
640
- if excl
641
- chdir File.join($srcdir, 'apps')
693
+ if excl.size() > 0
694
+ chdir File.join($srcdir)#, 'apps')
642
695
 
643
696
  excl.each do |mask|
644
- Dir.glob(mask).each {|f| rm_rf f}
697
+ Dir.glob(mask).each {|f| puts "f: #{f}"; rm_rf f}
645
698
  end
646
699
  end
647
700
 
@@ -824,21 +877,17 @@ namespace "build" do
824
877
  sh %{zip -r upgrade_bundle.zip .}
825
878
  end
826
879
 
827
-
828
880
  cp new_zip_file, $bindir
829
881
 
830
882
  rm new_zip_file
831
883
 
832
-
833
-
834
884
  end
835
885
 
836
-
837
-
886
+
838
887
  task :noiseq do
839
888
  app = $app_path
840
889
  rhodeslib = File.dirname(__FILE__) + "/lib/framework"
841
- compileERB = "lib/build/compileERB/bb.rb"
890
+ compileERB = "lib/build/compileERB/bb.rb"
842
891
  startdir = pwd
843
892
  dest = $srcdir + "/lib"
844
893
 
data/doc/build.txt CHANGED
@@ -1,4 +1,4 @@
1
- # Build Rhodes Application
1
+ # Build Rhodes Application
2
2
 
3
3
  This page describes how to build Rhodes Application on all of our supported platforms: iPhone, RIM Blackberry, Windows Mobile and Android.
4
4
 
@@ -1103,7 +1103,7 @@ Rholog.txt is placed in `<rhodes folder>\platform\wm\bin\win32\rhodes\Debug\rho`
1103
1103
  * Follow [All Platforms Prerequisites](#all-platforms-prerequisites)
1104
1104
  * Windows 7 OS
1105
1105
  * Visual Studio 2010 installed or VS Express for Windows Phone and VS Express for C#
1106
- * [Windows Phone Developer Tools 7.1 Beta](http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11321)
1106
+ * [Windows Phone SDK 7.1](http://www.microsoft.com/download/en/details.aspx?id=27570)
1107
1107
 
1108
1108
  * Add path to `msbuild` to `rhobuild.yml` in rhodes folder. For example:
1109
1109
 
@@ -1161,7 +1161,9 @@ NOTE: in form action when using url_for specify :action => :create to call creat
1161
1161
 
1162
1162
  $rake run:wp
1163
1163
 
1164
- * Run application device:
1164
+ NOTE: You may use your computer keyboard with Windows Phone 7 emulator. By default it is disabled, but you can enable it pressing **PgUp** key. While it is enabled a device rotation simulation is not supported. To rotate device you need to disable keyboard support pressing **PgDown** key. Look [MSDN page](http://msdn.microsoft.com/en-us/library/ff754352(v=vs.92).aspx) for much more details on this topic.
1165
+
1166
+ * Run application device:
1165
1167
 
1166
1168
  $rake run:wp:device
1167
1169
 
@@ -46,6 +46,19 @@ Run application with special parameter:
46
46
  :::ruby
47
47
  System::run_app( 'app_name', "security_token=123" )
48
48
 
49
+ ### JavaScript and CSS Obfuscation
50
+
51
+ To enable JavaScript and/or CSS code obfuscation at `public` folder of Rhodes application just add the following lines to the build.yml:
52
+
53
+ obfuscate:
54
+ js: yes
55
+ css: yes
56
+ exclude_dirs: ["jqmobile", "jqtouch", "jquery"]
57
+
58
+ If JavaScript or CSS code obfuscation is not required, then just omit `js` or `css` line accordingly.
59
+
60
+ NOTE: The `jqmobile`, `jqtouch`, and `jquery` folders <b>must</b> be excluded when obfuscation is enabled, because the obfuscated versions of these libraries are there already.
61
+
49
62
  ## Run time configuration
50
63
  Each Rhodes application contains a configuration file called "rhoconfig.txt". A typical rhoconfig.txt will look like the following when an app is generated:
51
64
 
data/doc/device-caps.txt CHANGED
@@ -191,7 +191,7 @@ See the [Configuration](configuration#build-time-configuration) section for more
191
191
 
192
192
  The GPS receiver consumes a significant amount of energy, and should be switched off most of the time in order to preserve the device's battery life.
193
193
  Any call to GeoLocation method or notification call back will power up the GPS receiver.
194
- The GPS receiver will be switched off authomatically after some time (see [Configuration](configuration#run-time-configuration) for parameters) or explicitly by GeoLocation.turnoff.
194
+ The GPS receiver will be switched off automatically after some time (see [Configuration](configuration#run-time-configuration) for parameters) or explicitly by GeoLocation.turnoff.
195
195
  Also note that it usually takes a while to acquire the device's current position; in some cases, it may take several minutes and may not work at all indoors.
196
196
 
197
197
  Note that in old rhodes versions (up to 2.3.1) this feature uses only GPS location provider. In more recent rhodes, it also uses network based location determination. Network based location
@@ -200,7 +200,7 @@ Rhodes will update location using network data until the GPS signal has been rec
200
200
 
201
201
  There are two ways to use GeoLocation.
202
202
 
203
- * Syncronous call to GeoLocation module for particular value.
203
+ * Synchronous call to GeoLocation module for particular value.
204
204
  * Set GeoLocation notification and track location by call back. In this case all location values are passed to notification as parameters.
205
205
 
206
206
  Note that GeoLocation is switched off automatically when the application goes into the background, and is switched on as the application goes back to foreground.
@@ -246,18 +246,28 @@ Set callback to track location changes.
246
246
  callback, callback_param="", ping_gpssystem_timeout=0)
247
247
 
248
248
  * callback - callback url; after the callback has been called once, it will be automatically called repeatedly with the current location coordinates passed to the callback as parameters. (You need not reset the callback within the callback.)
249
+ * callback_param: known_position, latitude, longitude, available, status, error_code, accuracy
249
250
  * ping_gpssystem_timeout - optional, if 0 system timeout used, use to redefine timeout in sec for gps system reading
250
- * callback params: known_position, latitude, longitude, available, status('error', 'ok'), error_code(from RhoError), accuracy(horizontal radius in meters; iOS and Android)
251
+
252
+ Here are the callback parameters for the set_notification callback.
253
+
254
+ * known_position - 1 or 0.
255
+ * latitude
256
+ * longitude
257
+ * available - 1 or 0. Availability of GeoLocation: not only does the hardware exist, but also the user can turn GPS off in phone settings, or not allowed GPS activity on iPhone, etc.)
258
+ * status - 'error' or 'ok'
259
+ * error_code - from RhoError.
260
+ * accuracy - horizontal radius in meters; iOS and Android.
251
261
 
252
262
  **NOTE: You should call GeoLocation.set_notification only once. The current behavior of the callback is that it will be called forever until it is stopped; you need to call `GeoLocation.turnoff` to stop it. The previous behavior was that the callback was called once and needed to be reset.**
253
263
 
254
264
  Also there are two parameters you can set in rhoconfig.txt:
255
265
 
256
- Geo location update period (in seconds). Used as the default value for the third parameter (ping_gpssystem_timeout) of GeoLocation.set_notification method. This value is passed to OS API and behaviour and is OS dependent (it should be used by system as a tip on how often to call notification back). Ignored on iOS.
266
+ GeoLocation update period (in seconds): `gps_ping_timeout_sec`. Used as the default value for the third parameter (ping_gpssystem_timeout) of GeoLocation.set_notification method. This value is passed to OS API and behaviour and is OS dependent (it should be used by system as a tip on how often to call notification back). Ignored on iOS.
257
267
 
258
268
  gps_ping_timeout_sec = 30
259
269
 
260
- Geo location inactivity timeout (in seconds). This parameter controls the time after that location service is switched off in case there are no calls to the service. It is also used as the time period to drop cached location value.
270
+ GeoLocation inactivity timeout (in seconds): `geo_location_inactivity_timeout`. This parameter controls the time after that location service is switched off in case there are no calls to the service. It is also used as the time period to drop cached location value.
261
271
 
262
272
  geo_location_inactivity_timeout = gps_ping_timeout_sec * 10
263
273
 
@@ -275,7 +285,7 @@ Get the distance between two points in miles.
275
285
 
276
286
  GeoCoding: You can use any free web service for direct and reverse geocoding. See our complete example of using Google geocoding web service in [Rhodes-System-Api-Samples example](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/GeoCoding).
277
287
 
278
- **NOTE: On iOS, real GPS starts working after the first access to the GeoLocation module. Real GPS hardware is switched off after a call to GeoLocation.turnoff. But keep in mind - any call to GeoLocation, such as getting latitude, starts the hardware GPS again!**
288
+ **NOTE: On iOS and Android, real GPS starts working after the first access to the GeoLocation module. Real GPS hardware is switched off after a call to GeoLocation.turnoff. But keep in mind - any call to GeoLocation, such as getting latitude, starts the hardware GPS again!**
279
289
 
280
290
  #### Testing GeoLocation
281
291
 
@@ -1035,9 +1045,10 @@ Automatic push message parameters handling takes its place in case no custom pus
1035
1045
  "rho_push"
1036
1046
  end
1037
1047
 
1038
-
1039
1048
  ### iPhone
1040
- iPhone PUSH support uses the Apple Push Notification Service (APNS) introduced in iPhone SDK 3.0. In order to use the service, you will need to obtain a push-enabled provisioning profile and a server-side push certificate used for encrypting RhoConnect->APNS traffic.
1049
+ <a id="iphone-push-setup"></a>iPhone PUSH support uses the Apple Push Notification Service (APNS) introduced in iPhone SDK 3.0. In order to use the service, you will need to obtain a push-enabled provisioning profile and a server-side push certificate used for encrypting RhoConnect->APNS traffic.
1050
+
1051
+ In case of iPhone, regardless of the operation, the user will be presented with the option to activate the application if it is not running.
1041
1052
 
1042
1053
  **NOTE: For testing push, you will need to build and deploy your application to a physical iPhone (or iPad) device. Apple does not support testing push on simulators.**
1043
1054
 
@@ -1063,10 +1074,13 @@ Setting up the device is the same process as [building any normal Rhodes applica
1063
1074
 
1064
1075
  2010-08-19 10:14:22.627 rhorunner[1486:307] Device token is <10fd92ab fa8ee481 55d9af6e 73290863 22b323fd 0d18fdbd 19e92d03 c0fef7c8>
1065
1076
 
1066
- This confirms that your application is running with push enabled. Once you login to the RhoConnect application and sync, you will see the device registered on the RhoConnect console under the user id you used to login. Now you are ready to [test push from your RhoConnect application](/rhoconnect/push#testing-push-in-the-web-console).
1077
+ This confirms that your application is running with push enabled. Once you login to the RhoConnect application and sync, you will see the device registered on the RhoConnect console under the user id you used to login. Now you are ready to [test push from your RhoConnect application](/rhoconnect/push-server-setup#testing-push-in-the-rhoconnect-web-console).
1078
+
1079
+ #### Alert Audio File Setup for iPhone
1080
+ In case of iPhone, audio files for the push alert should be placed in the `/public/alerts` folder and build script will copy them into root of the application main bundle (iPhone wouldn't play file from any other place).
1067
1081
 
1068
1082
  ### Android
1069
- Android PUSH support uses the Android Cloud to Device Messaging (AC2DM) system introduced in Android 2.2 (Froyo). In order to use the service, you will need to register your role-based google account (or use existing one) and then register this account in [Google C2DM program](http://code.google.com/android/c2dm/signup.html).
1083
+ <a id="android-push-setup"></a>Android PUSH support uses the Android Cloud to Device Messaging (AC2DM) system introduced in Android 2.2 (Froyo). In order to use the service, you will need to register your role-based google account (or use existing one) and then register this account in [Google C2DM program](http://code.google.com/android/c2dm/signup.html).
1070
1084
 
1071
1085
  Here are some guidelines for developing and testing an Android application that uses the C2DM feature:
1072
1086
 
@@ -1086,7 +1100,7 @@ Then modify your application's build.yml and specify there google account used t
1086
1100
  sender: push-app@gmail.com
1087
1101
 
1088
1102
 
1089
- This is the same address used by RhoConnect to retrieve authtoken. See [here](/rhoconnect/push#android) for more information.
1103
+ This is the same address used by RhoConnect to retrieve authtoken. See [here](/rhoconnect/push-server-setup#testing-push-in-the-rhoconnect-web-console) for more information.
1090
1104
 
1091
1105
  **NOTE: WARNING! This e-mail address MUST NOT be the same as origin of google account on phone! This mean that google account registered on your phone/emulator MUST NOT be push-app@gmail.com; it MUST be another one. This is known bug in Android C2DM implementation - if sender and receiver are the same, underlying android service crash and lose message. More details [here](http://groups.google.com/group/android-c2dm/browse_thread/thread/128790789c4e9d6a/67aca1e1764724d4). This is actual not for all Android versions.**
1092
1106
 
@@ -1100,15 +1114,16 @@ If no push notification mode is specified in build.yml then no notifications are
1100
1114
  android:
1101
1115
  push:
1102
1116
  notification: background
1103
-
1104
1117
 
1105
1118
  ### BlackBerry
1106
- Notifications to BlackBerry are sent using PAP 2.0 message through a BES/MDS server.
1119
+ <a id="blackberry-push-setup"></a>Notifications to BlackBerry are sent using PAP 2.0 message through a BES/MDS server.
1107
1120
 
1108
1121
  On the simulator, this is done via the MDS simulator tool (which you've probably already seen in the form of a console window everytime you do 'rake run:bb'). On the device, this is done through the BES/MDS server that the phone is configured to use.
1109
1122
 
1110
1123
  These instructions assume you are familiar with BES/MDS concepts (for more information please see [here](http://na.blackberry.com/eng/services/business/server/full/)).
1111
1124
 
1125
+ In case of Blackberry, if the application is in the background, an alert operation will bring the application upfront; other operations will not.
1126
+
1112
1127
  #### Setup MDS Simulator
1113
1128
  <i>Make sure you close the BlackBerry simulator and MDS simulator before continuing for your changes to take effect!</i>
1114
1129
 
@@ -1125,7 +1140,7 @@ To listen for incoming messages on BlackBerry, the Rhodes application will start
1125
1140
 
1126
1141
  **NOTE: For testing push, the BlackBerry simulator requires a 'kickstart' process. When the simulator starts, open the web browser on the simulator and navigate to any web page (i.e. http://m.google.com/). Now your simulator is ready to receive push messages.**
1127
1142
 
1128
- Now you are ready to [testing Push in the RhoConnect Web Console](/rhoconnect/push#testing-push-in-the-web-console).
1143
+ Now you are ready to [testing Push in the RhoConnect Web Console](/rhoconnect/push-server-setup#testing-push-in-the-rhoconnect-web-console).
1129
1144
 
1130
1145
  #### Setup BlackBerry Device
1131
1146
  To test push on a BlackBerry device, you will need to use a device that is configured with a BES server. Then, all you need to do is [build your Rhodes application for the device](build#build-for-blackberry).
@@ -1144,6 +1159,9 @@ These parameters from [PushApplicationDescriptor](http://www.blackberry.com/deve
1144
1159
  push_service_appname = 'RhoTest'
1145
1160
  push_service_type = 'BPAS'
1146
1161
 
1162
+ #### Alert Audio File Setup for Blackberry
1163
+ In case of Blackberry, if the audio file is in the public folder, the file name will be `/apps/public/alerts/test-file.mp3`.
1164
+
1147
1165
  ### Push Callback
1148
1166
  Rhodes applications can also handle PUSH notifications that didn't come from a RhoConnect application.
1149
1167
 
@@ -1175,10 +1193,7 @@ Example:
1175
1193
  ### Push Payload
1176
1194
  The Rhodes push payload allows more than one operation in a single message.
1177
1195
 
1178
- There are no required operations. There are default operations - if operation is not specified, no default operation will be performed.
1179
-
1180
- In case of Blackberry if application in background, alert operation will bring application upfront; other operations will not.
1181
- In case of iPhone, regardless of operation, user will be presented with option to activate application if it is not running.
1196
+ There are no required operations. There are default operations - if operation is not specified, no default operation will be performed.
1182
1197
 
1183
1198
  Payload may include following operations which client will perform when it receives the PUSH message:
1184
1199
 
@@ -1193,24 +1208,22 @@ alert - bring app upfront and show specified message
1193
1208
 
1194
1209
  vibrate - vibrate for the specified number of milliseconds, up to 25500; if 0 or no duration is specified, it will vibrate for 2500 millisecond.
1195
1210
 
1196
- To enable vibrate in your rhodes application in build.yml:
1211
+ To enable vibrate in your rhodes application in build.yml:
1197
1212
 
1198
- capabilities:
1199
- - vibrate
1213
+ capabilities:
1214
+ - vibrate
1200
1215
 
1201
- Example of vibrate call:
1216
+ Example of vibrate call:
1202
1217
 
1203
- vibrate = 2000 #=> duration in milliseconds
1218
+ vibrate = 2000 #=> duration in milliseconds
1204
1219
 
1205
1220
  sound - play specified file if media type supported by the phone. iPhone will ignore media-type parameter.
1206
1221
  :::ruby
1207
1222
  sound = "hello.mp3"
1208
1223
 
1209
- File should be included to the application bundle in `/public/alerts` folder
1224
+ File should be included to the application bundle in `/public/alerts` folder.
1210
1225
 
1211
- In case of Blackberry, if file is in public folder, file name will be `/apps/public/alerts/test-file.mp3` Media type should be either specified explicitly or may be recognized from file extension. Known file extensions are: .mp3 - audio/mpeg; .wav - audio/x-wav
1212
-
1213
- In case of iPhone, audio files should be placed in the `/public/alerts` folder and build script will copy them into root of the application main bundle (iPhone wouldn't play file from any other place).
1226
+ Media type should be either specified explicitly or may be recognized from file extension. Known file extensions are: .mp3 - audio/mpeg; .wav - audio/x-wav.
1214
1227
 
1215
1228
  ## Alerts
1216
1229
 
@@ -1469,6 +1482,12 @@ Annotations - array of map annotation objects (list of pins on the map). Annotat
1469
1482
  * image_y_offset - int vertical coordinate of image anchor (ancor point placed to annotation point on map). Set image height/2 for center
1470
1483
  * pass_location - then true, location coordinates added to url in the format: latitude=xx.xxx&longitude=xx.xxx
1471
1484
 
1485
+ Map settings in rhoconfig.txt :
1486
+
1487
+ * ESRI_map_url_roadmap - URL of ESRI roadmap tile map server (example: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/')
1488
+ * ESRI_map_url_satellite - URL of ESRI satellite tile map server (example: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/')
1489
+ * OSM_map_url_roadmap - URL of OSM tile map server (example: 'http://tile.openstreetmap.org/')
1490
+
1472
1491
  Enable file caching for map tiles - file cache can use for offline map browsing:
1473
1492
  :::ruby
1474
1493
  MapView.set_file_caching_enable(1)