HiveBrain v1.2.0
Get Started
← Back to all entries
patternjavaCritical

MVC pattern on Android

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
patternmvcandroid

Problem

Is it possible to implement the model–view–controller pattern in Java for Android?

Or is it already implemented through Activities? Or is there a better way to implement the MVC pattern for Android?

Solution

In Android you don't have MVC, but you have the following:

  • 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.

Context

Stack Overflow Q#2925054, score: 242

Revisions (0)

No revisions yet.