0

I want to store some application data on the google drive, for example to remember settings the user have made. Normally I will use cookies for this or the localStorage of the browser but this is browser depended and limited (storage size).

I google for some information about this functionality but didn't found something useful except the example of google itself. In this example (found here: https://developers.google.com/drive/appdata) they explain how to store some information. To me it looks more like sending an e-mail and they didn't explain how to replace some data. Quite complicated if you ask me.

I wonder why it must be that difficult to store a simple boolean, integer or string like you can do with cookies or the localStorage object. I doesn't have to know where it is located, just simple, you alter an identifier and a value, that must be it.

Does have somebody an example that makes this function easier to use? I mean is this the only way to do it? Does somebody has some experience with saving appdata?

Or does anybody knows a class that can simplify those things (like the PHP version)?

VLAZ
  • 26,331
  • 9
  • 49
  • 67
Codebeat
  • 6,501
  • 6
  • 57
  • 99
  • Appdata is not a key-value storage. It's designed to store files, so maybe you should take a look at another solution. – Burcu Dogan Aug 20 '13 at 20:01

1 Answers1

1

If you wish to store data in the users Google Drive, yes, it is that complicated. You are going to have to go through the OAuth2 process or one of the other handshake methods Google allows. However, if you wish to store that data into your own Google drive, which doesn't sound smart but I cannot tell from your question, you could make the process a lot easier because you could hard code your username and password into the header of the api calls you make. Again, that is not smart or recommended but because OAuth2 requires HTTPS its not suicide.

I'm sorry but it is not clear what you are asking. Please more specifically state your problem, otherwise this is the best answer anyone could give.

zg303
  • 97
  • 1
  • 11
  • Dude, appreciate your answer but .... where you talking about "doesn't sound smart" there is a folder special designed for this and NOT viewable by the user. Not clear what I am asking? I want store some settings, did you read my question anyway? And why is your answer an answer, it should be a comment because you enter not a solution. – Codebeat Aug 21 '13 at 15:39
  • @Erwinus This is an answer because, before your edit, you were only asking a yes or no question to which, my answer was yes. Secondly, YOU are not understanding my answer, I understand your question perfectly and have done it before. I am aware that "there is a folder special designed for this and NOT viewable by the user" and that is EXACTLY what I am suggesting you use. What may have been confusing is that I offered another solution, the one I labeled "not smart" where I talked about storing your user's settings in YOUR drive. That was a dumb suggestion that only offers less user interaction – zg303 Aug 22 '13 at 20:19
  • @Erwinus it was also an answer because I do not have enough of a reputation to comment:) – zg303 Aug 22 '13 at 20:21