Bom dia!
Pessoal eu estou com um .sqlite e preciso realizar consultas nele mas o caminho o qual estou colocando pra abrir o mesmo não esta sendo encontrado.
Erro : android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
private SQLiteDatabase conexao;
private BancoOpenHelper getDadosopenhelper;
private static String DBPATH = "/data/data/medphone-cid10.sqlite/databases/";
private static String DBNAME = "medphone-cid10.sqlite";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cid10);
// ConsultarSql("SELECT id, code, description, range FROM chapters ORDER by id");
CriarConexao();
}
public void CriarConexao() {
try {
SQLiteDatabase db = null;
String path = DBPATH + DBNAME;
db = SQLiteDatabase.openDatabase(path, null, SQLiteDatabase.OPEN_READONLY);
} catch (SQLException ex) {
Context context = getApplicationContext();
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, "Erro na canexao!: " + ex, duration);
toast.show();
}
}