I am making an android app that involves an internal database. I decided to open the database file rather than produce it within the app.
this is the code:
private static String databasePath = "H:\Workspace\PetrocVLE\assets";
public SQLiteDatabase db = SQLiteDatabase.openDatabase(databasePath, null, 0);
this is the error that is being given:
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ )
I thought this might mean that there are symbols within the databasePath variable which are not allowed within a string variable, however I have seen other String variables that used these within java.
Can anybody tell me what I am doing wrong? thankyou
\is a special character used in JavaStrings, you would need to escape it,However, file paths on Android normally take this format