rhodes 3.3.0.beta.2 → 3.3.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/doc/jqt-jqm-transition.txt +0 -25
- data/doc/ui.txt +45 -2
- data/platform/android/Rhodes/AndroidManifest.xml +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +1 -0
- data/platform/android/build/android.rake +42 -35
- data/platform/android/build/androidcommon.rb +39 -0
- data/platform/wm/build/wm.rake +2 -4
- data/version +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Rhodes
|
2
2
|
===
|
3
3
|
|
4
|
-
|
4
|
+
[Rhodes](http://github.com/rhomobile/rhodes) is a framework for building locally executing, device-optimized mobile applications for smartphone devices. These applications are optimized for interacting with transactional enterprise application backends (with synced local data via [RhoConnect](http://rhomobile.com/products/rhoconnect)). Rhodes is available for iOS, Android, Windows Mobile, Symbian, and Research in Motion (Blackberry) smartphones.
|
5
5
|
|
6
6
|
Rhodes is available as an open source product under the MIT license. For developers interested a commercial license is still [available](http://rhomobile.com/products/rhodes/license/).
|
7
7
|
|
data/doc/jqt-jqm-transition.txt
CHANGED
@@ -110,28 +110,3 @@ Pay attention on following page code parts please:
|
|
110
110
|
* [jQuery Mobile documentation](http://jquerymobile.com/) is just excellent. There are a lot of useful details and samples.
|
111
111
|
* Don't be afraid with rich CSS styles and themes in jQuery Mobile, use RhoSimulator to hack your pages and you will be able to implement your own themes.
|
112
112
|
* jQuire Mobile team promised to release Theme Roller tool with jQuery Mobile 1.0. It should make CSS and themes mastering much more easy.
|
113
|
-
|
114
|
-
## Important notes!
|
115
|
-
|
116
|
-
### CSS selection of the DOM elements
|
117
|
-
With jQuery Mobile as well with jQTouch it is wrong to select HTML elements in the DOM tree by their *id* attribute value. Due to the way such kind of frameworks performs page caching the *id* attribute values aren't unique anymore. DOM tree may have **multiple instances of the same page**, so you can't rely on *id* value. The reliable way to select some exact element with jQuery is:
|
118
|
-
|
119
|
-
// this code will return exact span element from the current active page
|
120
|
-
var errMsgElement = $("div.ui-page-active span.errorMessageTop");
|
121
|
-
|
122
|
-
Also, it is recommended to avoid using of *id* attribute as much as possible and to use *class* names for elements selection instead of *id* values. It may prevent DOM engine in the browser from some glitches with *id* value duplication.
|
123
|
-
|
124
|
-
### Back button behavior for the very first page
|
125
|
-
It may happen that rhodes don't get controller request when user returns to the very first UI page using back button. It isn't a bug but rather a feature of jQuery Mobile.
|
126
|
-
|
127
|
-
jQuery Mobile evaluates the very first page it started on, as "multi-page". No matter are there multiple pages defined in one HTML file or it contain just one page.
|
128
|
-
And as you can see in [jQueryMobile documentation](http://jquerymobile.com/demos/1.0/docs/pages/page-cache.html): "Pages inside a multi-page template aren't affected by this feature at all - jQuery Mobile only removes pages loaded via Ajax.".
|
129
|
-
So this page will never go away from the cache and will never requested again once it has been loaded very first time.
|
130
|
-
|
131
|
-
There are workaround possible:
|
132
|
-
1. To implement some start page which doesn't need to be refreshed and put there link to the page which should be refreshed.
|
133
|
-
1. To don't rely on any kind of back buttons to transit to very first page, using custom back buttons like that:
|
134
|
-
|
135
|
-
:::html
|
136
|
-
<a href="<%= Rho::RhoConfig.start_path %>" class="ui-btn-left" data-icon="home" data-direction="reverse"
|
137
|
-
<%= "data-ajax='false'" if is_bb6 %>>Home</a>
|
data/doc/ui.txt
CHANGED
@@ -114,11 +114,54 @@ By default, Rhodes framework uses a original version of jQuery Mobile version 1.
|
|
114
114
|
* Ajax requests set a 'Transition-Enabled: true' request header. This informs the controller that the request was made by a jQuery Mobile enabled application.
|
115
115
|
* Conversely, Ajax requests inspect for a 'Wait-Page' response header. This informs jQuery Mobile that the page it received was returned after an asynchronous HTTP request was spawned by the controller. Wait pages are not added to the jQuery Mobile history. The animation is then deferred until the expected page is returned to the user interface via the Rho.insertAsyncPage() call. This method is typically invoked after an async HTTP callback function has been triggered in the controller.
|
116
116
|
|
117
|
-
###
|
118
|
-
|
117
|
+
### Important notes!
|
118
|
+
|
119
|
+
#### CSS selection of the DOM elements
|
120
|
+
With jQuery Mobile as well with jQTouch it is wrong to select HTML elements in the DOM tree by their *id* attribute value. Due to the way such kind of frameworks performs page caching the *id* attribute values aren't unique anymore. DOM tree may have **multiple instances of the same page**, so you can't rely on *id* value. The reliable way to select some exact element with jQuery is:
|
121
|
+
|
122
|
+
// this code will return exact span element from the current active page
|
123
|
+
var errMsgElement = $("div.ui-page-active span.errorMessageTop");
|
124
|
+
|
125
|
+
Also, it is recommended to avoid using of *id* attribute as much as possible and to use *class* names for elements selection instead of *id* values. It may prevent DOM engine in the browser from some glitches with *id* value duplication.
|
126
|
+
|
127
|
+
#### How to submit forms
|
128
|
+
Due to reasons explained in previous section, using expressions like **$('#form_id').submit();** with jQuery Mobile it may lead to an incorrect result!
|
119
129
|
|
120
130
|
If you need to submit form programmatically, please use the expression like **$('div.ui-page-active form.yourFormClass').submit();**. To specify the exact form on the page it is recommended to use **class** instead of **id**. It is important to use *ui-page-active* class name to address elements on current active page.
|
121
131
|
|
132
|
+
#### Back button behavior for the very first page
|
133
|
+
It may happen that Rhodes don't get controller request when user returns to the very first UI page using back button. It isn't a bug but rather a feature of jQuery Mobile.
|
134
|
+
|
135
|
+
jQuery Mobile evaluates the very first page it started on, as a "multi-page". No matter are there multiple pages really defined in one HTML file or it contains just one page.
|
136
|
+
And as you can see in [jQueryMobile documentation](http://jquerymobile.com/demos/1.0/docs/pages/page-cache.html): "Pages inside a multi-page template aren't affected by this feature at all - jQuery Mobile only removes pages loaded via Ajax.".
|
137
|
+
So this page will never go away from the cache and will never requested again once it has been loaded very first time.
|
138
|
+
|
139
|
+
Some workaround are possible:
|
140
|
+
1. To implement some start page which doesn't need to be refreshed and put there link to the page which should be refreshed.
|
141
|
+
1. To don't rely on any kind of back buttons to transit to very first page, using custom back buttons like that:
|
142
|
+
|
143
|
+
:::html
|
144
|
+
<a href="<%= Rho::RhoConfig.start_path %>" class="ui-btn-left" data-icon="home" data-direction="reverse"
|
145
|
+
<%= "data-ajax='false'" if is_bb6 %>>
|
146
|
+
Home
|
147
|
+
</a>
|
148
|
+
|
149
|
+
#### Screen is flying
|
150
|
+
It is a jQuery Mobile behavior. There are some hacks able to fix it, but so far we can see it breaks page scrolling or swiping functionality. As soon as good solution will be found it will be published here.
|
151
|
+
|
152
|
+
#### Page transition performance problems
|
153
|
+
In case of problems with pages transition performance just uncomment appropriate lines in *layout.erb* file of your application:
|
154
|
+
|
155
|
+
:::html
|
156
|
+
// Uncomment these options in case of performance problem in pages transition
|
157
|
+
//$.mobile.defaultPageTransition = 'none';
|
158
|
+
//$.mobile.defaultDialogTransition = 'none';
|
159
|
+
//$.mobile.ajaxEnabled = false;
|
160
|
+
//$.mobile.pushStateEnabled = false;
|
161
|
+
//$.mobile.loadingMessageDelay = 50; // in ms
|
162
|
+
|
163
|
+
You may find it at very end of *mobileinit* handler function.
|
164
|
+
|
122
165
|
## Loading screen
|
123
166
|
|
124
167
|
Rhodes supports the display of a custom "Loading" screen while your application is launching. This screen's source is the file loading.html, located at <application-root>/app/loading.html.
|
@@ -106,6 +106,7 @@
|
|
106
106
|
</application>
|
107
107
|
|
108
108
|
<uses-permission android:name="android.permission.INTERNET" />
|
109
|
+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
109
110
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
110
111
|
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
|
111
112
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
@@ -13,6 +13,7 @@ public class Capabilities {
|
|
13
13
|
public static final boolean RECORD_AUDIO_ENABLED = true;
|
14
14
|
public static final boolean SDCARD_ENABLED = true;
|
15
15
|
public static final boolean VIBRATE_ENABLED = true;
|
16
|
+
public static final boolean MOTOROLA_ENABLED = false;
|
16
17
|
public static final boolean WEBKIT_BROWSER_ENABLED = false;
|
17
18
|
|
18
19
|
}
|
@@ -81,6 +81,7 @@ ANDROID_PERMISSIONS = {
|
|
81
81
|
'calendar' => ['READ_CALENDAR', 'WRITE_CALENDAR'],
|
82
82
|
'sdcard' => 'WRITE_EXTERNAL_STORAGE',
|
83
83
|
'push' => proc do |manifest| add_push(manifest) end,
|
84
|
+
'motorola' => nil,
|
84
85
|
'webkit_browser' => nil
|
85
86
|
}
|
86
87
|
|
@@ -174,7 +175,7 @@ def set_app_name_android(newname)
|
|
174
175
|
|
175
176
|
caps_proc = []
|
176
177
|
# Default permissions. Need to be always enabled.
|
177
|
-
caps = ['INTERNET', 'PERSISTENT_ACTIVITY', 'WAKE_LOCK']
|
178
|
+
caps = ['INTERNET', 'PERSISTENT_ACTIVITY', 'WAKE_LOCK', 'SYSTEM_ALERT_WINDOW']
|
178
179
|
$app_config["capabilities"].each do |cap|
|
179
180
|
cap = ANDROID_PERMISSIONS[cap]
|
180
181
|
next if cap.nil?
|
@@ -387,6 +388,7 @@ namespace "config" do
|
|
387
388
|
$ext_android_manifest_changes= []
|
388
389
|
$ext_android_resources_addons = []
|
389
390
|
$ext_android_additional_sources_list = []
|
391
|
+
$ext_android_additional_lib = []
|
390
392
|
|
391
393
|
$gapikey = $app_config["android"]["apikey"] unless $app_config["android"].nil?
|
392
394
|
$gapikey = $config["android"]["apikey"] if $gapikey.nil? and not $config["android"].nil?
|
@@ -583,6 +585,7 @@ namespace "config" do
|
|
583
585
|
$app_config["capabilities"] += ANDROID_CAPS_ALWAYS_ENABLED
|
584
586
|
$app_config["capabilities"].map! { |cap| cap.is_a?(String) ? cap : nil }.delete_if { |cap| cap.nil? }
|
585
587
|
$use_google_addon_api = true unless $app_config["capabilities"].index("push").nil?
|
588
|
+
$use_motosol_barcode_api = false #true unless $app_config["extensions"].index("barcode").nil?
|
586
589
|
|
587
590
|
$applog_path = nil
|
588
591
|
$applog_file = $app_config["applog"]
|
@@ -591,6 +594,19 @@ namespace "config" do
|
|
591
594
|
$applog_path = File.join( $app_path, $applog_file )
|
592
595
|
end
|
593
596
|
|
597
|
+
# Look for Motorola barcode SDK addon
|
598
|
+
if $use_motosol_barcode_api
|
599
|
+
Dir.glob(File.join($androidsdkpath, 'add-ons', '*')).each do |dir|
|
600
|
+
apijar = File.join(dir, 'libs', 'com.motorolasolutions.scanner.jar')
|
601
|
+
if File.exists? apijar
|
602
|
+
$motosol_jar = apijar
|
603
|
+
end
|
604
|
+
end
|
605
|
+
if $motosol_jar.nil?
|
606
|
+
raise "No Motorola Solutions SDK addon is found!!!"
|
607
|
+
end
|
608
|
+
end
|
609
|
+
|
594
610
|
# Detect android targets
|
595
611
|
if $androidtargets.nil?
|
596
612
|
$androidtargets = {}
|
@@ -812,6 +828,14 @@ namespace "build" do
|
|
812
828
|
end
|
813
829
|
end
|
814
830
|
end
|
831
|
+
|
832
|
+
android_additional_lib = extconf["android_additional_lib"]
|
833
|
+
if android_additional_lib != nil
|
834
|
+
android_additional_lib.each do |lib|
|
835
|
+
$ext_android_additional_lib << File.join(p, ext, lib)
|
836
|
+
end
|
837
|
+
end
|
838
|
+
|
815
839
|
puts "#{extyml} is processed"
|
816
840
|
end
|
817
841
|
|
@@ -1221,12 +1245,9 @@ namespace "build" do
|
|
1221
1245
|
|
1222
1246
|
# desc "Build Rhodes for android"
|
1223
1247
|
task :rhodes => [:rhobundle, :librhodes] do
|
1224
|
-
javac = $config["env"]["paths"]["java"] + "/javac" + $exe_ext
|
1225
|
-
|
1226
1248
|
|
1227
1249
|
set_app_name_android($appname)
|
1228
1250
|
|
1229
|
-
|
1230
1251
|
rm_rf $tmpdir + "/Rhodes"
|
1231
1252
|
mkdir_p $tmpdir + "/Rhodes"
|
1232
1253
|
|
@@ -1386,56 +1407,39 @@ namespace "build" do
|
|
1386
1407
|
lines << "\"" +$app_native_libs_java+"\""
|
1387
1408
|
lines << "\"" +$app_capabilities_java+"\""
|
1388
1409
|
lines << "\"" +$app_push_java+"\""
|
1389
|
-
|
1390
|
-
puts 'ext_build.files found ! Addditional files for compilation :'
|
1391
|
-
File.open(File.join($extensionsdir, "ext_build.files")) do |f|
|
1392
|
-
while line = f.gets
|
1393
|
-
line.chomp!
|
1394
|
-
puts 'java file : ' + line
|
1395
|
-
lines << "\""+line+"\""
|
1396
|
-
end
|
1397
|
-
end
|
1398
|
-
else
|
1399
|
-
puts 'ext_build.files not found - no additional java files for compilation'
|
1400
|
-
end
|
1410
|
+
|
1401
1411
|
|
1402
1412
|
# process collected ext src files
|
1403
1413
|
puts 'process additional java files for build from extensions :'
|
1404
1414
|
$ext_android_additional_sources_list.each do |s|
|
1405
1415
|
s.chomp!
|
1406
1416
|
puts 'java file : ' + s
|
1407
|
-
lines <<
|
1417
|
+
lines << s
|
1408
1418
|
end
|
1409
1419
|
|
1410
1420
|
File.open(newsrclist, "w") { |f| f.write lines.join("\n") }
|
1411
1421
|
srclist = newsrclist
|
1412
1422
|
|
1413
|
-
args = []
|
1414
|
-
args << "-g"
|
1415
|
-
args << "-d"
|
1416
|
-
args << $tmpdir + '/Rhodes'
|
1417
|
-
args << "-source"
|
1418
|
-
args << "1.6"
|
1419
|
-
args << "-target"
|
1420
|
-
args << "1.6"
|
1421
|
-
args << "-nowarn"
|
1422
|
-
args << "-encoding"
|
1423
|
-
args << "latin1"
|
1424
|
-
args << "-classpath"
|
1425
1423
|
classpath = $androidjar
|
1426
1424
|
classpath += $path_separator + $gapijar unless $gapijar.nil?
|
1425
|
+
classpath += $path_separator + $motosol_jar unless $motosol_jar.nil?
|
1427
1426
|
classpath += $path_separator + "#{$tmpdir}/Rhodes"
|
1428
1427
|
Dir.glob(File.join($extensionsdir, "*.jar")).each do |f|
|
1429
1428
|
classpath += $path_separator + f
|
1430
1429
|
end
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1430
|
+
|
1431
|
+
javafilelists = [srclist]
|
1432
|
+
|
1433
|
+
extlist = File.join $extensionsdir, "ext_build.files"
|
1434
|
+
if File.exists? extlist
|
1435
|
+
puts "#{extlist} is found! THere are addditional java files"
|
1436
|
+
javafilelists << extlist
|
1437
|
+
else
|
1438
|
+
puts 'ext_build.files not found - no additional java files'
|
1437
1439
|
end
|
1438
1440
|
|
1441
|
+
java_compile($tmpdir+'/Rhodes', classpath, javafilelists)
|
1442
|
+
|
1439
1443
|
files = []
|
1440
1444
|
Dir.glob(File.join($extensionsdir, "*.jar")).each do |f|
|
1441
1445
|
puts Jake.run($jarbin, ["xf", f], File.join($tmpdir, "Rhodes"))
|
@@ -1519,6 +1523,9 @@ namespace "package" do
|
|
1519
1523
|
Dir.glob($extensionsdir + "/lib*.so").each do |lib|
|
1520
1524
|
cp_r lib, File.join($tmpdir, "lib/armeabi")
|
1521
1525
|
end
|
1526
|
+
$ext_android_additional_lib.each do |lib|
|
1527
|
+
cp_r lib, File.join($tmpdir, "lib/armeabi")
|
1528
|
+
end
|
1522
1529
|
args = ["uf", resourcepkg]
|
1523
1530
|
# Strip them all to decrease size
|
1524
1531
|
Dir.glob($tmpdir + "/lib/armeabi/lib*.so").each do |lib|
|
@@ -24,6 +24,8 @@
|
|
24
24
|
# http://rhomobile.com
|
25
25
|
#------------------------------------------------------------------------
|
26
26
|
|
27
|
+
require 'tempfile'
|
28
|
+
|
27
29
|
#common functions for compiling android
|
28
30
|
#
|
29
31
|
# uses following globals
|
@@ -373,6 +375,43 @@ def cc_clean(name)
|
|
373
375
|
end
|
374
376
|
end
|
375
377
|
|
378
|
+
def java_compile(outpath, classpath, srclists)
|
379
|
+
javac = $config["env"]["paths"]["java"] + "/javac" + $exe_ext
|
380
|
+
|
381
|
+
fullsrclist = Tempfile.new 'RhodesSRC_build'
|
382
|
+
srclists.each do |srclist|
|
383
|
+
lines = []
|
384
|
+
File.open(srclist, "r") do |f|
|
385
|
+
while line = f.gets
|
386
|
+
line.chomp!
|
387
|
+
fullsrclist.write "#{line}\n"
|
388
|
+
end
|
389
|
+
end
|
390
|
+
end
|
391
|
+
fullsrclist.close
|
392
|
+
|
393
|
+
args = []
|
394
|
+
args << "-g"
|
395
|
+
args << "-d"
|
396
|
+
args << $tmpdir + '/Rhodes'
|
397
|
+
args << "-source"
|
398
|
+
args << "1.6"
|
399
|
+
args << "-target"
|
400
|
+
args << "1.6"
|
401
|
+
args << "-nowarn"
|
402
|
+
args << "-encoding"
|
403
|
+
args << "latin1"
|
404
|
+
args << "-classpath"
|
405
|
+
args << classpath
|
406
|
+
args << "@#{fullsrclist.path}"
|
407
|
+
puts Jake.run(javac, args)
|
408
|
+
unless $?.success?
|
409
|
+
puts "Error compiling java code"
|
410
|
+
exit 1
|
411
|
+
end
|
412
|
+
|
413
|
+
end
|
414
|
+
|
376
415
|
def apk_build(sdk, apk_name, res_name, dex_name, debug)
|
377
416
|
puts "Building APK file..."
|
378
417
|
prev_dir = Dir.pwd
|
data/platform/wm/build/wm.rake
CHANGED
@@ -101,7 +101,7 @@ namespace "config" do
|
|
101
101
|
$cabwiz = File.join($config["env"]["paths"]["cabwiz"], "cabwiz.exe") if $config["env"]["paths"]["cabwiz"]
|
102
102
|
$cabwiz = "cabwiz" if $cabwiz.nil?
|
103
103
|
$webkit_capability = !($app_config["capabilities"].nil? or $app_config["capabilities"].index("webkit_browser").nil?)
|
104
|
-
$wk_data_dir =
|
104
|
+
$wk_data_dir = "/Program Files" # its fake value for running without motorola extensions. do not delete
|
105
105
|
|
106
106
|
begin
|
107
107
|
if $webkit_capability
|
@@ -111,13 +111,11 @@ namespace "config" do
|
|
111
111
|
rescue
|
112
112
|
puts "rhoelements gem is't found, webkit capability is disabled"
|
113
113
|
$webkit_capability = "0"
|
114
|
-
$wk_data_dir = ""
|
115
114
|
end
|
116
115
|
|
117
116
|
unless $build_solution
|
118
117
|
$build_solution = 'rhodes.sln'
|
119
118
|
end
|
120
|
-
#$startdir = $app_config["sdk"]
|
121
119
|
|
122
120
|
if $app_config["wm"].nil?
|
123
121
|
$port = "11000"
|
@@ -351,7 +349,7 @@ namespace "device" do
|
|
351
349
|
File.open(filepath, "w") { |f| f.write(config) }
|
352
350
|
end
|
353
351
|
end
|
354
|
-
|
352
|
+
|
355
353
|
args = ['build_inf.js', $appname + ".inf", build_platform, '"' + $app_config["name"] +'"', $app_config["vendor"], '"' + $srcdir + '"', $hidden_app, ($webkit_capability ? "1" : "0"), $wk_data_dir]
|
356
354
|
|
357
355
|
puts Jake.run('cscript',args)
|
data/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.0.beta.
|
1
|
+
3.3.0.beta.3
|
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:
|
4
|
+
hash: 62196469
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 3
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 3.3.0.beta.
|
11
|
+
- 3
|
12
|
+
version: 3.3.0.beta.3
|
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-
|
20
|
+
date: 2011-12-29 00:00:00 -08:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|