I have some queries which may be useful to others too.
In android 4.0 onwards ,
1)how to check whether external sd card support is there or not ?
2)How to run Mediascan forcefully both internal and external memory ?
3)How to Mediascan only sd card or internal memory?
I’d recommend reading storage options on developer.android.com.
To check external memory is available (taken from developer.android.com):
To read internal files use
context.fileList();see more here.Edit
I’m not sure what you want with 2 and 3. You can use mediascan to many things but using it just for using it sounds unproductive. For that I’d recommend @Singularity advice. There is a post here about using mediascan for pdfs.