tags:

views:

62

answers:

1

Hi,

This is for the first time i am using external storage in android. I need some help how can i perform different operations such as how to check whether External Storage is available or not?, How to write files or pictures into storage ..

Thanks.

A: 

how to check whether External Storage is available or not?

Use Environment.getExternalStorageState().

How to write files or pictures into storage

Use standard Java I/O, working off a directory built using Environment.getExternalStorageDirectory().

CommonsWare
If you write files, dont forget to set the permission in the Manifest. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
ccheneson
thanks a lot..I have used this already but i want to able to add files to media storage and then retrieve it back.. So any hints?U can even send some reference..Thanks
Rakesh Gondaliya
@rakesh-gondaliya: You ask a question, then say you "used this already". Why did you ask the question in the first place?
CommonsWare
sorry for that.Can u give me some hints to create app which will allow me to write files into External storage and then i will be able to read that.thanks
Rakesh Gondaliya
@rakesh-gondaliya: Use standard Java I/O, working off a directory built using `Environment.getExternalStorageDirectory()`. If you are unfamiliar with Java I/O, I suggest that you spend a month or two outside of Android learning Java.
CommonsWare
thanks for guideline.
Rakesh Gondaliya