GDrive REST API - Read files not created by application - Connection issues










0















I want to be able to



  • select a folder in Google Drive (alternatively, I can just Copy/Paste the Drive ID because this application is only for my needs for the moment)

  • Read files metadata in this folder

  • Download content of those files (spreadsheet)

I tried to use Google Drive API which is pretty simple, but this restriction is a problem for me:




Note: The Android Drive API only works with the
https://www.googleapis.com/auth/drive.file scope. This means that only
files which a user has opened or created with your application can be
matched by a query.




Indeed, the Drive folder and files (spreadsheet) I want to read or download are not created by the application.
https://www.googleapis.com/auth/drive.readonly would be perfect for my needs, but it’s only usable with Google Drive REST API.



This is where my problems begins:



First, I tried to run the REST DEMO Master project. With some updates in the gradle it works fine.
So, I tried to create a new project (API 23, no activity) and I simply copy/paste files from REST DEMO Master project. I ran this new project and it threw this exception:



UNSPECIFIED GOOGLE DRIVE FAILURE - the name must not be empty: null


As the code is the same, I suppose that the problem comes from conflicts between API Version or project configuration (I’m pretty new to android development and not comfortable with Gradle), and I can't use this code in my existing project.



I read this thread (and many others), I spent hours trying different solutions but I’m really stuck and I can’t find a way to make that work.



What is the best way to connect to a GDrive folder and read content of files not created by the application? Any help would be really appreciated!



NB: I generated the signing certificate fingerprint (SHA1) and registered the application.










share|improve this question
























  • I found a documentation regarding Authorizing and Using REST APIs, you can start with this.You can find the complete REST API sample code included in the Google Sign-In Quickstart on Github: RestApiActivity.java.

    – Mr.Rebot
    Nov 16 '18 at 7:24











  • Thank you for the Google Sign-In Quickstart sample code, it really helped ! Problem solved :)

    – flzox
    Nov 20 '18 at 19:54
















0















I want to be able to



  • select a folder in Google Drive (alternatively, I can just Copy/Paste the Drive ID because this application is only for my needs for the moment)

  • Read files metadata in this folder

  • Download content of those files (spreadsheet)

I tried to use Google Drive API which is pretty simple, but this restriction is a problem for me:




Note: The Android Drive API only works with the
https://www.googleapis.com/auth/drive.file scope. This means that only
files which a user has opened or created with your application can be
matched by a query.




Indeed, the Drive folder and files (spreadsheet) I want to read or download are not created by the application.
https://www.googleapis.com/auth/drive.readonly would be perfect for my needs, but it’s only usable with Google Drive REST API.



This is where my problems begins:



First, I tried to run the REST DEMO Master project. With some updates in the gradle it works fine.
So, I tried to create a new project (API 23, no activity) and I simply copy/paste files from REST DEMO Master project. I ran this new project and it threw this exception:



UNSPECIFIED GOOGLE DRIVE FAILURE - the name must not be empty: null


As the code is the same, I suppose that the problem comes from conflicts between API Version or project configuration (I’m pretty new to android development and not comfortable with Gradle), and I can't use this code in my existing project.



I read this thread (and many others), I spent hours trying different solutions but I’m really stuck and I can’t find a way to make that work.



What is the best way to connect to a GDrive folder and read content of files not created by the application? Any help would be really appreciated!



NB: I generated the signing certificate fingerprint (SHA1) and registered the application.










share|improve this question
























  • I found a documentation regarding Authorizing and Using REST APIs, you can start with this.You can find the complete REST API sample code included in the Google Sign-In Quickstart on Github: RestApiActivity.java.

    – Mr.Rebot
    Nov 16 '18 at 7:24











  • Thank you for the Google Sign-In Quickstart sample code, it really helped ! Problem solved :)

    – flzox
    Nov 20 '18 at 19:54














0












0








0








I want to be able to



  • select a folder in Google Drive (alternatively, I can just Copy/Paste the Drive ID because this application is only for my needs for the moment)

  • Read files metadata in this folder

  • Download content of those files (spreadsheet)

I tried to use Google Drive API which is pretty simple, but this restriction is a problem for me:




Note: The Android Drive API only works with the
https://www.googleapis.com/auth/drive.file scope. This means that only
files which a user has opened or created with your application can be
matched by a query.




Indeed, the Drive folder and files (spreadsheet) I want to read or download are not created by the application.
https://www.googleapis.com/auth/drive.readonly would be perfect for my needs, but it’s only usable with Google Drive REST API.



This is where my problems begins:



First, I tried to run the REST DEMO Master project. With some updates in the gradle it works fine.
So, I tried to create a new project (API 23, no activity) and I simply copy/paste files from REST DEMO Master project. I ran this new project and it threw this exception:



UNSPECIFIED GOOGLE DRIVE FAILURE - the name must not be empty: null


As the code is the same, I suppose that the problem comes from conflicts between API Version or project configuration (I’m pretty new to android development and not comfortable with Gradle), and I can't use this code in my existing project.



I read this thread (and many others), I spent hours trying different solutions but I’m really stuck and I can’t find a way to make that work.



What is the best way to connect to a GDrive folder and read content of files not created by the application? Any help would be really appreciated!



NB: I generated the signing certificate fingerprint (SHA1) and registered the application.










share|improve this question
















I want to be able to



  • select a folder in Google Drive (alternatively, I can just Copy/Paste the Drive ID because this application is only for my needs for the moment)

  • Read files metadata in this folder

  • Download content of those files (spreadsheet)

I tried to use Google Drive API which is pretty simple, but this restriction is a problem for me:




Note: The Android Drive API only works with the
https://www.googleapis.com/auth/drive.file scope. This means that only
files which a user has opened or created with your application can be
matched by a query.




Indeed, the Drive folder and files (spreadsheet) I want to read or download are not created by the application.
https://www.googleapis.com/auth/drive.readonly would be perfect for my needs, but it’s only usable with Google Drive REST API.



This is where my problems begins:



First, I tried to run the REST DEMO Master project. With some updates in the gradle it works fine.
So, I tried to create a new project (API 23, no activity) and I simply copy/paste files from REST DEMO Master project. I ran this new project and it threw this exception:



UNSPECIFIED GOOGLE DRIVE FAILURE - the name must not be empty: null


As the code is the same, I suppose that the problem comes from conflicts between API Version or project configuration (I’m pretty new to android development and not comfortable with Gradle), and I can't use this code in my existing project.



I read this thread (and many others), I spent hours trying different solutions but I’m really stuck and I can’t find a way to make that work.



What is the best way to connect to a GDrive folder and read content of files not created by the application? Any help would be really appreciated!



NB: I generated the signing certificate fingerprint (SHA1) and registered the application.







android google-drive-sdk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 16 '18 at 2:21









Jacque

3827




3827










asked Nov 15 '18 at 14:31









flzoxflzox

1




1












  • I found a documentation regarding Authorizing and Using REST APIs, you can start with this.You can find the complete REST API sample code included in the Google Sign-In Quickstart on Github: RestApiActivity.java.

    – Mr.Rebot
    Nov 16 '18 at 7:24











  • Thank you for the Google Sign-In Quickstart sample code, it really helped ! Problem solved :)

    – flzox
    Nov 20 '18 at 19:54


















  • I found a documentation regarding Authorizing and Using REST APIs, you can start with this.You can find the complete REST API sample code included in the Google Sign-In Quickstart on Github: RestApiActivity.java.

    – Mr.Rebot
    Nov 16 '18 at 7:24











  • Thank you for the Google Sign-In Quickstart sample code, it really helped ! Problem solved :)

    – flzox
    Nov 20 '18 at 19:54

















I found a documentation regarding Authorizing and Using REST APIs, you can start with this.You can find the complete REST API sample code included in the Google Sign-In Quickstart on Github: RestApiActivity.java.

– Mr.Rebot
Nov 16 '18 at 7:24





I found a documentation regarding Authorizing and Using REST APIs, you can start with this.You can find the complete REST API sample code included in the Google Sign-In Quickstart on Github: RestApiActivity.java.

– Mr.Rebot
Nov 16 '18 at 7:24













Thank you for the Google Sign-In Quickstart sample code, it really helped ! Problem solved :)

– flzox
Nov 20 '18 at 19:54






Thank you for the Google Sign-In Quickstart sample code, it really helped ! Problem solved :)

– flzox
Nov 20 '18 at 19:54













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321710%2fgdrive-rest-api-read-files-not-created-by-application-connection-issues%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53321710%2fgdrive-rest-api-read-files-not-created-by-application-connection-issues%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3

Museum of Modern and Contemporary Art of Trento and Rovereto