0
    private void pullDatabase() {
    try {//standard filechannel download
        URL website = new URL(ip + "/questions.db");
        ReadableByteChannel rbc = Channels.newChannel(website.openStream());
        FileOutputStream fos = new FileOutputStream(new File(this.getFilesDir().getAbsolutePath() + "/questions.db"));
        fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
    }catch(Exception e){
        e.printStackTrace();
    }
}

This is the code I use to pull the database from my server. How can I load the database afterwards?

0 Answers0