Google Sheets and Java

Поділитися
Вставка
  • Опубліковано 30 тра 2019
  • If you’d like to use the data in your Google Sheets projects from your
    Java applications, this is the guide for you.
    We’ll use Google’s official v4 API SDK for Java to access an example spreadsheet inside of Google Sheets.
    Google’s Quickstart for Java: developers.google.com/sheets/...
    More about Batch Update Requests: developers.google.com/sheets/...
    Check out Twilio at: twilio.com?
  • Наука та технологія

КОМЕНТАРІ • 94

  • @colbypeterson2316
    @colbypeterson2316 10 місяців тому +1

    Very nice guide - was looking to use google sheets for a java application and just could not understand how to get it to work before this video. I did get some errors with the Jackson json reader in this modern day and age 4 years later, but that was nothing finding Gson couldn;t solve. Thanks for this!

  • @andreykozinov2484
    @andreykozinov2484 5 років тому +11

    Will it be a big difference if I want to do an android app and read/write data from google sheet? Is it possible to make a video for that case?

  • @imanotjr1368
    @imanotjr1368 Рік тому

    Amazing video, I couldn't find any simple to follow guide/documentation since the Google API's are so complex. Very good job sir.

  • @eranmeir90
    @eranmeir90 5 років тому +3

    This is great, thank you

  • @AnonimosExeretis
    @AnonimosExeretis 9 місяців тому

    Finaly Gradle capable UA-cam tutorial. Cheers!

  • @hitechnic5246
    @hitechnic5246 8 місяців тому

    This was really helpful, thanks)

  • @joaquin70107
    @joaquin70107 4 роки тому +1

    I used the Google example and no problem but when i try to use my GoogleSheets doesnt work, i changed de String range and the SpreadSheets ID. Whats wrong?? any quick help would be awesome

  • @TheFuzzyketchupTuts
    @TheFuzzyketchupTuts 5 років тому +14

    Can you post a pastebin with the code?

  • @kamisamahisoka2633
    @kamisamahisoka2633 2 роки тому

    Thank you! It helps alot.

  • @kyrylochornobryvets3385
    @kyrylochornobryvets3385 Рік тому

    For a long time I can not find a way to write data without duplicates. At the same time, I want to compare duplicates not by all columns, but by certain ones (for example, to compare only by one column). How can I do that? Perhaps you already have such a video or a link to a site with an explanation. Thank you.

  • @raylaphuc579
    @raylaphuc579 4 роки тому +1

    What is the test folder for?

  • @wolontong
    @wolontong Рік тому

    is there a way to read google sheet like how you read sql and show the data as table in java?

  • @NeryNicolas
    @NeryNicolas 4 роки тому

    By any change, is there a way to avoid the consent request?

  • @rajatgupta7994
    @rajatgupta7994 3 роки тому

    If we are using java for google sheets that 6 minutes job time out still.implies?

  • @yasseralbrikeet2292
    @yasseralbrikeet2292 3 роки тому

    Is there a way to make user choose his own spreadsheet. Fo example if you make the application available in playstor of android , everyone download the application will use same spreadsheet?!

  • @dongphuongtran
    @dongphuongtran 4 роки тому +2

    If I want to get values, I have to have "range".
    So how to get all rows when I don't knows number of rows or range?
    Thanks.

    • @tobias95900
      @tobias95900 3 роки тому

      If you know count of columns, just set range ="A:columns count"
      For example range = "A:K"

  • @IronMan-yb7ps
    @IronMan-yb7ps 2 роки тому

    Exception in thread "main" java.lang.NoSuchMethodError: 'java.lang.Object com.google.api.client.json.JsonFactory.fromReader(java.io.Reader, java.lang.Class)'
    Why this error

  • @sarahamlili5227
    @sarahamlili5227 2 роки тому

    What changes should be made If I'm using it for an Android app java?

  • @maheshreddy1612
    @maheshreddy1612 4 роки тому

    If i run this code at server side, how can i give the permission to sheet at first time.

  • @ryangauthier3957
    @ryangauthier3957 4 роки тому +1

    Doesn't seem like a true CRUD since you manually created the google sheet to read, update, and delete. Is it possible to programatically create a Google Sheet? I have been looking all over and in the Google Dev documentation would appreciate any help.

    • @twilio
      @twilio  4 роки тому

      I believe you could create the sheet using the Google Drive API.

  • @FeruuPL
    @FeruuPL 5 років тому +1

    Hi, I'm getting GoogleJsonResponseException: 403 Forbidden error while writing values into cells with message: "Request had insufficient authentication scopes." and status: "PERMISSION_DENIED". Do you have any idea what causes this error?

    • @FieryMelon300
      @FieryMelon300 5 років тому +1

      try deleting the token you generated if you ran it originally as SPREADSHEET_READONLY and rerunning the code

  • @danielolili
    @danielolili 5 років тому +1

    How do I go about updating a row`s data based on an ID i placed in one of the row`s cells?

    • @twilio
      @twilio  5 років тому +1

      The easiest way is probably to use batchGetByDataFilter and then do an update on the resulting row: developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/batchGetByDataFilter

  • @starlaboratory_ua
    @starlaboratory_ua 4 роки тому +3

    Thank you so much sir!!!!!!!!!!!!!

    • @twilio
      @twilio  4 роки тому +2

      You’re welcome!

  • @charlie-cb4gt
    @charlie-cb4gt 2 роки тому +2

    the quickstart for java site doesn't seem to work the same way anymore so i've been on the first minute of this video for 2 hours, my head hurts, i'm tired, i don't understand any of it, i wanna cry

  • @macare-engineering8379
    @macare-engineering8379 4 роки тому +1

    Thanks...please make a video on how to get value with query in google sheets using java.

  • @neilabad9753
    @neilabad9753 2 роки тому

    Can you please teach me how to get data on a specific column only?

  • @Ntrinzc
    @Ntrinzc 4 роки тому +1

    the code name at 2:48, pathname at 3:43 and set access type at 3:47 throws an error saying it can't be resolved, anyone know how to fix this / let me know what I did wrong?

  • @d_a_r_ii
    @d_a_r_ii Рік тому

    Hello, I have got a problem. Now google offers another way of getting credentials.json. On that webpage I don't see this stuff which you got. Can you please tell me where should I install credentials.json?

  • @smhmyhead9184
    @smhmyhead9184 7 місяців тому

    what if I don't want anyone with the link to edit my sheet&

  • @donvj007
    @donvj007 4 роки тому +1

    How can I get this code?🙄

  • @VivekSingh-ee7ww
    @VivekSingh-ee7ww Рік тому

    Do we need any subscription to access Google sheets API ?

  • @MaximaToluene
    @MaximaToluene 4 роки тому

    Will this work as a springboot web app?

  • @fatihaknbayraktar8735
    @fatihaknbayraktar8735 3 роки тому

    It is OK. But you copy google oauth link from console. I want to use with spring boot rest web service. How can I do without an extra login page? Is it possible?

  • @joaofolgado3316
    @joaofolgado3316 4 роки тому +3

    the console give me this error "because you are running on a non-POSIX file system" what can i do? thanks

    • @user-wy7bv3iw2h
      @user-wy7bv3iw2h 3 роки тому

      hey, i have the same error. Have you fixed it?

    • @joaofolgado3316
      @joaofolgado3316 3 роки тому

      @@user-wy7bv3iw2h hey, that error is not a problem. My program works very Nice with that error. But if you want to know about posix file sYSTEMS Google it, there are much information about that.

    • @OwnedTime
      @OwnedTime 3 роки тому

      its not error. This is WARNING!

    • @joaofolgado3316
      @joaofolgado3316 3 роки тому

      @@OwnedTime “but if you want to know about posix file systems google it” i said. For me still working just fine.

  • @VivekSingh-ee7ww
    @VivekSingh-ee7ww Рік тому

    Can it be done using maven ?

  • @olegchorpita5681
    @olegchorpita5681 3 роки тому +1

    can you please provide more info about how you can get credentials and what exactly was specified at console developer?

  • @1992supergamefreak
    @1992supergamefreak 5 років тому

    Can we do it without making the project a gradle project?? I am getting error "java.lang.ClassNotFoundException: org.mortbay.component.LifeCycle"

    • @1992supergamefreak
      @1992supergamefreak 5 років тому

      @@twilio I asked it regarding the code that is explained in the video. I think I have been provided with a wrong link.

    • @twilio
      @twilio  5 років тому

      @@1992supergamefreak Oh yes sorry you are correct. I thought you were missing the Twilio library but we don't use that in this video :) The full installation instructions (including the zip files for Google's Java SDK) are here: developers.google.com/api-client-library/java/google-api-java-client/setup

  • @imacoolguyful
    @imacoolguyful 2 роки тому

    How can I authenticate like you did at 6:28 from within a docker container, im very curious

    • @twilio
      @twilio  2 роки тому

      I think you should be able to. The example we’re showing shows how to do this with a document but you can also pass the values in directly.

    • @imacoolguyful
      @imacoolguyful 2 роки тому

      @@twilio do you have any recommendations on what I should Google for, I couldnt find anything in Google sheets docs

  • @kunalsalunkhe8411
    @kunalsalunkhe8411 Рік тому

    I am unable to load creadentials.json in resources

  • @sirajmunir770
    @sirajmunir770 4 роки тому +2

    Getting this exception. I have also tried deleting and re-generating the credentials.json file.
    Exception in thread "main" com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden {
    "code" : 403,
    "errors" : [ {
    "domain" : "global",
    "message" : "Insufficient Permission",
    "reason" : "insufficientPermissions"
    } ],
    "message" : "Request had insufficient authentication scopes.",
    "status" : "PERMISSION_DENIED"
    }

    • @vietcharly
      @vietcharly 3 роки тому

      Were you able to resolve this?

    • @vietcharly
      @vietcharly 3 роки тому +2

      I was able to resolve it, I changed the sheets status from 'anyone with link can read' to 'write'. Then I went in and changed this line .setDataStoreFactory(new FileDataStoreFactory(new java.io.File("tokens"))) from tokens to 'token' to generate a new token

    • @sirajmunir770
      @sirajmunir770 3 роки тому

      Okay, I will try this one.

  • @DhimanDa
    @DhimanDa 2 роки тому +1

    can you please share the code please?

  • @PianoSurRia
    @PianoSurRia 3 роки тому

    When creating input stream for CREDENTIALS_FILE_PATH better to use try with resources

  • @cring334
    @cring334 4 роки тому +3

    got error
    Execution failed for task ':SheetsAndJava.main()'.
    > Process 'command '/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
    can someone help? Im good at painting, not coding

    • @valizeth4073
      @valizeth4073 3 роки тому

      It basically means that it failed, literally. You need to use the stack trace to get the actual errors, cause from that 1 message alone, it can be literally anything.

  • @shajeelafzal
    @shajeelafzal 5 років тому +5

    Please make one for Google Sheets and JavaScript.

    • @twilio
      @twilio  5 років тому +2

      We made one already :) ua-cam.com/video/UGN6EUi4Yio/v-deo.html

    • @shajeelafzal
      @shajeelafzal 5 років тому +2

      @@twilio Thank you so much. Loved it.

    • @twilio
      @twilio  5 років тому +1

      Awesome! Let us know if there’s anything else you’d like to see.

    • @naveentiwari4763
      @naveentiwari4763 4 роки тому

      @@twilio Please make one for Google Sheets and Apex Salesforce

  • @cring334
    @cring334 4 роки тому +2

    I got the error "Execution failed for task ':SheetsAndJava.main()'.
    > Process 'command '/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1"
    can someone help?

    • @junkhoo9444
      @junkhoo9444 4 роки тому

      You need to find the error code to get a hint on what caused the execution to fail. For example if the error code is 400, then it means the server (google) cant understand your request (for the sheet) that you sent, a common mistake is your range value (in this case "congress!A2:F10"), there might be a typo. If its not then you will have to debug and look for your error

  • @sefagames5739
    @sefagames5739 4 роки тому +1

    Is there a way to do the same in Maven?

    • @bobfish4404
      @bobfish4404 3 роки тому +1

      Yes very similar just import com.google.api.client as groupid and google-api-client as artifact id and same for the rest of the imports in your pom

  • @user-ro5gt9mt4g
    @user-ro5gt9mt4g Рік тому

    0:41 you did not explain what is this. I don't understand what is Java quick start .

  • @alexshepel5599
    @alexshepel5599 3 роки тому

    nice

  • @dinislam3286
    @dinislam3286 5 років тому +1

    We want to more videos about api service

  • @OMGerCodeHub
    @OMGerCodeHub Рік тому

    After breaking my head for 20minutes why the hell can't I run the read on my own file, I figured it out,
    When you do the read (not sure when they changed it) you don't need the file name when you specify a range.

  • @MckyMus-lo7ox
    @MckyMus-lo7ox 2 роки тому

    Bro.... U a fucking g lad. i love you

  • @addubgib
    @addubgib 5 років тому +1

  • @Mr.rawJat
    @Mr.rawJat 2 роки тому

    please give me git repo

  • @PianoSurRia
    @PianoSurRia 3 роки тому

    Comparing to Apache POI the google sheet API looks really ugly

  • @yaprakdepoterminal2434
    @yaprakdepoterminal2434 2 роки тому

    everything's great except Dark theme, can't see nothing

  • @user-qx6ji8ms1x
    @user-qx6ji8ms1x 5 місяців тому

    as a beginner, I still didn't get it :(

  • @sixro
    @sixro 2 роки тому

    WARNING: the authentication part in this video is obsolete

  • @parlaybot
    @parlaybot Рік тому

    how to i refresh credentials

  • @senya1696
    @senya1696 Рік тому

    for me InputStream in = SheetsAndJava.class.getResourceAsStream("path/to/file");
    didn't work for some reason I got null pointer exception all the time.
    I used FileInputStream in = new FileInputStream("path/to/file"); instead, now everything works fine