Android上的MVC模式 [英] MVC pattern on Android
本文介绍了Android上的MVC模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在Java for Android中实现模型视图控制器模式?
Is it possible to implement the model–view–controller pattern in Java for Android?
还是通过活动实现?还是有更好的方法来实现Android的MVC模式?
Or is it already implemented through Activities? Or is there a better way to implement the MVC pattern for Android?
推荐答案
在Android中,你没有MVC,但是具有以下内容:
In Android you don't have MVC, but you have the following:
- 您可以定义您的用户界面通过分辨率,硬件等各种XML文件。
- 您可以定义您的资源在各种XML文件中的区域设置等。
- 你扩展类别,例如 ListActivity , TabActivity ,并使用 inflaters 。
- 你可以crea您希望为您的业务逻辑提供尽可能多的课程。
- 很多 Utils 已经为您写了 - DatabaseUtils,Html。
- You define your user interface in various XML files by resolution, hardware, etc.
- You define your resources in various XML files by locale, etc.
- You extend clases like ListActivity, TabActivity and make use of the XML file by inflaters.
- You can create as many classes as you wish for your business logic.
- A lot of Utils have been already written for you - DatabaseUtils, Html.
这篇关于Android上的MVC模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文