dimanche 3 avril 2016

store database from URL to a SQLlite database

I am downloading a database using URL:

        URL url=new URL("url");
        URLConnection ucon = url.openConnection();
        ucon.setDoInput(true);
        InputStream is = ucon.getInputStream();
        BufferedInputStream bis = new BufferedInputStream(is);
        ByteArrayBuffer baf = new ByteArrayBuffer(1024);
        int current = 0;
        while ((current = bis.read()) != -1) {
            baf.append((byte) current);
        }

In "baf" I have the information of my database, Do you know how I can store this database in the app?. If I write this database in a folder of the mobile, the information could be exposed and I want to avoid it storing it in the folder of the app.

Thank you very much

Aucun commentaire:

Enregistrer un commentaire