rhodes 3.0.0.beta.4 → 3.0.0.beta.5

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.
Files changed (25) hide show
  1. data/Manifest.txt +9 -4
  2. data/doc/build.txt +6 -0
  3. data/lib/extensions/debugger/debugger.rb +1 -1
  4. data/lib/extensions/nfc/ext/nfc/platform/android/AndroidManifest.xml +15 -3
  5. data/lib/extensions/nfc/ext/nfc/platform/android/Rakefile +6 -0
  6. data/lib/extensions/nfc/ext/nfc/platform/android/ext_build.files +6 -4
  7. data/lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp +98 -11
  8. data/lib/extensions/nfc/ext/nfc/platform/android/res/xml/filter_nfc.xml +13 -0
  9. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +291 -0
  10. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcActivity.java +52 -0
  11. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/{nfc → rhomobile/nfc}/NfcMessage.java +1 -1
  12. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/{nfc → rhomobile/nfc}/NfcMessagePack.java +1 -1
  13. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/{nfc → rhomobile/nfc}/NfcRecord.java +1 -1
  14. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java +42 -0
  15. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i +50 -0
  16. data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +305 -0
  17. data/lib/extensions/nfc/nfc.rb +134 -0
  18. data/platform/android/Rhodes/res/xml/filter_nfc.xml +13 -0
  19. data/platform/android/build/android.rake +35 -19
  20. data/platform/android/build/androidcommon.rb +34 -2
  21. data/platform/win32/RhoSimulator/QTLICENSE.LGPL +504 -0
  22. data/platform/wp7/build/wp.rake +11 -11
  23. data/rhodes.gemspec +1 -1
  24. metadata +13 -8
  25. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/Nfc.java +0 -150
@@ -167,19 +167,19 @@ end
167
167
  chdir $startdir
168
168
  end
169
169
 
170
- task :devrhobundleRelease => [:rhobundle, :rhobundlemap, "device:wp:addbundletoxapRelease"] do
171
- out_dir = $startdir + "/" + $vcbindir + "/rhodes/Release/"
172
- doc = REXML::Document.new(File.open(out_dir + "XapCacheFile.xml"))
173
- chdir $srcdir
174
- Dir.glob(File.join("**", '*.*')).each do |f|
175
- doc.root[1,0] = REXML::Element.new "file lastWriteTime='" + File.mtime(f).strftime("%m/%d/%Y %I:%M:%S %p") + "' source='" + $srcdir.gsub("/", "\\") + "\\" + f.gsub("/", "\\") + "' archivePath='" + f.gsub("/", "\\") + "'"
176
- end
177
- File.open(out_dir + "XapCacheFile.xml", "w") { |f| doc.write f, 2; f.close }
170
+ task :devrhobundleRelease do #=> [:rhobundle, :rhobundlemap, "device:wp:addbundletoxapRelease"] do
171
+ #out_dir = $startdir + "/" + $vcbindir + "/rhodes/Release/"
172
+ #doc = REXML::Document.new(File.open(out_dir + "XapCacheFile.xml"))
173
+ #chdir $srcdir
174
+ #Dir.glob(File.join("**", '*.*')).each do |f|
175
+ # doc.root[1,0] = REXML::Element.new "file lastWriteTime='" + File.mtime(f).strftime("%m/%d/%Y %I:%M:%S %p") + "' source='" + $srcdir.gsub("/", "\\") + "\\" + f.gsub("/", "\\") + "' archivePath='" + f.gsub("/", "\\") + "'"
176
+ # end
177
+ # File.open(out_dir + "XapCacheFile.xml", "w") { |f| doc.write f, 2; f.close }
178
178
 
179
- chdir $startdir
179
+ # chdir $startdir
180
180
 
181
- mkdir_p $config["build"]["wppath"] + "/rhodes/obj/Release" if not File.exists? $config["build"]["wppath"] + "/rhodes/obj/Release"
182
- cp out_dir + "XapCacheFile.xml", $config["build"]["wppath"] + "/rhodes/obj/Release"
181
+ # mkdir_p $config["build"]["wppath"] + "/rhodes/obj/Release" if not File.exists? $config["build"]["wppath"] + "/rhodes/obj/Release"
182
+ # cp out_dir + "XapCacheFile.xml", $config["build"]["wppath"] + "/rhodes/obj/Release"
183
183
  end
184
184
 
185
185
  task :devrhobundleDebug => [:rhobundle, :rhobundlemap, "device:wp:addbundletoxapDebug"] do
data/rhodes.gemspec CHANGED
@@ -3,7 +3,7 @@ require "lib/rhodes.rb"
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = %q{rhodes}
6
- s.version = "3.0.0.beta.4"
6
+ s.version = "3.0.0.beta.5"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Rhomobile"]
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhodes
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196427
4
+ hash: 62196425
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
10
  - beta
11
- - 4
12
- version: 3.0.0.beta.4
11
+ - 5
12
+ version: 3.0.0.beta.5
13
13
  platform: ruby
14
14
  authors:
15
15
  - Rhomobile
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-05-08 00:00:00 -07:00
20
+ date: 2011-05-09 00:00:00 -07:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -855,10 +855,13 @@ files:
855
855
  - lib/extensions/nfc/ext/nfc/platform/android/ext_build.files
856
856
  - lib/extensions/nfc/ext/nfc/platform/android/jni/src/nfc.cpp
857
857
  - lib/extensions/nfc/ext/nfc/platform/android/Rakefile
858
- - lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/Nfc.java
859
- - lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessage.java
860
- - lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcMessagePack.java
861
- - lib/extensions/nfc/ext/nfc/platform/android/src/com/nfc/NfcRecord.java
858
+ - lib/extensions/nfc/ext/nfc/platform/android/res/xml/filter_nfc.xml
859
+ - lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java
860
+ - lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcActivity.java
861
+ - lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcMessage.java
862
+ - lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcMessagePack.java
863
+ - lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcRecord.java
864
+ - lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java
862
865
  - lib/extensions/nfc/ext/nfc/shared/ruby/nfc.i
863
866
  - lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c
864
867
  - lib/extensions/nfc/ext.yml
@@ -1172,6 +1175,7 @@ files:
1172
1175
  - platform/android/Rhodes/res/menu/options.xml
1173
1176
  - platform/android/Rhodes/res/values/strings.xml
1174
1177
  - platform/android/Rhodes/res/values/styles.xml
1178
+ - platform/android/Rhodes/res/xml/filter_nfc.xml
1175
1179
  - platform/android/Rhodes/rhobundle.xml
1176
1180
  - platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java
1177
1181
  - platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java
@@ -4236,6 +4240,7 @@ files:
4236
4240
  - platform/win32/RhoSimulator/imageformats/qjpeg4.dll
4237
4241
  - platform/win32/RhoSimulator/QtCore4.dll
4238
4242
  - platform/win32/RhoSimulator/QtGui4.dll
4243
+ - platform/win32/RhoSimulator/QTLICENSE.LGPL
4239
4244
  - platform/win32/RhoSimulator/QtNetwork4.dll
4240
4245
  - platform/win32/RhoSimulator/QtWebKit4.dll
4241
4246
  - platform/win32/RhoSimulator/rhosimulator.exe
@@ -1,150 +0,0 @@
1
- package com.nfc;
2
-
3
- import android.app.Activity;
4
- import android.content.BroadcastReceiver;
5
- import android.content.Context;
6
- import android.content.Intent;
7
- import android.nfc.NdefMessage;
8
- import android.nfc.NdefRecord;
9
- import android.nfc.NfcAdapter;
10
- import android.os.Build;
11
- import android.os.Bundle;
12
- import android.os.Parcelable;
13
- import android.util.Log;
14
-
15
- import com.rhomobile.rhodes.PushService;
16
- import com.rhomobile.rhodes.RhodesActivity;
17
- import com.rhomobile.rhodes.RhodesService;
18
- import com.rhomobile.rhodes.Utils;
19
-
20
- public class Nfc extends BroadcastReceiver {
21
-
22
-
23
- private static final String TAG = Nfc.class.getSimpleName();
24
-
25
- private static boolean ourIsEnable = false;
26
- private static String ourCallback = null;
27
-
28
- private static Nfc ourInstance = null;
29
-
30
- private static native void callCallback(String callback_url, NfcMessagePack msgpack);
31
-
32
-
33
- public static Nfc getInstance() {
34
- if (ourInstance == null) {
35
- ourInstance = new Nfc();
36
- }
37
- return ourInstance;
38
- }
39
-
40
-
41
- public static int isSupported() {
42
- NfcAdapter da = null;
43
- try {
44
- int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
45
- if (sdkVersion >= Build.VERSION_CODES.GINGERBREAD_MR1) {
46
- da = NfcAdapter.getDefaultAdapter(RhodesService.getContext());
47
- }
48
- else if (sdkVersion >= Build.VERSION_CODES.GINGERBREAD) {
49
- da = NfcAdapter.getDefaultAdapter();
50
- }
51
- }
52
- catch (Exception e) {
53
- // nothing
54
- }
55
- if (da == null) {
56
- return 0;
57
- }
58
- int res = 0;
59
- if (da.isEnabled()) {
60
- res = 1;
61
- }
62
- return res;
63
- }
64
-
65
- public static int isEnabled() {
66
- int res = 0;
67
- if (ourIsEnable) {
68
- res = 1;
69
- }
70
- return res;
71
- }
72
-
73
- public static void setEnable(int enable) {
74
- ourIsEnable = (enable != 0);
75
- }
76
-
77
- public static void setCallback(String callback) {
78
- ourCallback = callback;
79
- }
80
-
81
- @Override
82
- public void onReceive(Context context, Intent intent) {
83
- String action = intent.getAction();
84
-
85
- if (NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)) {
86
- Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
87
- NdefMessage[] msgs;
88
- if (rawMsgs != null) {
89
- msgs = new NdefMessage[rawMsgs.length];
90
- for (int i = 0; i < rawMsgs.length; i++) {
91
- msgs[i] = (NdefMessage) rawMsgs[i];
92
- }
93
- } else {
94
- // Unknown tag type
95
- byte[] empty = new byte[] {};
96
- NdefRecord record = new NdefRecord(NdefRecord.TNF_UNKNOWN, empty, empty, empty);
97
- NdefMessage msg = new NdefMessage(new NdefRecord[] {record});
98
- msgs = new NdefMessage[] {msg};
99
- }
100
- onReceiveMessages(msgs);
101
- }
102
- }
103
-
104
- private static boolean isRhodesApplicationRun() {
105
- return RhodesService.getInstance()!=null;
106
- }
107
-
108
- void onReceiveMessages(NdefMessage[] msgs) {
109
- if (msgs == null || msgs.length == 0) {
110
- return;
111
- }
112
-
113
- Utils.platformLog(TAG, "NFC TAG Received ! Service started = "+String.valueOf(isRhodesApplicationRun()));
114
-
115
- NfcMessagePack pack = new NfcMessagePack(msgs);
116
-
117
- if (isRhodesApplicationRun()) {
118
- if (ourIsEnable) {
119
- if (ourCallback != null) {
120
- if (ourCallback.length() > 0) {
121
- callCallback(ourCallback, pack);
122
- }
123
- }
124
- }
125
- }
126
-
127
-
128
- }
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
-
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
- }