I've been working on a jQuery mobile web app written in Ruby on Rails, and would like to make it available as a native Android app. I've setup the phonegap project to load my url, and everything seems to be working, but I've been reading that Google will reject the app if it's simply a webview container to an external url. Has anyone had any experience with this?
From what I can tell, I'll need to rewrite the web app to use ajax calls to populate the page, as opposed to relying solely on web requests to my web server. Can anyone offer any insight into this? Would they accept a PhoneGap app that simply loads an external url? Any help is appreciated.
Update1: I've also read that being able to handle no internet connection is one of the main reasons they will approve/reject your app. I think this could be handled in the android app with some logic that checks for an internet connection, and if it exists, load the external url, if it doesn't load a local html splash page. Would this idea be ok?
Update2: Would it be an option to have a "skeleton" of the app as basic html files within the phone gap app, which just uses ajax to pull down all of the main html? That way the app would still function without an internet connection, but you could also make large changes to the content of the pages which would be pulled down in every request. Is that a viable option?
I've never heard of an app being rejected from the Play Store due to just being a WebView container. But even if they wont reject your app for this, you shouldn't be building a PhoneGap application this way. You'll end up with an app that will feel like it's just a WebView container, and an app that breaks easily when connectivity gets spotty. Remember that even in good reception, latency on a phone is high, so reducing the number of requests you have to make (for static files and assets) is paramount.
Ideally, when porting a web site to a PhoneGap application, you should be decoupling your interface as much as possible. Fewer variables should be passed down from the controller to the views, and more data should pass through AJAX calls. When your front end code (all of the files in app/views) can be served statically, moving to a PhoneGap app is easy.
Ensure that the actions in your controllers all have responses for JS (format.js
), not just HTML. Your views should be making AJAX calls to rails to get the data that fills in pages via AJAX. Then you can bundle your views (and your assets) into your PhoneGap app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With