copy sqlite database from assets folder to android persistentpath in unity3d -
i have squlite database in assets folder name mydatabse.s3db , want copy android application.persistentdatapath. have used following code
string filepath = application.persistentdatapath + "/mydatabase.s3db"; if (!file.exists (filepath)) { www loaddb = new www("jar:file://" + application.datapath + "!/assets/mydatabase.s3db"); debug.log("yield done"); while(!loaddb.isdone) {} file.writeallbytes(filepath, loaddb.bytes); debug.log("copy done"); }
the database created in application.persistentdatapath path empty.
Comments
Post a Comment