Sometime we try to run rake run:bb and we get following error:
[...stuff deleted]
cp -r platform/bb/build/../hsqldb/src/com/rho/file/
PersistRAFileImpl.java C:/Doc
uments and Settings/mrcorba/storemanager/bin/tmp/vsrc/com/rho/file
executing javac
PWD: C:/Ruby19/lib/ruby/gems/1.9.1/gems/rhodes-1.5.4
CMD: "C:/Program Files/Java/jdk1.6.0_03/bin/javac.exe" -g -d "C:/
Documents and S
ettings/mrcorba/storemanager/bin/tmp" -classpath "C:/Documents and
Settings/mrco
rba/storemanager/bin/RhoBundle.jar;C:/Documents and Settings/mrcorba/
storemanage
r/preverified/RubyVM.jar" -bootclasspath "C:/Program Files/Research In
Motion/Bl
ackBerry JDE 4.6.0/lib/net_rim_api.jar" -source 1.3 -target 1.3 -
nowarn "@C:/Doc
uments and Settings/mrcorba/storemanager/bin/tmp/vsrc_build.files"
@platform/bb/
build/hsqldb_build.files @platform/bb/build/rhodes_build.files
javac: invalid flag: C:/Documents
Usage: javac
use -help for a list of possible options
Error compiling java code
Solution Try to move your app into a folder without spaces. Ex If you project is in C:\some directory\Rhodes_application then put your applicaton in C:\some_directory\Rhodes_application This is because sometime Rhodes is not able to count white spaces.
-----------------------------------------------------------------------------
P.S : If anyone can suggest any other ways he is welcome to comment on the Blog :)
Rhomobile provide a mini ORM called Rhom. It is similer to Active Record of Rails but with less features.It provides a high level way to make the local database easier to program. That database is SQLite on all platforms except BlackBerry where it is HSQL.
We can choose to store data in two way Propery Bag or Fixed Schema
Property Bag
All the data is store in stores in single table. Property bag is a db table which contains object id/attribute/value triplets and therefore set of attributes for each object is arbitrary.
Advantage
It is simple to use, no require for specifiyng attributes before use
we don't need to migrate data if we add/remove attributes
Disadvantage
Size is 3 times bigger than fixed schema
Slow while sync
This is how model look for PropertyBag:
class Employee
include Rhom::PropertyBag
# Uncomment the following line to enable sync with Employee.
# enable :sync
#add model specifc code here
end
Fixed Scema
Fixed schema is a regular db table with fixed set of columns (attributes)
Advantage
Smaller size, you can specify index for only required attributes
Faster sync time then Property bag
Disadvantage
You have to support all schema changes
This is how fixed schema model looks :
class Employee
include Rhom::FixedSchema
# Uncomment the following line to enable sync with Employee.
# enable :sync
set :schema_version, '1.1'
property :name, :string
property :age, :string
property :company, :string
property :address, :string
property :gender, :string
property :salary, :string
#add model specifc code here
end
Note : You have to reset database if you change the property
When you use Fixed Schema model application developer is responsible for sql schema. So when you add or delete some properties or just change app logic you may need to perform data migration or database reset. So if you have to add a column in a table we have to add a property and then reset the Device.
To create a index in fixed schema we will write following line in model :
index :by_name_tag, [:name, :tag] #will create index for name and tag columns
To create a primary key in fixed schema we will write following line in model :
unique_index :by_phone, [:phone]
Choosing in between PropertyBag and FixedSchema depend on you requirement.
This will cost you around 20 US doller. Signature files can be only registered once per computer.
Note : You have to enter PIN while filling a form. Please remember this PIN as it will be used later
Step 2.) You will recive 3 .CSI from blackberry. Download this files.
Step3.) Creating sigtool.csk and sigtool.db files
i) Double-click on the attachment. ii) If a dialog box appears that states that a private key cannot be found, complete steps 3 through 6 before you continue. Otherwise, proceed to step vii. iii) Click "Yes" to create a new key pair file. iv) Type a password for your private key of at least viii characters, and type it again to confirm. This is your private key password, which protects your private key. Please remember this password as you will be prompted for it each time signing is attempted or a signature key is installed. v) Click "Ok" vi) Move your mouse to generate date for a new private key. vii) In the "Registration PIN" field, type the PIN number that you supplied on the signature key order form. viii) In the Private Key password field, type the password created in step iv. ix) Click "Register". x) Click "Exit". 11) Repeat this process for the other .csi files.
Once this process is complete sigtool.csk and sigtool.db files will be created in bin directory of your Blackberry JDK
Step 4.)Then you can provide password in rhobuild.yml file (located in the Rhodes SDK folder)
build:
bbsignpwd:
Step 5.) Run this code in your application directory
rake device:bb:production
Step 6.)Now you can check your build in
OTA: /bin/target
You should see many .cod files and one .jad file
Upload all of those files to a web server, then open the .jad file from the browser on your blackberry device
If you run "rake rhosync:start" by default it will start on port 9292. This command call 'rackup config.ru' without specifying the port To start Rhosync server on Specific Port you can use