On Thu, Jul 29, 2010 at 6:22 PM, Johnny <jianing...@gmail.com> wrote:
> What I can not figure out is how to create a file with the 'Context'
> variable passed in from the 'onReceive'. I know I can create a private
> file with this 'Context' variable but I just don't know how to use
> this 'Context' to create an external file.

You don't. Use Environment.getExternalStorageDirectory() to get a File
object at the root of the external storage (e.g., SD card). Then use
standard Java file I/O to work with the contents of the external
storage.

> I have added the permission for my service in the manifest file
> already, that is the reason why I have to use my service's Context to
> create the file.

That is incorrect.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to