mardi 17 février 2015

Sqlite Database not inserted Using Script in Proguard Build

I have to display some data from database even after un-install the app. For that I am writing script for that insert operations. And at Re-installation I am executing that script saved on sdcard with db.execSQL(toExec); statement. Using following code snipt



//write code to execute script from file
SQLiteDatabase db = helper.getWritableDatabase();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(Constants.DIR_PATH+"/"+Constants.SCRIPT_FILE_NAME));
String line;
while((line = reader.readLine())!=null)
{
line.trim();
AppLog.d(TAG, "Execute script with line: "+line);
try
{
db.execSQL(line);
}
catch(SQLiteException e)
{
AppLog.d(TAG, "Sqlite Excp with Line: "+line+e);
}
}
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
AppLog.d(TAG, "File Not Found to execute Script"+e1);
}
catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


This works fine in normal build. But insertion is not done in Proguard build.


I can not figure out what is happening.


Please help...


Aucun commentaire:

Enregistrer un commentaire