Reputation: 21
I want to create a database in the external storage of android phone. I've tested databases existing with a method and it returned true.
However, I can't see the SD card contents in file explorer.
public static Context context;
public static SQLiteDatabase database;
public static String SDK = Environment.getExternalStorageDirectory().getAbsolutePath();
public static String DB = SDK + "/database/";
context = getApplicationContext();
File file = new File(DB);
file.mkdirs();
database = SQLiteDatabase.openOrCreateDatabase(DB + "/db.sqlite", null);
in this picture you can see my file explorer window
this is screenshot of ES File Explorer
Upvotes: 1
Views: 740
Reputation: 21
my problem solved . I Found a way to see sdcard files and get a copy of "db.sqlite"
i opened adb shell and used this command to copy my database file:
adb pull /sdcard/database/db.sqlite
and a copy of this file created in C:\Android\sdk\platform-tools
folder
and used this command to see my sdcard directory and files :adb shell ls /sdcard/
Upvotes: 1