androidgoogle-drive-apiodk

ODK Collect - Google Drive default authentication


i have successfully setup ODK Collect into my android app. I can setup my tom cat credentials easily from the settings xml. However when i try to switch to google drive, i need to setup the google account from my phone. Is it possible to setin default email and password for fetching questionaires.

<string-array name="protocol_entry_values">
    <item>@string/protocol_odk_default</item>
    <item>@string/protocol_google_sheets</item>
    <item>@string/protocol_other</item>
</string-array>
<string-array name="protocol_entries">
    <item>@string/server_platform_odk_aggregate</item>
    <item>@string/server_platform_google_sheets</item>
    <item>@string/server_platform_other</item>
</string-array>

Solution

  • If you are trying to access users google drive accounts files stored on that then you need to use Oauth2.

    However if you are trying to access a central google drive account one that you as the developer has controller over you should look into service accounts. Service accounts are like a dummy user it has its own drive account and you can share a folder on your drive account with it. Its pre authorized so it always has access you dont have to worry about authenticating it.