There are two types of users (service and customers). When entering a login, the application must determine to which type the user belongs and open the corresponding interface. Customers should display the menu, and the service list of orders. Help with the solution of this problem. How can it be implemented?

  • Make an activation of the entrance, which will determine who entered and by the result run one of the two activations - the service or the customer? - pavlofff

1 answer 1

  1. Three Activities must be created: LoginActivity, UserActivity, BossActivity.
  2. When the application starts, LoginActivity should start.
  3. In it, when you click the "Login" button, the user is authorized depending on which category he belongs to.
  4. Depending on the result of the LoginActivity, the Intent is sent either to the UserActivity or to the BossActivity.

In fact, the question is quite general, a brief answer to it is impossible to give, so I would advise, in principle, to study at least some of the basics of the android itself. To begin with, these materials will be suitable (it is written on eclipse, but it is perfectly possible to understand everything from them in the android studio).

  1. Here the minimum about the mechanism of Intent is described: http://startandroid.ru/ru/uroki/vse-uroki-spiskom/59-urok-22-intent-intent-filter-context-teorija.html
  2. Here is an example of using Intent in practice: http://startandroid.ru/ru/uroki/vse-uroki-spiskom/64-urok-26-intent-filter-praktika.html
  3. To authorize a user, you may most likely need a database, you can view lessons 34-39: http://startandroid.ru/ru/uroki/vse-uroki-spiskom.html

Most of the lessons are written clearly and relevantly even now, therefore, in principle, you can read other materials from this site. If you need to "get into the details" or refer to sources, the best option would be to refer to the lessons from Google, this is probably the best that can be found on the network: https://developer.android.com/training/index.html

  • I would recommend reading not articles on the Internet, but books. This is a qualitatively different level. One book B. Hardy will answer all the questions of a novice developer in a single, holistic presentation. A similar amount of knowledge and, most importantly, skills in organizing the overall structure of the application for separate lessons on the Internet cannot be obtained at all, even if they are gathered in one group, like on startandroid or from Klimov. In the classroom, you can quickly recall the basic design and TP. - pavlofff