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. how to avoid texture wrapping in glDrawTexiOES ?

Hi, I'm basically trying to resize 512x512 texture into 200x200 at
(0,100).

So, I use this function.
((GL11Ext) gl).glDrawTexiOES(0, 100, 0, 200, 200);

It shows what I want but it also displays the mirror portion of upper
image on top screen (0,0) size = 200x100.

any idea how to remove this?
--~--~---------~--~----~------------~-------~--~----~

2. how can i use my kml file in a html file

Hello,

i have found a nice javascript (google-api), where i can make an
overlay on a map:
...
function initialize() {
  if (GBrowserIsCompatible()) {
    geoXml = new GGeoXml("http://mapgadgets.googlepages.com/cta.kml");

    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(41.875696,-87.624207), 11);
    map.addControl(new GLargeMapControl());
    map.addOverlay(geoXml);
 ...

My question is, how can i use my kml file (on a sd card) istead of the
link in the GGeoXML object

geoXml = new GGeoXml("http://mapgadgets.googlepages.com/cta.kml");


My idea is to use:
....
HttpGet get = new HttpGet("A_HTML_FILE_WITH_HTMLGOOGLEAPI.html");
....client.execute(get);

In this html file i load the javascript. Must i append "?
param=THE_KML_FILE_IN_A_BUFFERED_READER_OBJECT_OR_SOMETHING_LIKE_THAT"
to get the data available?

Thanks,
Stefan

PS: I don't find a GGeoXml function in the "google api for android".
So i decide to use the "html google api". And i can search for a
direction between two point in the "html google-api"
--~--~---------~--~----~------------~-------~--~----~

3. My app is getting killed while I launch an external intent

4. Active and deactivate the Wifi Radio

5. Bad Frames dropping in thread

6. Question about API Demo Remote Service example

7. Android Toast Duration