

Ask HN: How to go from a Django app to Android app. - foobarram

We have a properly structured Django app, which we now want to develop an Android app for with the same functionalities as the Django app. What is the most relatively pain free way going about achieving this? p.s: our devel team has no prior Android experience.
======
swanson
The following metaphors are more or less accurate and helped me with the same
transition (MVC web architecture to Android):

* Layouts are like views, though Android's XML layouts aren't able to have conditionals or logic like most web app templates

* Intents are like URLs, the Manifest file is like the router

* Activities are like controllers, you should aim to keep them "thin". This is also where callbacks for things like button clicks live

* You can use sqlite on Android, but there isn't anything like the Django ORM built-in

* SharedPreferences can act as a key-value store for small data (sort of like Redis I suppose)

If you can expose all of your app's functionality through an API, then you can
just treat the Android app as an API client. If not (or if you want the app to
be more than a wrapper), I would aim for the prototypical "thin controller,
fat model" pattern and push all the business logic into plain Java objects if
possible (so much easier to unit test).

~~~
jat1
There is a fairly good ORM addition to SQLite that can be used on android. We
are currently using it for one of our projects - <http://ormlite.com/>

~~~
foobarram
Thanks for this info jat. I will look into this.

