I'm fighting with dropbox sync SDK (Android) to upload some images to my dropbox private Aplication folder, the problem is when I have a FileInputStream dont know what method need to use for upload
this is a portion of the code:
uploadImg=(ImageView) mView.findViewById(R.id.uploadi);
uploadImg.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mDbxAcctMgr.hasLinkedAccount()) {
try {
DbxFileSystem dbxFs = DbxFileSystem.forAccount(mDbxAcctMgr.getLinkedAccount());
DbxPath testPath = new DbxPath(DbxPath.ROOT, items.get(position));
if (!dbxFs.exists(testPath)) {
dbxFs.createFolder(testPath);
getData(ids.get(position));
int cont = 0;
for(int i=0; i<f.size(); i++){
File tmpFile;
FileInputStream fis;
tmpFile = new File(f.get(i), cont+".jpg");
cont++;
fis = new FileInputStream(tmpFile);
DbxPath filePath = new DbxPath(testPath, items.get(position));
//CODE TO UPLOAD FILE
}
}
} catch (Unauthorized e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (DbxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else { } //!haslinked
}
});
I've searched in
and here
but the info not be intuitive for upload files from existing file.
Also I've founded this and this but needs to create a private DropboxAPI<AndroidAuthSession> mDBApi
and when I try to define eclipse show me a error. "DropboxAPI cannot be resolved to a type"
Somebody can I help me? Thanks a lot