Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.media.MediaScannerConnection; import android.net.Uri; import java.io.File; public class Main { public static void writeFiletoAndroidMediaDB(Context context, File file) { MediaScannerConnection.scanFile(context, new String[] { file.toString() }, null, new MediaScannerConnection.OnScanCompletedListener() { public void onScanCompleted(String path, Uri uri) { } }); } }