java - Android SQLITE database no internet -
i new android programming , looking best way of working sqlite database. need able load database app , enter data export. need able without internet connection. been looking @ examples , how to's , reading can.
i seeing lot on loading database , having app copy system database leaving 2 database.
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
however think looking way work directly database possibly attached sd card. once data entered user connect via usb , copy , email database. *remember there no internet connection. on other hand database copied onto sd card , app able read , write it. maybe not best way? or have use 2 databases?
i not looking step step me better yet guide me in correct direction. maybe links tuts or articles helpful. everyone!!
when create database, need specify path, rather allowing app create database reside.
modify db helper class reflect these changes:
private final static db_path = environment.getexternalstoragedirectory(); private final static db_name = "my_database"; public dbhelper(context ctx) { database = sqlitedatabase.opendatabase(db_path + "/" + db_name, null, sqlitedatabase.open_readwrite); } now have database on sd card , nothing in traditional location. might wish consider keeping working database in traditional location sake of redundancy, if it's not large. sd cards fail, devices fail, etc., copying database sd card give level of insurance.
Comments
Post a Comment