Convert a Ruby on Rails application to a native Android PhoneGap application

I was working on a jQuery mobile web application written in Ruby on Rails and would like to make it available as a native Android application. I set up the phonegap project to load my URL and everything seems to work, but I read that Google will reject the application if it is just a web view container for an external URL. Has anyone had experience with this?

From what I can say, I will need to rewrite the web application to use ajax calls to populate the page, and not rely only on web requests to my web server. Can anyone figure this out? Will they accept a PhoneGap app that just loads an external URL? Any help is appreciated.

Update1: I also read that the ability not to process the Internet connection is one of the main reasons why they approve or reject your application. I think this can be handled in an Android application with some logic that checks the Internet connection, and if it exists, download an external URL if it does not load the local html splash page. Will this idea be okay?

Update2: Is it possible to have the "skeleton" of the application as the main html files in the application to unlock the phone, which simply uses ajax to pull out all the main html? Thus, the application will function without an Internet connection, but you can also make significant changes to the content of the pages, which will be reset in each request. Is this a viable option?

+8
android jquery-mobile ruby-on-rails cordova
source share
1 answer

I have never heard that the application is rejected from the Play Store due to the fact that it is simply a WebView container. But even if they do not reject your application for this, you should not create a PhoneGap application in this way. In the end, you get an application that looks like a WebView container, and an application that breaks easily when the connection becomes spotty. Remember that even with good reception, the delay on the phone is high, so the maximum number of requests that you must fulfill (for static files and assets) is of paramount importance.

Ideally, when porting a website to the PhoneGap application, you should untie your interface as much as possible. Fewer variables should be passed from the controller to the views, and more data should go through AJAX calls. When your external code (all files in the application / views) can be transferred statically, the transition to the PhoneGap application is simple.

Make sure that all actions in your controllers have answers for JS ( format.js ), not just HTML. Your views must make AJAX calls to rails in order to get data that populates pages through AJAX. You can then link your views (and your assets) in your PhoneGap application.

+2
source share

All Articles