5

Possible Duplicate:
Is Model-View-Presenter (MVP) scheme useful for Android?

I've started coding for Android and I'm having difficulty trying to properly partition my code. I always end up with a very tight coupling between my UI logic and the actual controls I use to represent them.

I have background in both WPF MVVM and ASP.NET MVC so I'm familiar with those patterns. After some digging, I found Android Binding. It seems nice and fits nicely with my WPF background. However, it bugs me that its not built in. I'm pretty sure that the Android makers have thought of this when designing the Android programming interface. So my question is, what is the best practice pattern to use when developing in Android, if any. I have looked and looked at their site but didn't find anything...

Mel
  • 1,141

1 Answers1

0

When I start work on Android I know about MVC. Now I try to make Android app using MVC but when I start I success but here I write many lines of code without any purpose. And at the end my app having many line of codes which are only write for making MVC. Not for functionality. But now I am using my own design which is very good for me I make many big apps with this approach.

I give you small example or if you need more help I send you some template of code.

First decide what are the main functionality of your app like Your app having tabs or having only lists.

Instead I made scenario of an app at run time. Now suppose we have an app which save some data on local DB and it also get data from Server in JSON. After that I have list to show JSON data. And there are some sounds also play in the app in background. Now I also want to show data from mobile contacts. And also want to add social integration like FB etc.

Now start of code.
First create packages:

1.com.app.startup/splash (Splash + Initialization of any view here)
2.com.app.general (Made Application Object + Constant file where save constants)
3.com.app.functionalities (Any functionality like Map,Social media etc)
4.com.app.webservices (Mostly Async task which load data from Server)
5.com.app.jsonparsers (Used in webservices to parse json and save in model)
6.com.app.models (Create your models)
7.com.app.adapters (Because many list so make list here)
8.com.app.main (Here mostly main activities code like dashboard, ListsActivities)
9.com.app.interfaces (Create interfaces which create easiness in working with ListActivities and adapters)

I think now you can handle any project in Android in this manner.

gnat
  • 20,543
  • 29
  • 115
  • 306