I am working on a simple app with only two activity.
And what I confuse is the way to get student detail data. I consider in two ways:
Any one tell me what is the best way/UX for that situation, or are there still other solutions. Suggest me, please!
Thanks,
Let's say in your RecyclerView, each item consists of a name, and image. When you navigate over to a detail activity for a specific student, I would pass on (along the id) the name and the image URL to the other activity and implement Activity Transitions. Something along the lines of:
And from then on, I would use the id to retrieve the rest of the information. I would advise against sending large data over intents, as they were not designed for that purpose. Also if you make your Activity to depend on an object instead of an ID to start, you will have a hard time enable direct app linking and allowing users to share pages from your app. Also consider the Activity lifecycle, and what happens on configuration change. See more here, and see the following diagram:
Implement a local database, and ensure your network requests are cached properly. This will enable you more speedier results and an offline-ready application. Between your UI and data sources, implement a Repository pattern, along the lines of: