can't read mp3 file from sdcard

by zeeshan » Thu, 05 Mar 2009 17:53:23 GMT


Sponsored Links
 Hi Mates,

i am trying to write mp3 file in OutputStreamWriter.

here is the code:

String fileName="/sdcard/test_cbr.mp3";

byte [] buffer = new byte[1024*4];
int bytesRead = 0;

FileInputStream is = new FileInputStream(fileName);

// everything fine untill here

while( (bytesRead = is.read(buffer)) > 0) { // while condition is
false
                    wr.write(buffer,0,bytesRead);
                    wr.flush();
                }


it can access the file and makes the FileInputStream object but cann't
read. it doesn't go in While loop

any solution?

Thanks

--~--~---------~--~----~------------~-------~--~----~



can't read mp3 file from sdcard

by zeeshan » Thu, 05 Mar 2009 19:52:59 GMT


 its working now!
actually it was read permission problem.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. pthread_join does not work on android

Hi,
I've noticed that on android, the call to pthread_join does not
suspend the calling thread.
I've a number (6) of new thread created using pthread_create and
pthread_join is called on each thread. But It does not suspend the
main (calling) thread.

I believe this relates to the port of pthread lib to android.

Has anyone similar experience?
PS: Excuse me  if this is already reported.

-- 

2. Focus Hover On App Icon?

Oh Holy Experts:

I'm wondering if there's any way to switch out the application icon the main
category, when the focus scrolls over it.  I'm not sure if I could send a
screenshot through this user group; if I could, you would see that our
design guys in their infinite wisdom chose Droid Hover orange as the logo
color.  When not hovered on, it looks like a series of orange swoops.  But
when hovered, it looks exactly like an orange square!  Crap, crappity crap
crap, help me please!

Thanks,
Nick Owens
VP, ThreeClix
Office: (904) 429-7039
Mobile: (847) 565-9392
After Hours: (904) 540-5830



-- 

3. Media Scanner vs Download Manager

4. Dont understand contexts.

5. how to set Wifi settings in Android simulator??

6. Custom listview

7. Intent action for network events in android sdk