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();
}
}
这是我用来从服务器中提取数据库的代码。如何在之后加载数据库?