Friday, February 20, 2009

Developing mobile applications using Rhomobile's Rhodes

Rhodes, an open source framework, let's you develop mobile applications for smart phones (Blackberry, iPhones) easily, and the best part is, you can use Ruby to do it. Refer this if you are planning to develop mobile interfaces for your app. I have been exploring Rhodes (version 0.3.0 on windows) for a week and below are my tips, issues, tweaks to make your life easier.

Install:

Below steps were missing in the installation document.
  1. Install the RhoSync Server - gem install cucumber
  2. Generating a Source Adapter Class - gem install sqlite3-lib
  3. Generating Rhodes Application and Resources - gem install TZinfo
Issues Faced:
rhogen - code generator throwing exception.
rename gems\rhodes-0.3.0\lib\rational.rb to gems\rhodes-0.3.0\lib\rational_____.rb
Haven't had any issues after renaming this.
Sample Lighhouse app did not work in Rhosync server
change all base_url variable to @source.url (in /rhosync/lib/lighthouse_*.rb)
or
add a method base_url to return @source.url
RhodesApp in Blackberry simulator, did not get the data from my Rhosync server
when checked the log (rhodes/bb/build/rholog.txt) you see Open DNS error
change source url from http://localhost:3000/apps/5/sources/22 to http://127.0.0.1:3000/apps/5/sources/22
for some unknown reason, Simulator is not finding localhost
Now my Rhodes App is syncing with Rhosync server, but my updates are not reflected in Rhosync server
You see Error 500 while processing sync operation in the logs (rhodes/bb/build/rholog.txt)
copy the url and paste it in browser (after removing url suffix ;deviceside=true), you see "Invalid datetime for column created_at" error
change last_sync_time.to_s to last_sync_time.to_s(:db) in object_inject_query line in /rhosync/app/helpers/sources_helper.rb
Not able to launch Blackberry Simulator, after installing.
Uninstall and Reinstall Blackberry Simulator in "My Documents" instead of "Program Files", the default folder.
Blackberry Simulator doesn't sync if you enter invalid username/password
You have to login to Sync Engine for the Sync Operation to work
Simulator has been running for a while, and now it is taking long time to sync with Rsync server.
Restart the simulator
When you update a source in Simulator and go back to sources list page, you don't see your changes.
After checking your logs, you see alloc failed error
You need to restart it to make it work again
After updating a source in Simulator, wait for the Sync operation to occur. After syncing, your changes are lost in simulator but are reflected in the server
Maybe it gets old data from cache. For some reason its not syncing again the updated record.
This bug needs to be fixed and I have no workaround at this time.
After changing source_url in /config.rb, still simulator uses old source_url
Simulator not updating source_url in the database
When you click reset menu in the Simulator toolbar, it hangs and doesn't clean the database.
Don't know why

Tips:
  1. Simulator - Sync Engine - syncs every 10 minutes
  2. Simulator - Sync Engine - login process not clear
  3. Simulator - Sync Engine - Lets say you have two apps each with different login, Sync Engine allows you to login only after entering both the username/password combinations
Concerns:
  1. Source Adapter in rhosync doesn't report the error clearly
  2. while sync in progress and if the network fails, update will be lost, simulator won't retry you updates.
  3. Need unittests for the framework classes.
  4. Simulator takes long time to start, meaning for each small change you will lose lot of time. If testing framework incorporated, that will really help us.
Amid these issues, Rhodes is really a cool framework.
Have you experienced Rhodes?

3 comments:

  1. Hi,

    I am the author of the Lighthouse sample that you tried. Sorry about the troubles you encountered.

    A good place to post questions and ask for help is http://groups.google.com/group/rhomobile.

    With regards to the Lighthouse sample, it was not tested extensively under Blackberry simulator on Windows. That could easily have been part of the problem.

    That sample is being commercialized as Issues To Go, http://www.issuestogo.com. It is an open source project, and you can find the latest sources here: http://github.com/VGraupera/rhodes-issues2go/tree/master. Soon I will begin moving it to Blackberry so I invite you to follow the project and try again in a couple of weeks.

    You might want to start by stepping through the tutorials on the Rhodes wiki.

    A sample that you could try that should work is the RhoCRM (previously RhoSugar) located at:

    http://github.com/rhomobile/rhodes-sugar-sample/tree/master

    Best regards,

    Vidal.
    http://www.vdggroup.com

    ReplyDelete
  2. Vidal, Thanks for your response.

    ReplyDelete
  3. Hello Muthu,

    I'm looking for a RHOmobile programmer so we may launch our mobile applications across the major smarthphone platforms. If you are interested, you may contact me at mattgreenhut@gmail.com

    Matt Greenhut
    Greenhut Productions

    ReplyDelete