rhodes 3.0.0 → 3.0.1.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/CHANGELOG +4 -0
  2. data/Rakefile +9 -2
  3. data/doc/application.txt +1 -1
  4. data/doc/build.txt +49 -70
  5. data/doc/device-caps.txt +22 -97
  6. data/doc/extensions.txt +1 -1
  7. data/doc/nfc.txt +542 -0
  8. data/doc/rhom.txt +7 -5
  9. data/doc/simulator.txt +116 -0
  10. data/doc/ui.txt +1 -1
  11. data/lib/build/jake.rb +5 -5
  12. data/lib/extensions/debugger/debugger.rb +63 -35
  13. data/lib/extensions/nfc/ext/nfc/platform/android/AndroidManifest.xml +8 -6
  14. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +1070 -249
  15. data/lib/extensions/nfc/ext/nfc/platform/android/res/xml/filter_nfc.xml +1 -5
  16. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +894 -72
  17. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcActivity.java +82 -18
  18. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcMessage.java +65 -0
  19. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcRecord.java +88 -24
  20. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java +3 -0
  21. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i +204 -3
  22. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +1047 -5
  23. data/lib/extensions/nfc/nfc.rb +635 -91
  24. data/lib/extensions/rhoxml/rexml/encodings/CP-1252.rb +103 -0
  25. data/lib/extensions/rhoxml/rexml/encodings/ISO-8859-1.rb +7 -0
  26. data/lib/framework/dateME.rb +26 -0
  27. data/lib/framework/rho/render.rb +21 -9
  28. data/lib/framework/rho/rho.rb +12 -0
  29. data/lib/framework/rho/rhoevent_bb.rb +3 -0
  30. data/lib/framework/rho/rhoevent_c.rb +3 -0
  31. data/lib/framework/rhodes.rb +1 -1
  32. data/lib/framework/rhom/rhom_db_adapter.rb +9 -9
  33. data/lib/framework/rhosystem.rb +17 -0
  34. data/lib/framework/stringio.rb +18 -0
  35. data/lib/framework/version.rb +1 -1
  36. data/lib/rhodes.rb +1 -1
  37. data/platform/android/Rhodes/AndroidManifest.xml +2 -2
  38. data/platform/android/Rhodes/res/xml/filter_nfc.xml +1 -5
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +0 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +10 -6
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +29 -18
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +67 -12
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +14 -0
  44. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +102 -28
  45. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +35 -66
  46. data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +5 -5
  47. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +69 -41
  48. data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +7 -5
  49. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +68 -35
  50. data/platform/android/build/RhodesSRC_build.files +1 -0
  51. data/platform/android/build/android.rake +2 -2
  52. data/platform/bb/RubyVM/src/com/rho/RhoConf.java +1 -0
  53. data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +18 -6
  54. data/platform/bb/build/bb.rake +1 -1
  55. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +5 -4
  56. data/platform/iphone/Classes/SimpleMainView.m +1 -1
  57. data/platform/iphone/Info.plist +1 -1
  58. data/platform/shared/common/RhodesApp.cpp +9 -3
  59. data/platform/shared/curl/lib/rhossl.c +5 -2
  60. data/platform/shared/db/DBAdapter.cpp +9 -0
  61. data/platform/shared/net/CURLNetRequest.cpp +8 -3
  62. data/platform/shared/net/iphone/sslimpl.cpp +3 -2
  63. data/platform/shared/net/ssl.cpp +8 -0
  64. data/platform/shared/ruby/ext/rho/rhoruby.c +10 -0
  65. data/platform/shared/ruby/ext/rho/rhoruby.h +1 -0
  66. data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +3 -4
  67. data/platform/win32/RhoSimulator/QtCore4.dll +0 -0
  68. data/platform/win32/RhoSimulator/QtGui4.dll +0 -0
  69. data/platform/win32/RhoSimulator/QtNetwork4.dll +0 -0
  70. data/platform/win32/RhoSimulator/QtWebKit4.dll +0 -0
  71. data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
  72. data/platform/win32/RhoSimulator/imageformats/qgif4.dll +0 -0
  73. data/platform/win32/RhoSimulator/imageformats/qico4.dll +0 -0
  74. data/platform/win32/RhoSimulator/imageformats/qjpeg4.dll +0 -0
  75. data/platform/win32/RhoSimulator/imageformats/qmng4.dll +0 -0
  76. data/platform/win32/RhoSimulator/imageformats/qsvg4.dll +0 -0
  77. data/platform/win32/RhoSimulator/imageformats/qtiff4.dll +0 -0
  78. data/platform/win32/RhoSimulator/libeay32.dll +0 -0
  79. data/platform/win32/RhoSimulator/ssleay32.dll +0 -0
  80. data/platform/wm/build/wm.rake +27 -3
  81. data/platform/wm/rhodes/Rhodes.cpp +4 -0
  82. data/platform/wm/rhodes/emulator/MainWindowCallback.h +1 -0
  83. data/platform/wm/rhodes/emulator/MainWindowProxy.cpp +3 -1
  84. data/platform/wm/rhodes/emulator/MainWindowQt.cpp +23 -12
  85. data/platform/wm/rhodes/emulator/MainWindowQt.h +5 -1
  86. data/platform/wm/rhodes/emulator/QtMainWindow.cpp +39 -6
  87. data/platform/wm/rhodes/emulator/QtMainWindow.h +1 -1
  88. data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +5 -0
  89. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/IronRuby.Libraries.dll +0 -0
  90. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/IronRuby.dll +0 -0
  91. data/platform/wp7/IronRuby/bin/Silverlight3Release/Microsoft.Dynamic.dll +0 -0
  92. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/Microsoft.Scripting.Core.dll +0 -0
  93. data/platform/wp7/IronRuby/{Bin → bin}/Silverlight3Release/Microsoft.Scripting.dll +0 -0
  94. data/platform/wp7/RhoAppRunner/Program.cs +2 -2
  95. data/platform/wp7/RhoRubyLib/RhoRuby.cs +8 -0
  96. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +29 -7
  97. data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +5 -2
  98. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +12 -0
  99. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +2 -0
  100. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
  101. data/platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs +52 -7
  102. data/platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs +85 -18
  103. data/platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs +38 -3
  104. data/platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs +27 -2
  105. data/platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs +111 -15
  106. data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +330 -55
  107. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +61 -4
  108. data/platform/wp7/build/wp.rake +89 -72
  109. data/platform/wp7/rhodes/App.xaml.cs +1 -1
  110. data/rakefile.rb +9 -2
  111. data/rhodes.gemspec +1 -3
  112. data/spec/phone_spec/app/spec/asynchttp_spec.rb +7 -9
  113. data/spec/phone_spec/app/spec/uri_spec.rb +75 -0
  114. data/spec/phone_spec/app/spec_runner.rb +4 -0
  115. metadata +21 -15
  116. data/Manifest.txt +0 -6403
  117. data/platform/win32/RhoSimulator/codecs/qcncodecs4.dll +0 -0
  118. data/platform/win32/RhoSimulator/codecs/qjpcodecs4.dll +0 -0
  119. data/platform/win32/RhoSimulator/codecs/qkrcodecs4.dll +0 -0
  120. data/platform/win32/RhoSimulator/codecs/qtwcodecs4.dll +0 -0
  121. data/platform/wp7/IronRuby/Bin/Silverlight3Release/Microsoft.Dynamic.dll +0 -0
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ ## 3.0.1
2
+ * Fix customer issues
3
+ * Android: fix push issues
4
+
1
5
  ## 3.0
2
6
  * RhoSimulator: simulator for fast Rhodes application development, support debugging using Rhodes Eclipse plug-in.(Windows only)
3
7
  * Windows Phone 7 support
data/Rakefile CHANGED
@@ -518,14 +518,18 @@ end
518
518
  def process_exclude_folders
519
519
  excl = []
520
520
 
521
+ exclude_platform = $config['platform']
522
+ exclude_platform = "bb6" if $bb6
523
+ exclude_platform = "wm" if exclude_platform == 'win32'
524
+
521
525
  if $app_config["excludedirs"]
522
526
  excl << $app_config["excludedirs"]['all'] if $app_config["excludedirs"]['all']
523
- excl << $app_config["excludedirs"][$config["platform"]] if $app_config["excludedirs"][$config["platform"]]
527
+ excl << $app_config["excludedirs"][exclude_platform] if $app_config["excludedirs"][exclude_platform]
524
528
  end
525
529
 
526
530
  if $config["excludedirs"]
527
531
  excl << $config["excludedirs"]['all'] if $config["excludedirs"]['all']
528
- excl << $config["excludedirs"][$config["platform"]] if $config["excludedirs"][$config["platform"]]
532
+ excl << $config["excludedirs"][exclude_platform] if $config["excludedirs"][exclude_platform]
529
533
  end
530
534
 
531
535
  if excl
@@ -684,6 +688,9 @@ namespace "build" do
684
688
 
685
689
  rm "#{$srcdir}/bb.rb"
686
690
 
691
+ chdir $srcdir
692
+ Dir.glob("**/*.erb") { |f| rm f }
693
+
687
694
  chdir startdir
688
695
  cp_r "platform/shared/db/res/db", $srcdir
689
696
  end
data/doc/application.txt CHANGED
@@ -93,7 +93,7 @@ Method on_ui_created will be invoked after application's UI was created (usually
93
93
  # for example, create tab bar:
94
94
  # NativeBar.create(Rho::RhoApplication::TABBAR_TYPE, tabs)
95
95
 
96
- super.on_ui_created() # To navigate to start_path from rhoconfig.txt
96
+ super # To navigate to start_path from rhoconfig.txt
97
97
  end
98
98
 
99
99
  Method on_ui_destroyed will be invoked when application's UI was destroyed (usually on app exit)
data/doc/build.txt CHANGED
@@ -774,56 +774,6 @@ To clean all binaries run:
774
774
 
775
775
  Rholog.txt is placed in `<rhodes folder>\platform\wm\bin\win32\rhodes\Debug\rho`
776
776
 
777
- ### Build experimental Rhodes Win32-emulator based on Qt port of WebKit
778
-
779
- Experimental Rhodes Win32-emulator uses WebKit's WebView and WebInspector to display and debug a client part of the Rhodes applications.
780
- At present the emulator is in active development alfa-stage. The basic functionality is implemented, but some important features are not functioning properly.
781
- Use it at your own risk!
782
-
783
- * Use Visual Studio 2005 Service Pack 1
784
- * First build the Qt libraries for VS 2005:
785
- * Download the Qt source:
786
- * Go to [http://qt.nokia.com/downloads](http://qt.nokia.com/downloads)
787
- * Choose the open source LGPL version
788
- * Under the Framework Only section choose Qt libraries for Windows (VS 2008)
789
- * Cancel automatically started download, and download the [source code](http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.2.zip)
790
- * Extract the downloaded archive, e.g. into `C:\Qt\4.7.2-msvc2005`
791
- * Open Control Panel » System » Advanced system settings » Environment Variables and then:
792
- * Create new system variable `QTDIR` = `C:\Qt\4.7.2-msvc2005`
793
- * Add to the `PATH` variable: `%QTDIR%\bin`
794
- * Either close all command prompts and Visual Studio instances, or reboot the computer so the new settings take effect.
795
- * Open Visual Studio 2005 Command Prompt. This is accomplished using Start » All Programs » Microsoft Visual Studio 2005 » Visual Studio Tools » Visual Studio 2005 Command Prompt. Run in Visual Studio 2005 Command Prompt:
796
-
797
- > vcvarsall.bat x86
798
- > C:
799
- > cd \Qt\4.7.2-msvc2005
800
- > configure -platform win32-msvc2005
801
- > nmake
802
-
803
- Be aware that it will take a while to build the Qt libraries from sources (maybe few hours or so). Particularly the `configure` command may run for a few minutes, and the `nmake` command may run for a few hours.
804
- * After the build process is completed exit Visual Studio 2005 Command Prompt
805
- * Check out the experimental `win32-emulator` branch using Git Bash (or alternatively performing the similar actions in some Windows GUI for Git), e.g. into `C:\Rhomobile`:
806
-
807
- $ cd /c/Rhomobile
808
- $ git clone git://github.com/rhomobile/rhodes.git
809
- $ cd rhodes
810
- $ git checkout -f -b win32-emulator --track origin/win32-emulator
811
-
812
- * Set your application as a default application for experimental Rhodes SDK:
813
- * In `build.yml` of your application specify experimental Rhodes SDK path:
814
-
815
- sdk: "C:/Rhomobile/rhodes"
816
-
817
- * In Windows Command Prompt run:
818
-
819
- > cd <root-folder-of-your-application>
820
- > rake build:win32:devrhobundle
821
-
822
- * Build experimental Rhodes Win32-emulator:
823
- * In Visual Studio 2005 open the solution: `C:\Rhomobile\rhodes\platform\wm\rhodes\rhodes.vcproj`
824
- * Build Solution for “`Debug | Win32`” configuration
825
- * Run and enjoy!
826
-
827
777
  ## Build for Windows Phone 7
828
778
 
829
779
  ### Prerequisites
@@ -833,10 +783,59 @@ Use it at your own risk!
833
783
  * Visual Studio 2010 installed or VS Express for Windows Phone and VS Express for C#
834
784
  * [Windows Phone Developer Tools RTW](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce)
835
785
  * [Windows Phone Developer Tools January 2011 Update](http://www.microsoft.com/downloads/en/details.aspx?FamilyID=49b9d0c5-6597-4313-912a-f0cca9c7d277)
786
+
787
+ * Add path to `msbuild` to `rhobuild.yml` in rhodes folder. For example:
788
+
789
+ env:
790
+ paths:
791
+ msbuild: C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
792
+
793
+ ### Application changes
794
+
795
+ * Add to application build.yml productid GUID. For example:
796
+
797
+ wp:
798
+ productid: 632621d0-5ecb-012e-2c97-482a1411c191
799
+ NOTE: When you use rhodes command to generate application, productid is generated automatically
800
+
801
+ * Windows Phone 7 does not support POST method in HTML forms. So you have to change all form method to GET or use javascript to do it:
802
+
803
+ Copy file:
804
+
805
+ <rhodes>\res\generators\templates\application\public\js\wp7.js
806
+
807
+ to your application public/js folder
808
+
809
+ Modify layout.erb:
810
+
811
+ <%if System::get_property('platform') == 'WP7' %>
812
+ <script src="/public/js/wp7.js" type="text/javascript"></script>
813
+ <% end %>
814
+
815
+ <% if System::get_property('platform') == 'WP7' %>
816
+ <body onload="wp7_change_forms_action_to_get()">
817
+ <% else %>
818
+ <body>
819
+ <% end %>
820
+ <%%= @content %>
821
+ </body>
822
+
823
+ This script just replace FORM action to GET:
824
+
825
+ function wp7_change_forms_action_to_get() {
826
+ for(i=0;i<document.forms.length; i++)
827
+ {
828
+ document.forms[i].method = "GET";
829
+ }
830
+ }
831
+
832
+ You can use [Rhodes Application Generator](#generator) to see application code with all this changes
833
+ NOTE: in form action when using url_for specify :action => :create to call create controller method
836
834
 
837
835
  ### Build and run using Rhodes gem
838
836
 
839
837
  * Install Rhodes gem
838
+
840
839
  * Run application simulator:
841
840
 
842
841
  $rake run:wp
@@ -876,26 +875,6 @@ NOTE: When running on device you may need to disconnect USB cable from device to
876
875
  * After Application code modifications , build Rhodes solution and Start Debugging. DO NOT close emulator!
877
876
  * See log in VS output console (Debug mode only)
878
877
 
879
- ## RhoSimulator
880
- Currently it works only on Windows.
881
-
882
- ### Run using Rhodes gem
883
- Rhodes gem contain RhoSimulator, so just run in rhodes or application folder:
884
- rake run:win32:rhosimulator
885
-
886
- ### Run without Rhodes gem
887
- * Download [RhoSimulator](http://rhosimulator.s3.amazonaws.com/RhoSimulator.zip) and unzip it.
888
-
889
- * Edit 'rhodes/rhobuild.yml':
890
-
891
- env:
892
- paths:
893
- rhosimulator: <RhoSimulator folder>
894
-
895
- * Run in rhodes or application folder:
896
-
897
- rake run:win32:rhosimulator
898
-
899
878
  ## How to set application name and icon
900
879
 
901
880
  ### Application Name
data/doc/device-caps.txt CHANGED
@@ -9,29 +9,30 @@ Rhodes provide access to device specific capabilities such as GPS, PIM, camera,
9
9
  <th>Capability</th>
10
10
  <th>iPhone</th>
11
11
  <th>Windows Mobile</th>
12
+ <th>Windows Phone</th>
12
13
  <th>BlackBerry</th>
13
14
  <th>Android</th>
14
15
  <th>RhoSimulator</th>
15
16
  </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'>3.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>3.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>3.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>3.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'>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>3.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>3.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>3.0</td></tr>
24
- <tr><td class='cap'>Tab Bar</td><td>1.2.2</td><td class='tbd'>3.5</td><td class='tbd'>n/a</td><td>1.5</td><td class='tbd'>TBD</td></tr>
25
- <tr><td class='cap'>Nav Bar</td><td>2.0</td><td class='tbd'>3.5</td><td class='tbd'>n/a</td><td>2.0</td><td class='tbd'>TBD</td></tr>
26
- <tr><td class='cap'>Signature Capture</td><td>2.1</td><td class='tbd'>3.5</td><td class='tbd'>3.5</td><td>2.1</td><td class='tbd'>TBD</td></tr>
27
- <tr class='tbd'><td class='cap'>Audio/Video capture</td><td>4.0</td><td>4.0</td><td>4.0</td><td>4.0</td><td>TBD</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'>TBD</td></tr>
29
- <tr><td class='cap'>NFC</td><td class='tbd'>TBD</td><td class='tbd'>TBD</td><td class='tbd'>TBD</td><td>3.0</td><td class='tbd'>TBD</td></tr>
30
- <tr><td class='cap'>Push</td><td>1.2</td><td class='tbd'>4.0</td><td>1.2</td><td>2.2</td><td>3.0</td></tr>
31
- <tr><td class='cap'>Screen rotation</td><td>2.1</td><td class='tbd'>3.5</td><td>2.0</td><td>2.1</td><td class='tbd'>TBD</td></tr>
32
- <tr><td class='cap'>Native Maps</td><td>1.4</td><td class='tbd'>3.5</td><td>1.4</td><td>1.5</td><td class='tbd'>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'>TBD</td></tr>
34
- <tr><td class='cap'>Ringtones</td><td>3.5</td><td>1.5</td><td>1.5</td><td>1.5</td><td class='tbd'>TBD</td></tr>
17
+ <tr><td class='cap'>GeoLocation</td><td>0.3</td><td>0.3</td><td class='tbd'>TBD</td><td>0.3</td><td>1.0</td><td class='tbd'>3.5</td></tr>
18
+ <tr><td class='cap'>PIM Contacts</td><td>0.3</td><td>0.3</td><td class='tbd'>TBD</td><td>0.3</td><td>1.0</td><td class='tbd'>3.5</td></tr>
19
+ <tr><td class='cap'>PIM Calendar</td><td>2.2</td><td>2.2</td><td class='tbd'>TBD</td><td>2.2</td><td>2.2</td><td class='tbd'>3.5</td></tr>
20
+ <tr><td class='cap'>Camera</td><td>1.0</td><td>1.0</td><td class='tbd'>TBD</td><td>1.0</td><td>1.0</td><td>3.0</td></tr>
21
+ <tr><td class='cap'>Barcode</td><td>2.1</td><td>2.1</td><td class='tbd'>TBD</td><td>2.1</td><td>2.1</td><td class='tbd'>4.0</td></tr>
22
+ <tr><td class='cap'>Date/Time picker</td><td>1.2.2</td><td>2.0</td><td class='tbd'>TBD</td><td>1.2</td><td>1.2</td><td>3.0</td></tr>
23
+ <tr><td class='cap'>Menu</td><td>1.2.2</td><td>2.0</td><td>3.0</td><td>1.2</td><td>1.5</td><td>3.0</td></tr>
24
+ <tr><td class='cap'>Toolbar</td><td>1.2.2</td><td>2.3</td><td>3.0</td><td class='tbd'>n/a</td><td>1.5</td><td>3.0</td></tr>
25
+ <tr><td class='cap'>Tab Bar</td><td>1.2.2</td><td class='tbd'>3.5</td><td class='tbd'>TBD</td><td class='tbd'>n/a</td><td>1.5</td><td class='tbd'>3.5</td></tr>
26
+ <tr><td class='cap'>Nav Bar</td><td>2.0</td><td class='tbd'>3.5</td><td class='tbd'>TBD</td><td class='tbd'>n/a</td><td>2.0</td><td class='tbd'>4.0</td></tr>
27
+ <tr><td class='cap'>Signature Capture</td><td>2.1</td><td class='tbd'>3.5</td><td class='tbd'>TBD</td><td class='tbd'>3.5</td><td>2.1</td><td class='tbd'>4.0</td></tr>
28
+ <tr class='tbd'><td class='cap'>Audio/Video capture</td><td>4.0</td><td>4.0</td><td class='tbd'>TBD</td><td>4.0</td><td>4.0</td><td>4.0</td></tr>
29
+ <tr><td class='cap'>Bluetooth</td><td>2.2</td><td>2.2</td><td class='tbd'>TBD</td><td>2.2</td><td>2.2</td><td class='tbd'>4.0</td></tr>
30
+ <tr><td class='cap'>NFC</td><td class='tbd'>TBD</td><td class='tbd'>TBD</td><td class='tbd'>TBD</td><td class='tbd'>TBD</td><td>3.0</td><td class='tbd'>4.0</td></tr>
31
+ <tr><td class='cap'>Push</td><td>1.2</td><td class='tbd'>4.0</td><td class='tbd'>TBD</td><td>1.2</td><td>2.2</td><td class='tbd'>3.5</td></tr>
32
+ <tr><td class='cap'>Screen rotation</td><td>2.1</td><td class='tbd'>3.5</td><td class='tbd'>TBD</td><td>2.0</td><td>2.1</td><td class='tbd'>3.5</td></tr>
33
+ <tr><td class='cap'>Native Maps</td><td>1.4</td><td class='tbd'>3.5</td><td class='tbd'>TBD</td><td>1.4</td><td>1.5</td><td class='tbd'>3.5</td></tr>
34
+ <tr><td class='cap'>Alerts/Audio File Playback</td><td>1.2</td><td>1.5</td><td class='tbd'>TBD</td><td>1.2</td><td>1.2</td><td class='tbd'>3.5</td></tr>
35
+ <tr><td class='cap'>Ringtones</td><td>3.5</td><td>1.5</td><td class='tbd'>TBD</td><td>1.5</td><td>1.5</td><td class='tbd'>3.5</td></tr>
35
36
  </table>
36
37
 
37
38
  ## System class
@@ -572,84 +573,8 @@ You can find complete example of using Bluetooth API in [Rhodes-System-Api-Sampl
572
573
 
573
574
  ## NFC
574
575
 
575
- NFC (Near Field Communication). NFC API provide access to NFC functionality. You can check NFC availability on current device and register callback for listen event when NFC tag near of device. Currently NFC supported only on Android. And also Android version must be 2.3 or later.
576
- NFC API implemented in native extension. You should add "nfc" to extension list in your nuild.yml before start using NFC in your application. And also do not forget enable NFC for start process NFC events - Rho::NFCManager.enable.
577
-
578
- ### NFC API
579
-
580
- :::ruby
581
- module Rho
582
-
583
- class NFCManager
584
-
585
-
586
- # 3-bit TNF (Type Name Format) field: Indicates how to interpret the type field
587
-
588
- TNF_ABSOLUTE_URI = 3
589
- TNF_EMPTY = 0
590
- TNF_EXTERNAL_TYPE = 4
591
- TNF_MIME_MEDIA = 2
592
- TNF_UNCHANGED = 6
593
- TNF_UNKNOWN = 5
594
- TNF_WELL_KNOWN = 1
595
-
596
-
597
- # RTD Text types. For use with TNF_WELL_KNOWN
598
-
599
- RTD_TEXT = [0x54] # "T"
600
- RTD_URI = [0x55] # "U"
601
- RTD_SMART_POSTER = [0x53, 0x70] # "Sp"
602
- RTD_ALTERNATIVE_CARRIER = [0x61, 0x63] # "ac"
603
- RTD_HANDOVER_CARRIER = [0x48, 0x63] # "Hc"
604
- RTD_HANDOVER_REQUEST = [0x48, 0x72] # "Hr"
605
- RTD_HANDOVER_SELECT = [0x48, 0x73] # "Hs"
606
-
607
-
608
- # return true/false
609
- def self.is_supported
610
- end
611
-
612
- def self.enable
613
- end
614
-
615
- def self.disable
616
- end
617
-
618
- # return true/false
619
- def self.is_enabled
620
- end
621
-
622
- # in callback
623
- # @params['messages'] - array of messages (each message is hash)
624
- # message hash items :
625
- # 'raw_message' - array of bytes (raw message)
626
- # 'records' - array of records (each record is hash)
627
- # record hash items :
628
- # 'raw_record' - array of bytes (raw record)
629
- # 'id' - array of bytes
630
- # 'payload' - array of bytes
631
- # 'tnf' - int
632
- # 'type' - array of bytes
633
- # 'payload_as_string' - string, payload prepared to string (support specail formats for URI, TEXT)
634
- # 'subrecords' - message hash (only for SMART_POSTER type)
635
-
636
- def self.set_nfc_callback(callback_url)
637
- end
638
-
639
- def self.convert_Tnf_to_string(tnf)
640
- end
641
-
642
- def self.convert_RTD_to_string(rtd)
643
- end
644
-
645
- end
646
-
647
- end
648
-
649
-
650
- ### Example of NFC API using
651
-
652
- You can find complete example of using NFC API in [Rhodes-System-Api-Samples](http://github.com/rhomobile/rhodes-system-api-samples). See NFC Demo page - [NFC Demo](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/Nfc/).
576
+ NFC (Near Field Communication). NFC API provide access to NFC functionality. You can check NFC availability on current device and register callback for listen event when NFC tag near of device. Currently NFC supported only on Android. And also Android version must be 2.3.3 or later.
577
+ NFC API implemented in native extension. You should add "nfc" to extension list in your nuild.yml before start using NFC in your application. Please see detailed doc : [Rhodes NFC extension](nfc)
653
578
 
654
579
 
655
580
  ## Ringtone manager
data/doc/extensions.txt CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  There are three ways to extend Rhodes. You can add to the Ruby gems supported by Rhodes ("Rhodes extensions"). You can create new "native extensions" in the underlying SDK for a given smartphone operating system. You can extend the types of views available in Rhodes ("native extensions").
6
6
 
7
- ## Rhodes Extensions
7
+ ## Ruby Extensions
8
8
 
9
9
  ### Supported extensions and libraries
10
10
  To keep rhodes lightweight we didn't provide extensions and libraries beyond core Ruby functionality. Examples of the features that either aren't necessary in Rhodes or we haven't provided for space reasons are: web services, XML, pluralization, YAML, etc.
data/doc/nfc.txt ADDED
@@ -0,0 +1,542 @@
1
+ # NFC
2
+
3
+ ## NFC Overview
4
+ NFC (Near Field Communication). NFC API provide access to NFC functionality. You can check NFC availability on current device and register callback for listen event when NFC tag near of device. Currently NFC supported only on Android. And also Android version must be 2.3.3 or later.
5
+ NFC API implemented in native extension. You should add "nfc" to extension list in your nuild.yml before start using NFC in your application. And also do not forget enable NFC for start process NFC events - Rho::NFCManager.enable.
6
+ NFC Ruby API based on Android NFC API. We recommended investigate Android doc for understand NFC Techs etc. See [Android NFC](http://developer.android.com/guide/topics/nfc/index.html)
7
+
8
+ ## NFC events
9
+ There are two different NFC callback can be received (you should setup callbacks before!) :
10
+ * NFC callback : it executed when Android ACTION_NDEF_DISCOVERED or ACTION_TAG_DISCOVERED events processed.
11
+ * NFC Tech callback : it executed when Android ACTION_TECH_DISCOVERED event processed.
12
+ In case of current state of NFC support in Android you can receive NFC callback only if your application in foreground. If your application is not run or in background - only ACTION_TECH_DISCOVERED is processed.
13
+ For process ACTION_TECH_DISCOVERED event you should setup list of techs in special resource file : [Rhodes ROOT]/platform/android/Rhodes/res/xml/filter_nfc.xml. See according Android documentation - [Android ACTION_TECH_DISCOVERED description](http://developer.android.com/reference/android/nfc/NfcAdapter.html#ACTION_TECH_DISCOVERED)
14
+ For processing events received when application not run or in background, after start/activate use special method of NfcManager :
15
+
16
+ :::ruby
17
+ Rho::NFCManager.perform_open_application_event
18
+
19
+ In Tech callback access to Techs by get current Tag and request tech list/tech suport objects like this :
20
+
21
+ :::ruby
22
+ tag = Rho::NFCManager.get_current_Tag
23
+ mifareClassic = tag.get_tech(Rho::NFCTagTechnology::MIFARE_CLASSIC)
24
+ if mifareClassic != nil
25
+ puts 'MifareClassic is supported !'
26
+ mifareClassic.connect
27
+
28
+ ## NdefMessage NdefRecord
29
+
30
+ NFC Message contain list of NdefRecord. You can read/write NdefMessage when you access to Tag via Ndef/NdefFormatable techs. Also you should send NdefMessage when you use P2P NFC functionality.
31
+ Example of construct NdefMessage for P2P send:
32
+
33
+ :::ruby
34
+ payload = Rho::NFCManager.make_payload_with_well_known_uri(0, 'http://www.rhomobile.com')
35
+ hash = { 'id' => [0], 'type' => Rho::NdefRecord::RTD_URI, 'tnf' => Rho::NdefRecord::TNF_WELL_KNOWN, 'payload' => payload}
36
+ record = Rho::NFCManager.make_NdefRecord_from_hash(hash)
37
+ records = [record]
38
+ msg = Rho::NFCManager.make_NdefMessage_from_array_of_NdefRecord(records)
39
+ # start push message
40
+ Rho::NFCManager.p2p_enable_foreground_nde_push(msg)
41
+
42
+
43
+ ## NFC API
44
+
45
+ :::ruby
46
+ module Rho
47
+
48
+
49
+ class NdefRecord
50
+
51
+ # 3-bit TNF (Type Name Format) field: Indicates how to interpret the type field
52
+ TNF_ABSOLUTE_URI = 3
53
+ TNF_EMPTY = 0
54
+ TNF_EXTERNAL_TYPE = 4
55
+ TNF_MIME_MEDIA = 2
56
+ TNF_UNCHANGED = 6
57
+ TNF_UNKNOWN = 5
58
+ TNF_WELL_KNOWN = 1
59
+
60
+ # RTD Text types. For use with TNF_WELL_KNOWN
61
+ RTD_TEXT = [0x54] # "T"
62
+ RTD_URI = [0x55] # "U"
63
+ RTD_SMART_POSTER = [0x53, 0x70] # "Sp"
64
+ RTD_ALTERNATIVE_CARRIER = [0x61, 0x63] # "ac"
65
+ RTD_HANDOVER_CARRIER = [0x48, 0x63] # "Hc"
66
+ RTD_HANDOVER_REQUEST = [0x48, 0x72] # "Hr"
67
+ RTD_HANDOVER_SELECT = [0x48, 0x73] # "Hs"
68
+
69
+ ID = 'id'
70
+ TNF = 'tnf'
71
+ TYPE = 'type'
72
+ PAYLOAD = 'payload'
73
+
74
+
75
+ # return byte[]
76
+ def get_id
77
+ end
78
+
79
+ # return int
80
+ def get_tnf
81
+ end
82
+
83
+ # return byte[]
84
+ def get_type
85
+ end
86
+
87
+ # return byte[]
88
+ def get_payload
89
+ end
90
+
91
+ # return string
92
+ def get_payload_as_string
93
+ end
94
+
95
+ # return raw byte[]
96
+ def get_byte_array
97
+ end
98
+
99
+ # return hash
100
+ # hash :
101
+ # 'id' - byte[]
102
+ # 'tnf' - int
103
+ # 'type' - byte[]
104
+ # 'payload' - byte[]
105
+ # 'payload_as_string' - string
106
+ def make_hash
107
+ end
108
+
109
+ # convert int tnf to string
110
+ def self.convert_Tnf_to_string(tnf)
111
+ end
112
+
113
+ # convert byte[] type to string
114
+ def self.convert_RTD_to_string(rtd)
115
+ end
116
+
117
+ end
118
+
119
+
120
+ class NdefMessage
121
+
122
+
123
+ # return raw byte[]
124
+ def get_byte_array
125
+ end
126
+
127
+ # return array of NdefRecord
128
+ def get_records
129
+ end
130
+
131
+
132
+ end
133
+
134
+
135
+
136
+ class NFCTagTechnology
137
+
138
+ ISODEP = 'IsoDep'
139
+ MIFARE_CLASSIC = 'MifareClassic'
140
+ MIFARE_ULTRALIGHT = 'MifareUltralight'
141
+ NDEF = 'Ndef'
142
+ NDEF_FORMATABLE = 'NdefFormatable'
143
+ NFCA = 'NfcA'
144
+ NFCB = 'NfcB'
145
+ NFCF = 'NfcF'
146
+ NFCV = 'NfcV'
147
+
148
+ # return string
149
+ def get_name
150
+ end
151
+
152
+ # connect - only after it you can make any I/O operation
153
+ def connect
154
+ end
155
+
156
+ # close connect - make it after your I/O operations
157
+ def close
158
+ end
159
+
160
+ # return true if tech connected and ready for I/O operations
161
+ def is_connected
162
+ end
163
+
164
+ end
165
+
166
+
167
+ class NFCTagTechnology_NfcA < NFCTagTechnology
168
+
169
+ # return byte[]
170
+ def get_Atqa
171
+ end
172
+
173
+ # return int
174
+ def get_Sak
175
+ end
176
+
177
+ # data - byte[]
178
+ # return byte[]
179
+ def transceive(data)
180
+ end
181
+
182
+ end
183
+
184
+ class NFCTagTechnology_Ndef < NFCTagTechnology
185
+
186
+ MIFARE_CLASSIC = 'com.nxp.ndef.mifareclassic'
187
+ NFC_FORUM_TYPE_1 = 'org.nfcforum.ndef.type1'
188
+ NFC_FORUM_TYPE_2 = 'org.nfcforum.ndef.type2'
189
+ NFC_FORUM_TYPE_3 = 'org.nfcforum.ndef.type3'
190
+ NFC_FORUM_TYPE_4 = 'org.nfcforum.ndef.type4'
191
+
192
+ # return int
193
+ def get_max_size
194
+ end
195
+
196
+ # return bool
197
+ def is_writable
198
+ end
199
+
200
+ # return bool
201
+ def can_make_read_only
202
+ end
203
+
204
+ # return bool
205
+ def make_read_only
206
+ end
207
+
208
+ # return string
209
+ def get_type
210
+ end
211
+
212
+ # return NdefMessage
213
+ def read_NdefMessage
214
+ end
215
+
216
+ # msg - NdefMessage
217
+ def write_NdefMessage(msg)
218
+ end
219
+
220
+
221
+ end
222
+
223
+
224
+ class NFCTagTechnology_MifareClassic < NFCTagTechnology
225
+
226
+ KEY_DEFAULT = [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF]
227
+ KEY_MIFARE_APPLICATION_DIRECTORY = [0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5]
228
+ KEY_NFC_FORUM =[0xD3, 0xF7, 0xD3, 0xF7, 0xD3, 0xF7]
229
+
230
+ TYPE_CLASSIC = 0
231
+ TYPE_PLUS = 1
232
+ TYPE_PRO = 2
233
+ TYPE_UNKNOWN = -1
234
+
235
+ # return int type type
236
+ def get_type
237
+ end
238
+
239
+ # return named type (for known types)
240
+ def self.convert_type_to_string(type)
241
+ end
242
+
243
+ # index - integer
244
+ # block - 16 byte array
245
+ def write_block(index, block)
246
+ end
247
+
248
+ # index - integer
249
+ # return 16 byte array
250
+ def read_block(index)
251
+ end
252
+
253
+ # return size in bytes
254
+ def get_size
255
+ end
256
+
257
+ #return number of blocks
258
+ def get_block_count
259
+ end
260
+
261
+ # return count of sectors
262
+ def get_sector_count
263
+ end
264
+
265
+ # return count of blocks in sector
266
+ def get_blocks_in_sector_count(index)
267
+ end
268
+
269
+ # return index of first block in sector
270
+ def sector_to_block(index)
271
+ end
272
+
273
+ # authenticate sector with key
274
+ # key is 6 byte array
275
+ # return true if authenticate was passed
276
+ def authenticate_sector_with_key_A(index, key)
277
+ end
278
+
279
+ # authenticate sector with key
280
+ # key is 6 byte array
281
+ # return true if authenticate was passed
282
+ def authenticate_sector_with_key_B(index, key)
283
+ end
284
+
285
+ # send data (byte array) to Tag and receive result - byte array
286
+ def transceive(data)
287
+ end
288
+
289
+ end
290
+
291
+ class NFCTagTechnology_MifareUltralight < NFCTagTechnology
292
+
293
+ TYPE_ULTRALIGHT = 1
294
+ TYPE_ULTRALIGHT_C = 2
295
+ TYPE_UNKNOWN = -1
296
+
297
+ # return int
298
+ def get_type
299
+ end
300
+
301
+ # index - integer
302
+ # block - 4 byte array
303
+ def write_page(index, block)
304
+ end
305
+
306
+ # index - integer
307
+ # return 16 byte array
308
+ def read_pages(index)
309
+ end
310
+
311
+ # send data (byte array) to Tag and receive result - byte array
312
+ def transceive(data)
313
+ end
314
+
315
+ end
316
+
317
+
318
+ class NFCTagTechnology_IsoDep < NFCTagTechnology
319
+
320
+ # return byte[]
321
+ def get_hi_layer_responce
322
+ end
323
+
324
+ # return byte[]
325
+ def get_historical_bytes
326
+ end
327
+
328
+
329
+ # timeout - int
330
+ def set_timeout(timeout)
331
+ end
332
+
333
+ # data - byte[]
334
+ # return byte[]
335
+ def transceive(data)
336
+ end
337
+
338
+ end
339
+
340
+
341
+ class NFCTagTechnology_NdefFormatable < NFCTagTechnology
342
+
343
+ # msg - NdefMessage
344
+ def format(msg)
345
+ end
346
+
347
+ # msg - NdefMessage
348
+ def format_read_only(msg)
349
+ end
350
+
351
+ end
352
+
353
+
354
+ class NFCTagTechnology_NfcB < NFCTagTechnology
355
+
356
+ # return byte[]
357
+ def get_application_data
358
+ end
359
+
360
+ # return byte[]
361
+ def get_protocol_info
362
+ end
363
+
364
+
365
+ # data - byte[]
366
+ # return byte[]
367
+ def transceive(data)
368
+ end
369
+
370
+ end
371
+
372
+
373
+ class NFCTagTechnology_NfcF < NFCTagTechnology
374
+
375
+ # return byte[]
376
+ def get_manufacturer
377
+ end
378
+
379
+ # return byte[]
380
+ def get_system_code
381
+ end
382
+
383
+
384
+ # data - byte[]
385
+ # return byte[]
386
+ def transceive(data)
387
+ end
388
+
389
+ end
390
+
391
+
392
+ class NFCTagTechnology_NfcV < NFCTagTechnology
393
+
394
+ # return int
395
+ def get_dsf_id
396
+ end
397
+
398
+ # return int
399
+ def get_responce_flags
400
+ end
401
+
402
+
403
+ # data - byte[]
404
+ # return byte[]
405
+ def transceive(data)
406
+ end
407
+
408
+ end
409
+
410
+
411
+
412
+ class NFCTag
413
+
414
+ # return array of string
415
+ def get_tech_list
416
+ end
417
+
418
+ # return byte[]
419
+ def get_ID
420
+ end
421
+
422
+ # return object with implementation of requested tech (based on NFCTagTechnology)
423
+ def get_tech(tech_name)
424
+ end
425
+
426
+ end
427
+
428
+
429
+
430
+
431
+
432
+ class NFCManager
433
+
434
+
435
+ # return true/false
436
+ def self.is_supported
437
+ end
438
+
439
+ def self.enable
440
+ end
441
+
442
+ def self.disable
443
+ end
444
+
445
+ # return true/false
446
+ def self.is_enabled
447
+ end
448
+
449
+ # in callback
450
+ # @params['messages'] - array of messages (each message is hash)
451
+ # message hash items :
452
+ # 'raw_message' - array of bytes (raw message)
453
+ # 'records' - array of records (each record is hash)
454
+ # record hash items :
455
+ # 'raw_record' - array of bytes (raw record)
456
+ # 'id' - array of bytes
457
+ # 'payload' - array of bytes
458
+ # 'tnf' - int
459
+ # 'type' - array of bytes
460
+ # 'payload_as_string' - string, payload prepared to string (support specail formats for URI, TEXT)
461
+ # 'subrecords' - message hash (only for SMART_POSTER type)
462
+
463
+ # set callback for tech events (Tag discovered/lost, tech special events)
464
+ def self.set_nfc_callback(callback_url)
465
+ end
466
+
467
+ # in callback
468
+ # @params['Tag_event'] - 'discovered'
469
+ def self.set_nfc_tech_callback(callback_url)
470
+ end
471
+
472
+ # return current discovered Tag or nil if not any Tag discovered now
473
+ def self.get_current_Tag
474
+ end
475
+
476
+ # call this function after application is started and you setup all functionality for process NFC event
477
+ # when application in background or not started, then NFC event was saved and application open/start process executed
478
+ # for process saved event - call this function
479
+ def self.perform_open_application_event
480
+ end
481
+
482
+ # ndef_message - NdefMessage
483
+ # start push NdefMessage to any receivers
484
+ def self.p2p_enable_foreground_nde_push(ndef_message)
485
+ end
486
+
487
+ # stop any push NdefMessage to receivers
488
+ def self.p2p_disable_foreground_nde_push
489
+ end
490
+
491
+
492
+ # make NdefRecord from byte[]
493
+ def self.make_NdefRecord_from_byte_array(array)
494
+ end
495
+
496
+ # make NdefRecord from hash
497
+ # hash :
498
+ # 'id' - byte[]
499
+ # 'tnf' - int
500
+ # 'type' - byte[]
501
+ # 'payload' - byte[]
502
+ def self.make_NdefRecord_from_hash(hash)
503
+ end
504
+
505
+ # make NdefMessage from byte[]
506
+ def self.make_NdefMessage_from_byte_array(array)
507
+ end
508
+
509
+ # make NdefMessage from NdefRecord[]
510
+ def self.make_NdefMessage_from_array_of_NdefRecord(array)
511
+ end
512
+
513
+ # make string from byte[] payload
514
+ # tnf - int (from NdefRecord)
515
+ # type - byte[] (from NdefRecord)
516
+ def self.make_string_from_payload(payload, tnf, type)
517
+ end
518
+
519
+ # prepare byte[] payload from string with Absolute URI
520
+ def self.make_payload_with_absolute_uri(uri_string)
521
+ end
522
+
523
+ # prepare byte[] payload from int prefix code and string URI
524
+ def self.make_payload_with_well_known_uri(prefix_code, uri_string)
525
+ end
526
+
527
+ # prepare byte[] payload from string language code and string text
528
+ def self.make_payload_with_well_known_text(language, text)
529
+ end
530
+
531
+
532
+ end
533
+
534
+ end
535
+
536
+
537
+
538
+ ## Example of NFC API using
539
+
540
+ You can find complete example of using NFC API in [Rhodes-System-Api-Samples](http://github.com/rhomobile/rhodes-system-api-samples). See NFC Demo page - [NFC Demo](http://github.com/rhomobile/rhodes-system-api-samples/tree/master/app/Nfc/).
541
+
542
+