• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

help me please !

Anouar47

Lurker
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 ?
 
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:
Root
  |
  ----> Level 1
             |
             ----> Level 2
                        |
                        .
                        |
                        ----> 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 -

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.
 
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:
Root
  |
  ----> Level 1
             |
             ----> Level 2
                        |
                        .
                        |
                        ----> 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 -

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.
 
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 ?
 
Back
Top Bottom