How to write a file with directory ?

by sunwrt » Fri, 17 Apr 2009 16:26:35 GMT

Sponsored Links

I  wrote a file to the sdcard, but it failed as follow:

   String sdcardFIle = "/sdcard/xxx.txt"
   FileOutputStream fos = openFileOutput(sdcardFile,

openFileOutput failed, because fIle  "/sdcard/xxx.txt" contains a path

It is so strange. Is there  another way to handle the situation ???

Thanks in advance

Other Threads

1. Service + AudioTrack: is WAKE_LOCK needed?

After speaking with one of the developers, I learned:

- On current platforms, the audio driver acquires its own wake lock,
which explains why my phone was not going to sleep.;a=blob;f=libaudio-qsd8k/AudioHardware.cpp;hb=HEAD

- There's no explicit guarantee that this will always be true for all
platforms, so it's still a good idea to hold a PARTIAL_WAKE_LOCK if
you need to stay awake while using an AudioTrack.


2. API Demo Slow Adapter issue

I built the API demo and in the View List Slow Adapter demo it is
a issue I'd like to understand.  Searches and googling didn't turn up
answer so...

The demo works just fine if you fling, but if you touch scroll and
then lift
your finger off the display when there is zero motion all the
data just stays and is never replaced with real data.

Logging shows that the scroll state never goes to Idle, it just stays

I've tried putting onTouch handlers in the items in the list and they
see the down and moves but never see the up event.

Any ideas?

  mike collins


3. Paging: Droidian KalBar

4. adb install gives Failure [-12] when deploying an application to phone

5. After entry/selection is complete, how do I make the virtual qwerty keyboard go away?

6. "Force clearing orientation change". bug in G2?

7. How to display unicode text received from a web API