1. Are you ready for the Galaxy S20? Here is everything we know so far!

help me please !

Discussion in 'Android Development' started by Anouar47, Aug 21, 2017.

  1. Anouar47

    Anouar47 Lurker
    Thread Starter

    Hello community I'm a new developer and I'm working on an app that presents some documents to the user then the user can open them and modify their content if they wish to do so, the issue that I'm facing is these documents are numerous and they are organized in folders, what is the best way for me to proceed with the app and present these documents the same way they are organized in their folders ?

    1. Download the Forums for Android™ app!


  2. Deleted User

    Deleted User Guest

    Hi and welcome to Android Forums.
    There are a number of approaches here. My first thought was to present a Treeview - this is an expandable list which can accommodate an arbitrary level of list expansion

    Code (Text):
    2. Root
    3.   |
    4.   ----> Level 1
    5.              |
    6.              ----> Level 2
    7.                         |
    8.                         .
    9.                         |
    10.                         ----> Level N
    But amazingly, and I'm astonished by this, there is no Treeview component provided in the Android UI library. The best you can do is to use ExpandableListView, which only accommodates two levels of list expansion.

    But the Internet has yet again provided, and it seems like other people have implemented such a component. See here for a starting point -


    If you don't want to do it this way, then you could go for the classic file explorer type of approach - this is where you display icons representing the folders, and when tapped, they drill down into the folder contents, just like the Windows explorer application does. You will probably have to use something like a GridLayout for this, but it should be fairly straightforward.
    Anouar47 likes this.
  3. Anouar47

    Anouar47 Lurker
    Thread Starter

  4. Anouar47

    Anouar47 Lurker
    Thread Starter

    Thank you for your help cheers
  5. Anouar47

    Anouar47 Lurker
    Thread Starter

    Hello Sir for the second suggestion you gave me is there a way to browse these files I mean like a browser kind of thing because there are a lot of folders and sub-folders it is a heavy process if I want to assign each one to an icon ?
  6. Anouar47

    Anouar47 Lurker
    Thread Starter

    Thank you so much
  7. Anouar47

    Anouar47 Lurker
    Thread Starter


Share This Page