1

I will be working on Android application to be used inside an organization.
Four different types of users categories will use the application and upon login, each user will see and interact with interfaces depending on his role.

I'm familiar with -well- regular Android applications but not with applications that have different UIs and logic depending on the user's role.

How to implement this kind of applications? The specification document says it has to be one single application (not four).

Chiron
  • 20,081
  • 17
  • 81
  • 133

4 Answers4

2

You may have a single Login Activity and dispatch to four diferent User Activities after succesfull login.

PeterMmm
  • 24,152
  • 13
  • 73
  • 111
0

Yea, you only need one login activity, and your login method in server should return the role of the user to know which activity lunch after login.

IgniteCoders
  • 4,834
  • 3
  • 44
  • 62
0

Make care that your code is well separated to modules which you can reuse in different applications. Important thing is to separate your GUI from you logic classes - reusable modules. Use interfaces in order to achieve that.

AlexTheo
  • 4,004
  • 1
  • 21
  • 35
0

Use different styles/themes for different roles, here's how you can set style/themes for activities at runtime.

Android:How to programmatically set an Activity's theme to Theme.Dialog

As a sidenote, to make the design clean, implement an abstract BaseActivity which handles this. Let all your activities extend the BaseActivity.

Community
  • 1
  • 1
Vikram Bodicherla
  • 7,133
  • 4
  • 28
  • 34