Building an Android FileBrowser (list-based) !

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Postby zumpar » Tue Oct 13, 2009 10:36 am

Hi,

thanks for the great tutorial.. but say I wanted to place a button at the bottom of the list. What would I have to change? Would i have to create a layout with a Linear Layout, in it a ListView and a Button on the bottom, and then scrap the row.xml layout and put the list in the listview? (I tried these things and they didnt seem to work)

Any help is appreciated,
Thank you
zumpar
Freshman
Freshman
 
Posts: 7
Joined: Thu Oct 08, 2009 2:07 pm

Top

With this listFiles can you use a url directory

Postby rayg » Sat Mar 06, 2010 8:17 pm

Hi,
Thanks for your samples, they are very helpful. Is there a way to use listFiles to return files in a uri directory? Say there are .jpg files at http://ficticious.myweb.gov/images I don't know what the files are called but I want a list of their names so I can nab them if I want.
rayg
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Mar 06, 2010 1:48 am

Re: Building an Android FileBrowser (list-based) !

Postby letroll » Wed Oct 20, 2010 7:53 pm

for this :

int selectionRowID = (int) this.getSelectedItemId();

change in this:

int selectionRowID = position;
letroll
Freshman
Freshman
 
Posts: 4
Joined: Tue Mar 16, 2010 4:59 pm

Re: Building an Android FileBrowser (list-based) !

Postby christiantang » Thu Nov 04, 2010 12:20 am

First of all: Great tutorial!

But I do have a problem. When I try to access the following folders in the root, the program crashes:
/config
/cache
/data
(and some other)

I have a feeling that it has something to do with permissions, but I can't figure out if this is the problem.

I have tried accessing the folders using OI File Manager, with no problems.

The program crashes on the emulator, and on my HTC Hero
christiantang
Freshman
Freshman
 
Posts: 3
Joined: Sun Apr 25, 2010 4:09 pm

Re: Building an Android FileBrowser (list-based) !

Postby danielle101 » Thu Nov 04, 2010 1:10 am

Could somebody help me figure out how to write code for a file browser for that would search through a specific folder (eg. the pictures folder)???? I am new to Android and any help would be much appreciated :D !!!!

Thanks in advance.
danielle101
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 02, 2010 4:12 am

Re: Building an Android FileBrowser (list-based) !

Postby sourv » Fri Apr 22, 2011 8:22 am

Thanks for the tutorial. I am a newbie. Can you please post the updated AndroidFileBrowser.java for Android 2.3.3.
sourv
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Apr 22, 2011 8:13 am

Top

Re: Building an Android FileBrowser (list-based) !

Postby drawg99 » Fri Apr 29, 2011 12:02 am

Instead of using ListActivity.getSelectionRowId() which was removed from API by Android development team or ListActivity.getSelectedItemPosition() or getSelectedItemID() which have other problems returning 0 and -1 at times, I was able to use getItemAtPosition(position) following this example -> http://www.bestwebdesignseo.com/code-samples/solution-to-getselectionrowid-android-method-error/

It requires re-writing of the onListItemClick which may have other potential consequences for other developers to mitigate.
drawg99
Once Poster
Once Poster
 
Posts: 1
Joined: Thu Apr 28, 2011 11:56 pm

Re: Building an Android FileBrowser (list-based) !

Postby leethaoqn » Wed Nov 23, 2011 3:57 pm

This is great tutorial . I have a question : What's different in ABSOLUTE, RELATIVE in your tutorial ?
leethaoqn
Freshman
Freshman
 
Posts: 7
Joined: Wed Sep 21, 2011 3:34 pm

Re: Building an Android FileBrowser (list-based) !

Postby hgft » Wed Feb 29, 2012 9:50 am

Coach Outlet Online Sale is with imperfections which consist of cuts, scars, and scratches will exist, the grain in its organically grown problem has between one of the most considerable dietary fibers strength, and getting a last end result between one of the most considerable durability. The grain also has organically grown breathability, resulting in increased comfort using the path from the wearer.

Louis Vuitton Outlet could possibly be one of the most well-known is not necessarily one of the most ideal for you! possibly the most current quarter round shoulder bag with fluorescent color provides you a shine in the moment, desire to possess the urge to it immediately; But possibly your pores and skin color could possibly be the earth beside the handbag could possibly be one of the most make you fondle admiringly joker choice.

Louis Vuitton Outlet supply reduce, the weakening from the role, tiny haystack in slender whole body once more and again. the right way to purchase Louis Vuitton bags That's between the powerful cohesion when Cunningham lancelet find yourself isolated point, allow wind and bad weather insulation, yr pursuing year, pile of grass system earlier short increased grass blanketed with it or bi erosion.

Jennifer Garner and Ben Affleck are the proud parents of a newborn son! The 39-year-old actress gave birth to the couple's third child in Santa Monica, Calif., a source tells Us Weekly. The family's newest addition joins older sisters Violet, 6, and Seraphina, 3. “I would have thought [Ben] wanted a boy]. At first … I really thought so,” Jen, who kept the baby's gender under wraps, told Jay Leno last month.
hgft
Experienced Developer
Experienced Developer
 
Posts: 66
Joined: Tue Feb 28, 2012 9:11 am

Re: Building an Android FileBrowser (list-based) !

Postby AndroidRookie » Fri May 25, 2012 1:59 pm

Hi All,

Everything works fine with me regarding file browser if i am allowed to browse file with keyboard . As i load this app in my mobile i can't select a file or browse the folders.
I tried to replace the onClickListener with onTouchListener but still it didn't work.
Does anyone have the idea why it happens ?
File browsing works with external keyboard attached but not with touch screen

Thank you in advance!!
AndroidRookie
Freshman
Freshman
 
Posts: 2
Joined: Fri May 25, 2012 1:52 pm

Re: Building an Android FileBrowser (list-based) !

Postby AndroidRookie » Tue May 29, 2012 10:46 am

AndroidRookie wrote:Hi All,

Everything works fine with me regarding file browser if i am allowed to browse file with keyboard . As i load this app in my mobile i can't select a file or browse the folders.
I tried to replace the onClickListener with onTouchListener but still it didn't work.
Does anyone have the idea why it happens ?
File browsing works with external keyboard attached but not with touch screen

Thank you in advance!!


I finally fixed the problem.
Inside onListItemClick, int selectionRowID = (int) this.getSelectedItemId();
which result everytime zero as a result of a click in touchscreen.
As i replaced that with int selectionRowID = position;
it works fine for me and results exact RowID.
AndroidRookie
Freshman
Freshman
 
Posts: 2
Joined: Fri May 25, 2012 1:52 pm

Top
Previous

Return to Novice Tutorials

Who is online

Users browsing this forum: Google [Bot] and 5 guests