我有一个Android应用程序,可将图像保存到Google云端硬盘中,并共享与我的Google App Engine服务器(python)的网络链接。
// Create client
mGoogleApiClient = new GoogleApiClient.Builder(mContext)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
// handling results after uploading
final DriveOperationResult<Metadata> driveOperationResultHandler = new DriveOperationResult<Metadata>() {
@Override
public void onDriveOperationSucceeded(Metadata result) {
try {
// Successfully fetched metadata
onSuccess(driveId,
result.getOriginalFilename(),
result.getWebContentLink(),
result.getWebViewLink(),
result.getAlternateLink(),
result.getEmbedLink());
} finally {
mGoogleDriveClient.disconnectAsync();
}
}
注意: result.getEmbedLink()始终返回null。另外,如果用户已登录,则无法访问result.getAlternateLink()和result.getWebContentLink()。
我如何以编程方式从Android共享文件,即,使每个人都可以查看该文件(假设用户对此表示同意)
Google Drive的android API无法使用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句