简体   繁体   English

为Android开发时的文件结构

[英]Filestructure when developing for android

I'm new to developing on android and I wonder how you organize your android projects? 我是不熟悉android开发的人,不知道您如何组织android项目? I have done a whole bunch of projects in ruby on rails lately, so is there a possibility to use a MVC-style approach? 我最近在Rails上完成了很多项目,所以有可能使用MVC风格的方法吗?

Yes, you surely can use a MVC pattern, meaning you will make a different class for the activity , a class for the view objects and a class for some "controller" objects. 是的,您当然可以使用MVC模式,这意味着您将为该activity创建一个不同的类,为view对象创建一个类以及为某些“控制器”对象创建一个类。 Also, MVC is implemented in many Java library classes, so is preatty handy that you do well with this pattern. 此外,MVC已在许多Java库类中实现,因此使用此模式做得很好很方便。

I'll give you an example: the ListView implements this pattern and you will be able to model the data separatelly from the layout and front-end. 我举一个例子: ListView实现此模式,您将能够从布局和前端分别对数据建模。

在这里看看这个帖子: Android上的MVC模式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM