Building mobile app derivative of Rails web app - android

How does one approach building the mobile app version of one's Rails app, with little to no mobile development experience? iOS, Android, one or the other, or both.

First, you might want to create (private) APIs for services your web app provides. The de facto standard for Android apps is REST-like endpoints that accept/return JSON. You can use whatever Ruby REST framework works best. Then you need to consider how you would authenticate Android apps, if needed. Do you use the same authentication database? Can you allow anonymous access, what parts of the app do you expose, etc.
Finally, you need to build the frontend. A few options here:
learn Android
hire someone to do it
use a framework that lets you develop using Web(-like) technologies: Thitanium, Rhodes, etc. The upside is that you get to use what you know and might also get an iOS app for free.
The downside is that you can never get the native performance, and look-and-feel might not be completely Android-like (never used Rhodes, so maybe it does this well enough, but still)

Consider using http://www.rhomobile.com/.

Related

Convert My MVC4 Web application to Android?

I have a web application developed on .NET Framework using MVC4. So now I need to create a Android Application for it.
Do I have to convert my entire C# code to Java (The code in
controllers in my MVC app)?
Will it be better if I use Xamarin?
Can I just create new Views for my application as I have controllers
and Models?
How do I approach this?
You won't be able to rip out your Models and Controllers directly from your MVC4 app and stuff it into an Xamarin.Android Application. However you will be able to reuse some of it. Especially the models.
At work I ported a Silverlight app to WP7/Android/iOS apps where a lot of the logic fetching data from servers, models and more were directly copy/pasted. However all the Views and logic for the Views had to be written from scratch as View Ports are different on a Computer monitor and a mobile device, and general UI is very different.
Also using the MVVM pattern helps separating the UI from the Model making the apps more testable and allows more code sharing. For this I use MvvmCross. There is also an MVC alternative called MonoCross. Both are free as in beer and as in speech. Both of these are for Xamarin.Android.
If you are only going to make an Android application and not going to be making it for other platforms as well and don't want to pay the price of the Xamarin products you should be able to make it in native Android. I don't see why this is possible. However you really need to find out what it is you want.
What does your Web App do? My guess is that it somehow manipulates some data in a database. So you would need to alter your Web App to expose that database in some kind of Web Service, maybe RESTful or otherwise.
You will need to layout your Android application such that the Views of the Web App you have fits into the smaller view ports of the mobile devices. A good too for this is to sketch your Android app out on paper and make arrows and annotations. You probably already know the model of your code in the Web App, it would be similar in your Android app. So get started coding the Views and then wire them up to the Web Service.
If you have read this far you might notice my answer is very vague. This is because your question is very vague.
I see more and more professional mobile app from different companies that are simply build upon the same companies' responsive Web Application (Website).
Either they use Cordova or some other technology, I can't say.
The architect is simple: 1- build a professional well-designed angularJs web application; 2- and then use Cordova to convert it to mobile apps (iOS, android, etc.).
Is it really that simple? hmmm.... maybe not! But theoretically it should work.
The good thing is Visual Studio still supports Cordova, even after Microsoft bought Xamarin.
https://www.visualstudio.com/vs/cordova/
You can start here:
https://taco.visualstudio.com/en-us/docs/get-started-first-mobile-app/
Happy Cross Platform Mobile Developing!

Architecture Best Practice: Rails and Mobile/Web App

I am having a browser-oriented web app build on Rails (3.1). I want to make some features of the web app available on mobile devices, too.
Besides...
1.) Building native apps for each vendor of devices and interacting with my rails web app using JSON/XML, ...
I am thinking about reusing as much as business logic already implemented in my rails app by reusing controllers/models and add some new views targeted to mobile devices (in terms of screen size and the like...).
With this approach, I see two alternatives:
2.) Let the end user access the part of the rails app targeted to mobile devices in the mobile browser.
3.) Set up a native mobile app wrapper, e.g. using PhoneGap, and refer to the same part of the rails app used for 2.).
The advantage of 3.) is that I can reuse business logic of my rails web app and having a "phantom" native app for mobile devices at the same time. (I used the term "phantom" because besides the wrapper, it's not really native, this approach actually just mimics a native app.)
Question 1: Are there any other alternatives besides 1.) to 3.) ?
Regarding 3.)
Question 2: Does Apple accept this kind of apps (which fetch large portions remotely) to be uploaded to the app store?
-> I would be surprised if it is so, because it would allow one to change large parts of the app without the notice of Apple.
Question 3: From an architectural/technical point of view, is it recommended to remotely fetch prerenderd html/js to be executed in a "phantom" native mobile app build on top of e.g. PhoneGap?
-> Wouldn't it be better to set up an independent client app within the native mobile app (maybe using backbone.js), keeping all html, css, js locally within the mobile app, and communicate with the backend using JSON/XML or whatever?
I think this is a good question and I've recently come across similar difficulties. I've ended up using (Q3) vaadin with touchkit. Fine if you're doing free but a bit expensive if you're doing commercial (although then you can probably afford it). I realise this doesn't relate to rails but still, I'm assuming the main point of the question was should I build native apps which use web services / middleware or go for pure web apps.
RE (Q2), during my trawl of this current technology, I did read a few articles suggesting that apple are not allowing the web app style. As in, app which simply masks browser window loading remote web app. Essentially, I think where apple are concerned, you'd need to have the functionality tied down to what they agreed to. This doesn't really affect web apps though as you can surely just access them directly from the browser.
RE (Q1), the only alternatives I can see would be different middleware (e.g. MQ, SOAP etc).

Client Server approach for Android application

I currently have a working implementation using GAE and servlets to communicate with my android application. The app will create json objects and send/receive them using the httpclient. I then was looking at the 2.4 beta plugin for using C2DM and noticed that they use GWT along with a RequestFactory for communication. I was wondering if this approach is worth the time switching? Is it easy to setup and configure? Seems like this would be a nice approach if i want to say develop a mobile site along with the app?
If you use C2DM you will need your users to use a google account. I personally don't feel 100% confortable with that.
The best thing about C2DM is that you avoid polling your GAE server. If you have an already working solution, why would you change it?
I would recommend android - appengine combination. However if you want your app to be on non google-play device, you need to think around C2DM/LVL or google wallet API(a mandatory on google play). RequestFactory is great but it is tightly coupled, imho. I would recommend Rest which is platform agnostic, very loosely coupled, thus support GWT, android, iOS, BlackBerry, WebOS, desktop ...

How should I approach making server-side software for an Android application?

In the past I have used Python for backend stuff along with Django for frontend stuff, but I don't know how well those two work with Android.
Can anyone recommend a good way to go about making server-side software that works well with Android?
Please take into account that I also want a web application as a frontend, so the backend should work with both the web app and the Android app.
Thanks for the help!
You might start by developing an HTTP API using Django, tornado, cherrypy, or any other web framework. This API may then be used by both your web frontend and your Android application.
In general, separating out the API from the application serves to clean up the code and make future changes easier. In this case, it also makes it easy for you to have multiple frontends without having to replicate the backend functionality.
If it's possible to create a web application version of your project, consider that it may be easiest just to create a version of that application which is formatted for the android screen, and allow Android users to use the same web application with appropriate styling.

Advice for a mobile app for reading a publication

I'm considering developing apps for Android and Windows Phone 7 that allow the user to read content from an online producer (newspaper/magazine/blogs etc). This provider has a REST API that should allow for straightforward access to the content. A few questions I have:
I saw an OData demo, where getting data from a feed was super easy, with no parsing of any sort required. Is it worth building an OData provider on top of the publication's existing API, just to make it easier for the mobile apps to get data?
I have heard that C++ can be used on wp7 and Android. Is there any reason to develop an app core in C++, then interact with the device APIs in C#/Java? Or is the core logic layer of the app so thin that it's not worth the hassle? It seems like there's really not that much to developing a publication reader app - basically just a GUI on top of an API that provides all the data.
Or, would it make more sense to just develop a mobile version of this publication's web site? Then there could be one service for all mobile platforms. What are the pros and cons of an app that runs on the device as opposed to a website specially built for mobile devices? (Like the Gmail, Google Docs, and GTalk "apps" for the iPhone.)
Thanks.
C++ is not a development language for Windows Phone 7. There are two development platforms for WP7: Silverlight and XNA. There is no possibility of interop with a C++ module.
As far as I know, C++ cannot currently be used to develop WP7 applications. I would check on that before you try to go too far down a cross-compatibility road.
That said, the UI between WP7 and the iPhone is really, really different - the backend code is so small in comparison to well-written UI later, I'd just write two separate apps. It may seem like a time savings but either your app is going to look like it does not belong to one platform or the other, or you'll be spending more time trying to keep the compatible stuff working OK on two platforms.

Categories

Resources