1. Download our Official Android App: Forums for Android!

help me please !

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

  1. Anouar47

    Anouar47 Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 21, 2017

    Aug 21, 2017
    6
    0
    15
    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 ?
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,440
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,440
    10,724
    1,988
    Male
    Software developer
    South West of England
    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):
    1.  
    2. Root
    3.   |
    4.   ----> Level 1
    5.              |
    6.              ----> Level 2
    7.                         |
    8.                         .
    9.                         |
    10.                         ----> Level N
    11.  
    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 -

    https://stackoverflow.com/questions/3159758/suggestions-for-building-a-treeview-control-in-android

    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
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 21, 2017

    Aug 21, 2017
    6
    0
    15
     
  4. Anouar47

    Anouar47 Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 21, 2017

    Aug 21, 2017
    6
    0
    15
    Thank you for your help cheers
     
  5. Anouar47

    Anouar47 Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 21, 2017

    Aug 21, 2017
    6
    0
    15
    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. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,440
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,440
    10,724
    1,988
    Male
    Software developer
    South West of England
  7. Anouar47

    Anouar47 Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 21, 2017

    Aug 21, 2017
    6
    0
    15
    Thank you so much
     
  8. Anouar47

    Anouar47 Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    6
    Joined:
    Aug 21, 2017

    Aug 21, 2017
    6
    0
    15

Share This Page

Loading...