Android FileBrowser v.2.0

Tutorials with advanced 'difficulty' and more Lines of Code.

Postby jhoffman » Tue Jun 23, 2009 11:52 pm

I'm getting errors with this code as well :(
I downloaded the zipped version of the source, but I have the following issues (with Manifest.xml)
Line 5: Tag <activity> missing required attribute name.
Line 5: Class org.anddev.android.filebrowser.Filebrowser does not exist (if I add an arbitrary android:name field, I get this instead)
<activity android:name="Filebrowser" class=".AndroidFileBrowser" android:label="@string/app_name">
(this line is SOLVED: solution is below)

Line 11: Class org.anddev.android.filebrowser.Filebrowser does not exist
<activity android:name="Filebrowser" class=".DirNameInputActivity" android:label="@string/dirname_app_name">
(this line is SOLVED: solution is below)

I had to add the android:name field to about 4-5 other lines as well, which seems weird... am I missing something?

I also have issues with AndroidFileBrowser.java, I narrowed down all but two of them:
this line: Intent myIntent = new Intent(android.content.Intent.VIEW_ACTION, Uri.parse("file://" + aFile.getAbsolutePath()));
gives me this error: android.content.Intent.VIEW_ACTION cannot be resolved
(this line is SOLVED: solution is below)

this line: int selectionRowID = (int) this.getSelectionRowID();
gives me this error: The method getSelectionRowID() is undefined for the type AndroidFileBrowser
(this line is NOT SOLVED: please help!)


edit: solution to VIEW_ACTION appears to be to use ACTION_VIEW instead! This gives an error in the catch block, with the exception being different. I changed it to a generic exception until I can figure out exactly what it is throwing.

edit #2: solution to Line 5 of the xml was:
<activity android:name="AndroidFileBrowser" class=".Android_File_Browser" android:label="@string/app_name">

edit #3: solution to Line 11 of the xml:
<activity android:name="DirNameInputActivity" class=".DirNameInputActivity" android:label="@string/dirname_app_name">
jhoffman
Freshman
Freshman
 
Posts: 9
Joined: Wed Jun 17, 2009 1:58 am

Top

Postby fawx » Thu Oct 22, 2009 3:21 am

songotho wrote:Hi,

Great tutorial, so I can't run the app, Android have errors:
1. in AndroidFileBrowser.java
Code: Select all
import android.net.ContentURI;

2. in DirNameInputActivity.java
Code: Select all
DirNameInputActivity.this.setResult(SUCCESS_RETURN_CODE, edit_returvalue.getText().toString());


Please tell me this error!

Thanks,


--Alex


For the first, just remove the import. I have problem with the second as well. Help. the SetResult( int, String) is not acceptable here
fawx
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 18, 2009 4:34 am

Postby fawx » Fri Oct 23, 2009 2:51 am

Peli wrote:Hi PlusMinus,

I wanted to let you know that we built the OI File Manager:
http://www.openintents.org/en/node/159

It is loosely based on your :arrow: AndDev File Browser :P , but we modified navigation through buttons at the top of the screen, and the "back" key that works whenever a folder had been selected from the list.

Also, we do not hard-code the images, but take those from the applications that can handle the corresponding MIME types. What we need is a mapping between extensions (.mp3) to MIME types (audio/mp3), which we have defined in an xml file.

But the best part is that we included new intents :D : You can use simple intents in your application to call it for "Open" :) ,
"Save" :shock: , and "Select folder" :lol: . Through intent extras, the new activity title and button text can actually be set to anything the calling application likes.

In the simplest version, just use:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Intent intent = new Intent("org.openintents.action.PICK_FILE");
  2. startActivityForResult(intent, 1);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


and retrieve the result from getData() in onActivityResult().

A sample application that showcases this in a clean way can be found in the Open Intents repository 8) :
http://code.google.com/p/openintents/so ... ileManager

Here is the main java file:
http://code.google.com/p/openintents/so ... nager.java

You can download OI File Manager here:
http://www.openintents.org/en/download

and if you are interested in how we did it, the source code is available here:
http://code.google.com/p/openintents/downloads/list

Peli


Hi Peli
I would like to build further on the OI File Browser. Can I ?
Thanks
fawx
Junior Developer
Junior Developer
 
Posts: 11
Joined: Tue Aug 18, 2009 4:34 am

Postby naresh_t » Wed Dec 16, 2009 10:52 am

Hi plusminus,

Thanks for your post& clear explanation. :o
Have a nice day ;)
-Naresh
naresh_t
Freshman
Freshman
 
Posts: 6
Joined: Wed Dec 16, 2009 10:47 am

browser ftp server

Postby midoub » Wed Dec 23, 2009 11:00 am

Hi,
I would like use your browser function to browse my ftp server.
do you have idea, when I connect to ftp server, how I can list current direcotrie(ftp directories) instead local directories??
thks for your help.
midoub
Freshman
Freshman
 
Posts: 3
Joined: Tue Dec 22, 2009 2:23 pm

Postby Quipeace » Tue Apr 27, 2010 5:28 pm

First of all, thanks for the great tutorial, and sorry for bringing up this somewhat old post, but I thought it would be helpful to others as well.

I'm trying to modify it for my project, what I'm trying to do is preventing people from going down further than /sdcard. I removed the ".." line and instead used the onBackPressed callback, the rest is pretty much the same though.

What i've tried so far was checking if the current path (this.currentDirectory.getAbsolutePath()) was equal to "/sdcard", but that doesn't seem to work at all, even though the output of this.currentDirectory.getAbsolutePath() was infact "/sdcard" (I added the current path to the listview).

Anyway, how could I achieve this?
Quipeace
Developer
Developer
 
Posts: 27
Joined: Tue Feb 23, 2010 4:00 pm

Top

I have a problem

Postby MIT_Enki » Wed May 05, 2010 2:22 am

Hello, Thanks for your Tutorials.
but when I copy your code in Android 2.0 .
there is some wrong about it .

First : there is wrong about " import android.net.ContentURI"
Second: there is wrong about "AlertDialog.show"
may be it replaced in 2.0?
but i can't find it . would you help me ?
MIT_Enki
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Apr 30, 2010 4:17 am

Re: Android FileBrowser v.2.0

Postby griffinshi » Tue Jun 15, 2010 2:57 am

hi.

one question: how to display subdirectory of some directory?

and i have finished this function and i use BaseAdapter to display all file and directory, and it will goto its subdirectory while to click the directory
new to anddev:)
griffinshi
Experienced Developer
Experienced Developer
 
Posts: 71
Joined: Fri Feb 26, 2010 8:53 am
Location: cn

Re: Android FileBrowser v.2.0

Postby WynixToo » Tue Jul 27, 2010 5:23 am

Hi plusminus,

i have try ur code and it run smoothy, but the problem i face is when i click the item it has error to force the application close.

may i know what's the problem??

thanks you.

P/S: im sorry about my bad english. hope u guy understand what im talking about.
Thanks again~~

regard
Wynix
WynixToo
Junior Developer
Junior Developer
 
Posts: 16
Joined: Fri Jul 02, 2010 10:36 am
Location: Malaysia

Re: Android FileBrowser v.2.0

Postby vani.v » Wed Oct 27, 2010 3:23 pm

Hi,
How to create a circle with a set of widgets around it ,which are clickable ans can have a swipe effect.Please reply.
Thanks in advance:-)

Regards
VANI
vani.v
Freshman
Freshman
 
Posts: 7
Joined: Fri Jul 30, 2010 11:59 am

Re: Android FileBrowser v.2.0

Postby Jenny.ross » Fri Oct 29, 2010 11:31 pm

hi all ,
Iam still dont understand how to know the space of my SD card and how to know if I have SD or not.and the space of internal storage also .please how can I write that by code .
greetings,
jenny
Jenny.ross
Freshman
Freshman
 
Posts: 8
Joined: Fri Oct 29, 2010 10:07 pm

Re: Android FileBrowser v.2.0

Postby Jenny.ross » Fri Oct 29, 2010 11:35 pm

hi all ,
Iam still dont understand how to know the space of my SD card and how to know if I have SD or not.and the space of internal storage also .please how can I write that by code .
greetings,
jenny
Jenny.ross
Freshman
Freshman
 
Posts: 8
Joined: Fri Oct 29, 2010 10:07 pm

Re: Android FileBrowser v.2.0

Postby SolvoTerra » Tue Nov 16, 2010 12:23 pm

New to the Java\Android game. Your tutorials are fantastic, so insightful and clear to read.

Thank You.
SolvoTerra
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Nov 16, 2010 12:17 pm

Re: Android FileBrowser v.2.0

Postby vinays » Wed Mar 16, 2011 10:42 am

HI,

Can any one help in changing the background color and text color of the items displayed.?

I tried adding the following lines in IconifiedTextView.java
Code: Select all
mIcon.setBackground(R.color.White);
mText.setBackground(R.color.White);
mText.setTextColor(R.color.Black);


Am I missing something?

Thanks and Regards,
Vinay
vinays
Freshman
Freshman
 
Posts: 3
Joined: Tue Feb 23, 2010 8:09 am
Location: Bengaluru

Re: Android FileBrowser v.2.0

Postby eagles78 » Sat Apr 09, 2011 1:14 pm

hi,
ı can not still access the data folder and when ı clicked on it, an error occured. :( What can I do for it?

Thanks...
eagles78
Freshman
Freshman
 
Posts: 5
Joined: Thu Apr 07, 2011 12:18 am

Top
PreviousNext

Return to Advanced Tutorials

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest