I am trying to push the screen on may main UiApplication (MyApp) based on the either database is created or not and if its created than is it emapty or is it having some data.. but when i run this code my balckberry application jsts hangs ..
any help is appreciated :)
i have checked that the virtual SDCard is there in simulator and i have even code to check at runtime whether SDCard is avialable or not.
JDE Version 6.0 with Eclipse Helios
plug in BlackBerry Simulator : 9800
Os : windows 7 32 bit ultimate edition
below is my code that i am using in my app
public MyApp()
{
try {
MyAppURI = URI.create("file:///SDCard/BlackBerry/Database/"
+ "MyApp.db");
this.setMyURI(MyAppURI);
boolean flag = false;
flag = DatabaseFactory.exists(getMyURI());
if ( flag == false){
db = DatabaseFactory.create(getMyURI());
db.close();
new DatabaseSchema(); // this will simpaly create setting table in databse MyApp.db i am closing the database there
pushScreen(new Settings());
}else{
db = DatabaseFactory.open(getMyURI());
Statement st = db.createStatement("select count(*) from Setting");
Cursor cursor = st.getCursor();
if (cursor.isEmpty() == true){
pushScreen(new Settings());
}else{
pushScreen(new Reports());
}
}
} catch (Exception e) {
e.printStackTrace();
}
}