TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

6 点作者 foobarram将近 13 年前
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.

1 comment

swanson将近 13 年前
The following metaphors are more or less accurate and helped me with the same transition (MVC web architecture to Android):<p>* Layouts are like views, though Android's XML layouts aren't able to have conditionals or logic like most web app templates<p>* Intents are like URLs, the Manifest file is like the router<p>* Activities are like controllers, you should aim to keep them "thin". This is also where callbacks for things like button clicks live<p>* You can use sqlite on Android, but there isn't anything like the Django ORM built-in<p>* SharedPreferences can act as a key-value store for small data (sort of like Redis I suppose)<p>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).
评论 #4086644 未加载
评论 #4083484 未加载