Where is the SQLITE database I created in the android studio IDE? I searched and did not locate, and I did not even find it on the phone itself.
Where is the SQLITE database I created in the android studio IDE? I searched and did not locate, and I did not even find it on the phone itself.
For this I did:
File f=new File("/data/data/seu.app.package/databases/seu_db.db3");
FileInputStream fis=null;
FileOutputStream fos=null;
try
{
fis=new FileInputStream(f);
fos=new FileOutputStream("/mnt/sdcard/db_dump.db");
while(true)
{
int i=fis.read();
if(i!=-1)
{fos.write(i);}
else
{break;}
}
fos.flush();
Toast.makeText(this, "DB OK", Toast.LENGTH_LONG).show();
}
catch(Exception e)
{
e.printStackTrace();
Toast.makeText(this, "DB ERRO", Toast.LENGTH_LONG).show();
}
finally
{
try
{
fos.close();
fis.close();
}
catch(IOException ioe)
{}
}
Give the permission
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
It's not brilliant, but it works