Copy Table from Database from Dropbox to App -


i had written following code copy database file dropbox account app database.but want copy specific table dropbox app database table.is possible.

 protected boolean doinbackground(void... params) {         final file tempdir = context.getcachedir();         file tempfile;         filewriter fr;         try {             file data = environment.getdatadirectory();              string currentdbpath = "//data//"+ "loginscreen.example.com.girviapp" +"//databases//"+database_name;             file currentdb = new file(data, currentdbpath);             fileinputstream fileinputstream = new fileinputstream(currentdb);              entry existingentry= dropbox.metadata( path ,1000,null,true,null);               if (existingentry.contents.size() != 0)             {                 (entry ent :existingentry.contents)                 {                     string name = ent.filename();                     if(name.equals(database_name))                     {    fileoutputstream outputstream = new fileoutputstream(currentdb);                         dropboxfileinfo info = dropbox.getfile(path + database_name, null, outputstream, null);                          return true;                     }                  }             }          } catch (ioexception e) {             e.printstacktrace();         } catch (dropboxexception e) {             e.printstacktrace();         }         return false;     } 

the answer here depends on you're looking do.

if want able download specific table database file stored on dropbox, in order save bandwidth not downloading of data, no, isn't possible. unit of storage in dropbox api you're using file, , dropbox doesn't know individual tables in database file are, doesn't have way specify particular table.

on other hand, if don't mind downloading entire file dropbox, yes, possible. download file you're doing, , load database locally. query out data want, is, desired table, , need it.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -