How to use Google Drive in a Java Desktop app?

后端 未结 4 1656
夕颜
夕颜 2021-02-09 07:09

I am dealing with mobile and desktop applications. I am trying to use Google Drive as a permanent storage folder. Unfortunately I am at a loss because I cannot find any example

相关标签:
4条回答
  • 2021-02-09 07:26

    I don't know if I figured out your problem. What I have understood is that you are looking for a way that makes you able to work on the same project from different computers.

    If so, you simply have to download Drive. Once install it will ask you what folder you want to keep syncronized with Drive. If you select your workspace, it will be syncronized with Drive. So, on another pc, if you have installed Drive, you will be able to use the workspace folder too, with the same files.

    I hope this is helpful.

    Marco

    0 讨论(0)
  • 2021-02-09 07:37

    Did you look at the sample app on the drive API page?

    edit

    google moved the examples to github

    0 讨论(0)
  • 2021-02-09 07:37

    This question is a little bit old, still. You can look at this example: https://code.google.com/p/google-api-dotnet-client/wiki/OAuth2

    They do the OAuth2 for accessing task. But I just used the same code to access the files using the v2 API. http://code.google.com/p/google-api-dotnet-client/wiki/APIs#Drive_API

    I only retrieved the file list, but it is working (from .NET, desktop app).

    0 讨论(0)
  • 2021-02-09 07:39

    You should look into Documents List API.

    The Google Drive API & SDK are meant to be a mean to integrate applications into the Web-UI of Google Drive. To protect the security of the user's files, it puts some restrictions to the application developer, like:

    • The app has to be installed from the Chrome Web Store
    • The app can only access files created from the app itself,
    • or files selected by the user using the Google Picker UI.

    All these restrictions make the Google Drive API not a good choice for most non-web applications. E.g. installing the app from the Chrome Web Store is probably something you would find cumbersome to request from your users for a mobile or desktop application. Nonetheless, without being installed from the Chrome Web Store your application will always receive an error when accessing a file from Google Drive.

    The Documents List API allows you to store and load files (not only Google Documents!) into Google Drive.

    0 讨论(0)
提交回复
热议问题