Search code examples
androidandroid-layoutandroid-studiolistview

Asking for advice of how to appraoch an application


As part of a university project, I have to build an Android app that will contain informations about diseases, the diseases will be listed in a list (alphabetic order), when clicked on a disease you'll be directed to another layout that contains informations about the disease chosen (including text and images).

I don't know how to approach this app..and for the text should i build a database or directly input the text inside the app or something like that. If you know a tutorial or something that would help please share Ps: there is almost 60 Diseases and each disease will have a subitems (causes, treatment, clinical signs .)


Solution

  • UI Design (List)

    there is almost 60 Diseases and each disease will have a subitems

    Therefore I would suggest an ExpandableListView. Check out this code sample: https://www.journaldev.com/9942/android-expandablelistview-example-tutorial

    Afterwards if the user clicks on an item, you open another Activity with details

    Data Storage

    should i build a database or directly input the text inside the app or something like that

    Static approach

    As you can think of, putting data directly into views makes it difficult to maintain, but is faster implemented and less difficult.

    Implemenation: I would suggest putting the data into res/raw as a .json file. In your code, build a JSONObject out of it and pass it to the ListViewAdapter.

    Dynamic approach

    You need Internet permission, a webserver and a remote database from where you can query the data.

    Implementation: If you have a hosted webserver you probably have PHP and MySQL databases. Create a table, fill it with data and build an API in PHP where you provide the data from the database. If you have a VPS or dedicated server you can use MongoDB which works with JSON out of the box.

    My guess

    For an university project, use static. Otherwise dynamic of course.