get Database Path - Android Database

Android examples for Database:Database File

Description

get Database Path

Demo Code


import android.os.Environment;

public class Main{
    public static final String DB_NAME = "/foto.db";
    public static String getDatabasePath() {
        return Environment.getExternalStorageDirectory() + "/"
                + DatabaseUtil.class.getPackage().getName() + "/"
                + DatabaseUtil.DB_NAME;// w w  w . j a v a  2s  .  c o  m
    }
}

Related Tutorials