简体   繁体   中英

how to upload encrypted file to google drive

我想将数据库(sqlite)文件上传到Google Drive帐户。但是我不知道如何将文件上传到Google Drive.pls提供一些代码或链接,这可能有助于将文件从内部/外部存储设备上传到Google驾驶。

Since I cannot post a comment I would post this as an answer. Hope that it's not against community guidelines. But can't you just use an intent to ask the user to select Google Drive if installed (if the user wants to upload it to their own drive space,but you've not provided any info on that).

Intent intent=new Intent(Intent.ACTION_SEND).setData(uriToFile).setType(mimeType);
startActivity(intent);

How to make the valid URI;

String path=Environment.getExternalStorageDIrectory().getAbsolutePath()+"/"+stringPathToFile;
Uri uri=Uri.fromFile(new File(path));

Use this instead of Uri.parse(String).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM