How to create iPad application that reuses my JS libraries that are build for web application

129 Views Asked by At

So I am a web (Rails) developer, and I would like to create an iPad application for my site. The web application heavily relys on javascript libraries that are built specifically to interact with users in a unique manner.

Now I would like to transform that same interaction to my iPad application. I need a way to reuse my js files since re-coding the libraries will take forever. There are three options that I might follow:
1- Using Rhodes: built on ruby and inspired from rails.
2- PhoneGap: which is basically a web browser inside an app, so I presume that including js files would be possible.
3- xCode: which will take lot of time for me to learn and implement.

My questions are:
1- Can I import my js files in the rhodes project?
2- Which is the best to implement this?
3- Is there any other options that I should be looking at?

Any hints and pointers will be greatly appreciated,

Thanks a lot everybody

1

There are 1 best solutions below

3
On BEST ANSWER

As i am not aware of the app you are developing & its design, Two approaches i see here as it is Rails,

Mobile Web

  • The existing web app shall be customized to mobile web (iPad & most of the tablet in fact).
  • Create controllers specific to mobile/tablet. this shall connect to views created specific to mobile/tablet.
  • Detect the device/platform when HTTP request is posted and re-direct to specific views you have created.

Good thing is your JS is always the same(will need minor modifications thou) and dev time reduced significantly without learning new stuffs.

PhoneGap

You can pull up all the JS you have written and build some html/css integrate everything and build the project inside a phonegap template for iOS and create a on-device app and distribute. but the JS will undergo some changes here too.

But this will no way be different than mobile web and this comes other overheads like CORS and build/release, updates management & app stores etc.

Native APP

As you said, you got to learn iOS development (objC). you can create RESTful services in your rails end and expose them to the iOS app.

Rhodes i am not very sure, its little tricky and it depends on your existing web app too. try it before deploying.