1

I'm a Java webapp developer who is new to Android development. In general, my web apps have a DB layer, a POJO layer, a UI layer, and a BusinessProcess layer. In my research of Android applications, I have not come across the BusinessProcess layer. I have implemented my app with one, but I find it clunky, having to pass in either the DB object or the ApplicationContext in order to access the DB but there are times when I find that I have redundant code. I'd rather have an extra layer handle the logic than copy-and-paste it three times in an Activity. In general, what do other people do? What do you recommend?

1 Answer 1

1

A service http://developer.android.com/guide/components/services.html such as IntentService http://developer.android.com/reference/android/app/IntentService.html would act as your business process layer, yet most mobile applications are not generally thick clients but thin clients than user a remote web server as the content and business process authority, at which point the service (or sometimes ContentProvider http://developer.android.com/guide/topics/providers/content-providers.html) would interact with the remote server and cache results in a database.

See http://mobile.tutsplus.com/tutorials/android/android-fundamentals-intentservice-basics/

Edit: A bound service would suit your purposes well, depending if you need the work done synchronously instead of asynchronously.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.