Export the database in the android program to the SD card
Private void copyDBToSDcrad () {String DATABASE_NAME = "database file name"; String oldPath = "data/com. packagename/databases/"+ DATABASE_NAME; String newPath = Environment. getExternalStorageDirectory () + File. separator + DATABASE_NAME; copyFile (oldPath, newPath );} /*** copy a single file ** @ param oldPath * String original file path * @ param newPath * String copied path * @ return boolean */public static void copyFile (String oldPath, str Ing newPath) {try {int bytesum = 0; int byteread = 0; File oldfile = new File (oldPath); File newfile = new File (newPath); if (! Newfile. exists () {newfile. createNewFile ();} if (oldfile. exists () {// when the file exists, InputStream inStream = new FileInputStream (oldPath); // read the original file FileOutputStream fs = new FileOutputStream (newPath ); byte [] buffer = new byte [1444]; while (byteread = inStream. read (buffer ))! =-1) {bytesum + = byteread; // number of bytes file size fs. write (buffer, 0, byteread);} inStream. close () ;}} catch (Exception e) {System. out. println ("An error occurred while copying a single file"); e. printStackTrace ();}}