B4A Library GSheet Library (integrate google sheets into your B4X apps easily)

Gsheet

Author:
Fernando Arevalo
Version: 1.0

Functions:
  • Process_Globals As String
B4A, B4I
  • Initialize (ClientId As String)
B4J
  • Initialize(ClientId As String,ClientSecret As String)
B4X
  • SpreadsheetsId As String
    The ID of your document. This is the big long aplha-numeric code in the middle of the document's URL.
  • Sheets_name As String
    Name of the sheet we are going to work on
  • Sub delete(id As Int)
    id: row number to delete
  • Updatesheet(id As String, l As List)
    id: row number to Update and l: list of new items
  • UpdateSheet_range(range As String, value As String)
    range: position of the value to be updated example: "A2". value: new value
  • insert_list(l As List)
    l: list of new items, these items will be added in the next empty row( if a list is created with the total or partial elements of a database it will be added as a single query immediately to your sheet)


Gsheetplus

Author:
Fernando Arevalo
Version: 1.0

Functions:
  • Process_Globals As String
B4A, B4I
  • Initialize (ClientId As String)
B4J
  • Initialize(ClientId As String,ClientSecret As String)
B4X
  • SpreadsheetsId As String
    The ID of your document. This is the big long aplha-numeric code in the middle of the document's URL.
  • Sheets_name As String
    Name of the sheet we are going to work on
  • Sub delete(id As Int)
    id: row number to delete
  • Updatesheet(id As String, l As List)
    id: row number to Update and l: list of new items
  • UpdateSheet_range(range As String, value As String)
    range: position of the value to be updated example: "A2". value: new value
  • insert_list(l As List)
    l: list of new items, these items will be added in the next empty row( if a list is created with the total or partial elements of a database it will be added as a single query immediately to your sheet)
  • copytodrive(title As String,sheetcopy As String)
    creates a copy in the drive of the account with which you enter a selected sheet you must define the name of the new spreadsheet (title) and the name of the sheet to copy (sheetcopy)
  • createtitle( l As List, sheetsname As String, fontsize As Int,bold As Boolean)
    l: list of titles, sheetsname: name of the sheet where the titles will be inserted
  • create_spreadsheets(title1 As String)
    title: name of the new spreadsheet
  • create_sheets(name_sheets As String,SpreadsheetId As String)
    name_sheets: name of the new sheet, SpreadsheetId:The ID of your document
  • deletesheet(sheetsname As String )
    name_sheets: name of the sheet for delete into spreadsheet
  • newspreadsheetsid As String
    allows to retrieve the id after creating a new spreadsheet or after backing up one in drive to save it in a database or variable it is recommended to put a wait of 2s before calling the value of this variable
  • newnamesheet As String
    allows you to retrieve the name of the new sheet created to save it in a database or variable it is recommended to wait for 2s before calling the value of this variable



NOTE:

This library is not free, because, it took a lot of time and gray hair to create all the methods and learn how the api works.
Please write GSheets or GSheetplus in the order description, thanks.



Thanks for your understanding. :)

This library depends the Google OAuth2 class:
follow the tutorial in this topic to create your project in google console developer, enable google dive and google sheets apis, make sure to add your package name to your project, and create an oauth screen.

Add this in your manifest:

manifest:
AddActivityText(Main,
  <intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:scheme="$PACKAGE$" />
  </intent-filter>
   )

Read example for v4 api:
Read sheets:
Sub GetSheet
table1.ClearAll
    Dim j As HttpJob
    j.Initialize("", Me)
    j.Download("https://sheets.googleapis.com/v4/spreadsheets/17YACjfqxKHDCXM_N7Jnq9BC_KzzkEgXLKzHDwaIM5Zs/values/Example!A2:Z?key=xxxxxxxxxxxxxxxxxxxxxxxxx")
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
        Dim parser As JSONParser
        parser.Initialize(j.GetString.Trim)
        Dim root As Map = parser.NextObject
        'Dim majorDimension As String = root.Get("majorDimension")
        Dim values As List = root.Get("values")
 
        For Each colvalues As List In values
 
  Dim id1 As Int = colvalues.Get("4")
            Dim create As String = colvalues.Get("3")
            Dim Telephone1 As Int = colvalues.Get("0")
            Dim Age1 As Int = colvalues.Get("2")
            Dim Name1 As String = colvalues.Get("1")
            If colvalues.Size > 0 Then
             table1.AddRow(Array As String(id1,Telephone1,Name1,Age1,create))
            End If
 
        Next
        Dim range As String = root.Get("range")
        Log(range)
    End If

 

    j.Release
End Sub

Read example with Gsheets
ReadGsheet Gsheets::
Sub GetSheet

 
    Table1..ClearAll
    s.GetSheet(Me)
    Wait For get_result(x As List)
 
    For Each col As Map In x
 
        Table1.AddRow(Array As String(col.Get("1"),col.Get("Téléphone"),col.Get("Name"),col.Get("Age"),col.Get("created")))
 
    Next
 
End Sub

Example connect:

Example connect:
#Region  Activity Attributes
    #FullScreen: false
    #IncludeTitle: FALSE
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Dim s As GSheets
    Private conect1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    s.Initialize("xxxxxxxxxxxxxxxx.apps.googleusercontent.com")'your Clientid google developers console, activate google drive api and google sheets api
    s.Sheets_name = "Example"
    s.SpreadsheetsId = "1FHx-a_a4afTQ3L5hXJIOttCVaJNngO3113E-qqFOjbk"
    Activity.LoadLayout("sheets1")
 
End Sub

'Connect
Sub connect1_Click
    s.connect
End Sub

Sub Activity_Resume

s.oauth2.CallFromResume(Activity.GetStartingIntent)
 
End Sub


Advantages:
  • It is not linked to paying an external api
  • the google sheet api is totally free
  • You can integrate multiple apps into a single project in the google console
  • Easy to use and integrate
Download page:

Download Gsheetsplus:


Download Gsheets:

gsheets2json.xyz


Example B4A:


Important in the verification screen of your project in google cloud activate this permission:
permiso.png

Important when generating a key for android activate this:
importante.png


Example google sheet:
Example api
 

Attachments

  • ExampleB4J.zip
    3.8 KB · Views: 420
Last edited:

fernando1987

Active Member
Licensed User
Dear Abbas818,

I’m pleased to inform you that the GSheets library has been succe

To download it, please follow these s

Log in to your account at https://b4xapp.com
Go to the "My Purchases" sectio
Look for the GSheets library and click on the download link.
For more detailed instructions, you can refer to this article:
If you encounter any issues or need assistance, feel free to reach out to me. I’ll be happy to
 
Last edited:

Abbas818

Member
Dear Abbas818,

I’m pleased to inform you that the GSheets library has been succe

To download it, please follow these s

Log in to your account at https://b4xapp.com
Go to the "My Purchases" sectio
Look for the GSheets library and click on the download link.
For more detailed instructions, you can refer to this article: https://b4xapp.com/blog/how-to-download-the-source-codes-and-library

If you encounter any issues or need assistance, feel free to reach out to me. I’ll be happy to
Thanks a lot you Fernando
I appreciate your kindness.
 

Abbas818

Member
Dear Fernando
Thanks for sharing your good library
Unfortunatly I am beginer in B4A.
I tried to use Gsheetplus library. I only want to read and write a string value in a specefic cell for example Cell A5 in a sheet. I saw your example "hojs-de-google" but it is very complicated for me.
Can you please share me a simple example to read and write to a specefic cell?
Thanks
 

fernando1987

Active Member
Licensed User
Dear Fernando
Thanks for sharing your good library
Unfortunatly I am beginer in B4A.
I tried to use Gsheetplus library. I only want to read and write a string value in a specefic cell for example Cell A5 in a sheet. I saw your example "hojs-de-google" but it is very complicated for me.
Can you please share me a simple example to read and write to a specefic cell?
Thanks
The example clearly demonstrates the four main functions: read, update, write, and delete. However, it is essential to first configure a home screen in your Google Console, generate the required keys, and enable permissions for the necessary APIs.

Remember that your application's name must be linked to the API key you generated. It is recommended to follow the tutorial videos mentioned in the first post and ensure the package name matches the one assigned to the generated key. Please verify and correctly configure your Google Cloud Console to ensure everything works as expected.


 

Abbas818

Member
Dear Fernando
I followed the instruction and tried to test your example. It runs but when it wants to connect to my account and I confirm it , the browser open google.com and nothing happens. Whenever i use the app this will happens. Please see the file I attached.
 

Attachments

  • Screenshot_20241220_131750.jpg
    Screenshot_20241220_131750.jpg
    244 KB · Views: 71
  • Screenshot_20241220_131812_Chrome.jpg
    Screenshot_20241220_131812_Chrome.jpg
    200 KB · Views: 78
  • Screenshot_20241220_131826_Chrome.jpg
    Screenshot_20241220_131826_Chrome.jpg
    329 KB · Views: 69
  • Screenshot_20241220_131845_Chrome.jpg
    Screenshot_20241220_131845_Chrome.jpg
    387.6 KB · Views: 63
  • Screenshot_20241220_131916_Chrome.jpg
    Screenshot_20241220_131916_Chrome.jpg
    139.3 KB · Views: 67
  • Screenshot_20241220_131931.jpg
    Screenshot_20241220_131931.jpg
    161.5 KB · Views: 64
  • Screenshot_20241220_131944.jpg
    Screenshot_20241220_131944.jpg
    127.8 KB · Views: 69

fernando1987

Active Member
Licensed User
Hello, could you please send me the code, the example that you modified and with which you have problems, so I can review it?
 

fernando1987

Active Member
Licensed User
Dear Fernando
Thanks for sharing your good library
Unfortunatly I am beginer in B4A.
I tried to use Gsheetplus library. I only want to read and write a string value in a specefic cell for example Cell A5 in a sheet. I saw your example "hojs-de-google" but it is very complicated for me.
Can you please share me a simple example to read and write to a specefic cell?
Thanks
Here is a functional example that creates a spreadsheet in Google Sheets, saves its ID and name in a database, and specifically modifies the value of cell A5 in the generated sheet.

Example Explanation:

  1. Spreadsheet Creation:
    The example uses the Google Sheets API tools to create a new spreadsheet. Once created, its unique ID and assigned name are retrieved.
  2. Database Storage:
    The spreadsheet's ID and name are saved in a database for future management and reference. This simplifies linking it to other operations or applications.
  3. Modifying Cell A5:
    After creating the spreadsheet, the code directly accesses cell A5 and updates its content to a specific value. This step demonstrates how to interact with specific cells within a spreadsheet.
This example is perfect for understanding how to automate the creation, management, and updating of spreadsheets through code while integrating them with a database for more efficient control.
 

Attachments

  • ejample.zip
    11 KB · Views: 52

fernando1987

Active Member
Licensed User

Version 9.5 Now Available! 🎉

We’re excited to announce the release of Version 9.5 with significant code corrections and performance enhancements! 🚀

How to Download the Update:​

If you’ve already purchased a previous version, simply log in to your user panel on our store at b4xapp.com using your credentials.

  1. Navigate to the "Recent Orders" section.
  2. Locate your purchase of Gsheets or GsheetsPlus.
  3. Click the download option to get the latest version at no additional cost.
Enjoy the improvements and let us know what you think!


🎁 Limited-Time Offer!
Take advantage of 50% OFF on all codes and libraries in our store until January 5, 2025! Don't miss this opportunity to expand your toolkit at half the price.

Visit b4xapp.com now and save big! 🛒
 

DonManfred

Expert
Licensed User
Longtime User

fernando1987

Active Member
Licensed User
On the link https://b4xapp.com/item/magic-api-
i see a related product
firefox_lbHMo20zDc.png


Clicking on it results in a 404 Error

I apologize for the earlier inconvenience; the link is now active again and accessible. You can view it without any issues. In fact, all my libraries related to API integrations are developed using that program because it has the capability to generate the necessary B4X code for seamless API communication. Its efficiency and compatibility have been instrumental in my development workflow.
 

Mr_fifty4

Member
Licensed User
Longtime User
Hi Fernando,

I purchased your gsheetplus library and i'm trying with your example for b4j.
after connect with google i got this errors:

WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
Getting access token from authorization code...
java.lang.NoSuchMethodError: 'java.lang.String b4j.example.httpjob._initialize(b4j.example.httpjob, anywheresoftware.b4a.BA, java.lang.String, java.lang.Object)'
at b4j.example.googleoauth2$ResumableSub_GetTokenFromAuthorizationCode.resume(googleoauth2.java:758)
at b4j.example.googleoauth2._gettokenfromauthorizationcode(googleoauth2.java:723)
at b4j.example.googleoauth2._parsebrowserurl(googleoauth2.java:941)
at b4j.example.googleoauth2$ResumableSub_PrepareServer.resume(googleoauth2.java:456)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1050)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:832)
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodError: 'java.lang.String b4j.example.httpjob._initialize(b4j.example.httpjob, anywheresoftware.b4a.BA, java.lang.String, java.lang.Object)'
at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1052)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodError: 'java.lang.String b4j.example.httpjob._initialize(b4j.example.httpjob, anywheresoftware.b4a.BA, java.lang.String, java.lang.Object)'
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:140)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:42)
at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1050)
... 7 more
Caused by: java.lang.NoSuchMethodError: 'java.lang.String b4j.example.httpjob._initialize(b4j.example.httpjob, anywheresoftware.b4a.BA, java.lang.String, java.lang.Object)'
at b4j.example.googleoauth2$ResumableSub_GetTokenFromAuthorizationCode.resume(googleoauth2.java:758)
at b4j.example.googleoauth2._gettokenfromauthorizationcode(googleoauth2.java:723)
at b4j.example.googleoauth2._parsebrowserurl(googleoauth2.java:941)
at b4j.example.googleoauth2$ResumableSub_PrepareServer.resume(googleoauth2.java:456)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
... 11 more


GSheetplus ver 9.50

Can help me to solve?

thanks
 

fernando1987

Active Member
Licensed User
Hi,

Thank you for reaching out and for purchasing the GSheetPlus library.

The issue you're experiencing might be related to the Google API configuration. Please review the following steps to ensure everything is set up correctly:

1. Google Cloud Console Setup:

Ensure you created the OAuth 2.0 Client ID in the Google Cloud Console.

Replace the client ID and client secret in the example project with the ones provided in the console.

Verify that the redirect URI matches the one used in the example code.



2. Google Sheets and Drive API Activation:

In your Google Cloud Console project, make sure the Google Sheets API and Google Drive API are enabled.



3. Authorization Screen:

Confirm that you have configured the OAuth consent screen properly in the Cloud Console.

Ensure you have added the necessary permissions (scopes) for Drive



4. Permissions:

When authorizing your app, make sure you grant all requested permissions. If you denied any permission during the process, it might cause the token retrieval to fail.



5. Dependencies:

Ensure you have the latest versions of the HttpJob and OkHttpUtils2 libraries in your B4J project. Using outdated libraries can cause errors.



6. Logs:

If the issue persists, check the logs to verify if the authorization code is being received or if the issue occurs during the token exchange process.


Best regards,
Fernando
 

Mr_fifty4

Member
Licensed User
Longtime User
Hi,

Thank you for reaching out and for purchasing the GSheetPlus library.

The issue you're experiencing might be related to the Google API configuration. Please review the following steps to ensure everything is set up correctly:

1. Google Cloud Console Setup:

Ensure you created the OAuth 2.0 Client ID in the Google Cloud Console.

Replace the client ID and client secret in the example project with the ones provided in the console.

Verify that the redirect URI matches the one used in the example code.



2. Google Sheets and Drive API Activation:

In your Google Cloud Console project, make sure the Google Sheets API and Google Drive API are enabled.



3. Authorization Screen:

Confirm that you have configured the OAuth consent screen properly in the Cloud Console.

Ensure you have added the necessary permissions (scopes) for Drive



4. Permissions:

When authorizing your app, make sure you grant all requested permissions. If you denied any permission during the process, it might cause the token retrieval to fail.



5. Dependencies:

Ensure you have the latest versions of the HttpJob and OkHttpUtils2 libraries in your B4J project. Using outdated libraries can cause errors.



6. Logs:

If the issue persists, check the logs to verify if the authorization code is being received or if the issue occurs during the token exchange process.


Best regards,
Fernando

Solved:
following your example and the video I didn't check if the B4J package name (example) and the google user (Connectsheet) matched.

thanks Fernando
 

fernando1987

Active Member
Licensed User
Solved:
following your example and the video I didn't check if the B4J package name (example) and the google user (Connectsheet) matched.

thanks Fernando
Thank you for your feedback and for sharing how you solved the issue. I’m glad you were able to identify the mismatch between the B4J package name and the Google user configuration it’s a detail that can sometimes go unnoticed.

I’d like to take a moment to apologize if my earlier comments didn’t fully acknowledge the complexity of Google’s implementation process. While the GSheet library itself is straightforward to use, I understand that the integration with Google’s system can be challenging and requires a certain level of technical knowledge to implement effectively.

Though the video tutorials may not be perfect, they are intended to provide a basic foundation and serve as a starting point for users. Your experience highlights the importance of paying attention to all the details, and I appreciate you pointing that out.

Best regards,
Fernando
 

Mr_fifty4

Member
Licensed User
Longtime User
Hi Fernando,

after test with B4J (that work well) i start with your android example where i changed only the package name in "com.b4a.sheet" and add a new android user (following your video) in google console. This time package name are the same in app and console plus set URI_redirect flag as your indication.
During google authentication after confirm drive permission i got "Error 400: redirect_uri_mismatch".
Where i can check this issue?
Tanks a lot for you help and patience (google platform is a nightmare for me... 😭)
 

fernando1987

Active Member
Licensed User
Hi Fernando,

after test with B4J (that work well) i start with your android example where i changed only the package name in "com.b4a.sheet" and add a new android user (following your video) in google console. This time package name are the same in app and console plus set URI_redirect flag as your indication.
During google authentication after confirm drive permission i got "Error 400: redirect_uri_mismatch".
Where i can check this issue?
Tanks a lot for you help and patience (google platform is a nightmare for me... 😭)


Hi,
The error "Error 400: redirect_uri_mismatch" typically occurs when the redirect URI in your Google Cloud Console doesn't match the one being used by your application during authentication. Here are a few key points to verify and adjust to resolve the issue:

1. Check the Package Name and SHA-1

  • Ensure the package name you registered in Google Cloud Console matches exactly with the one in your Android app (com.b4a.sheet in this case).
  • Verify that the SHA-1 certificate fingerprint of your app’s signing key is correctly added in Google Cloud Console. This must correspond to the active keystore used to sign your APK (either the debug keystore or the release keystore, depending on your build).

2. Check the Redirect URI in Your Code

  • Confirm that the redirect URI used during the OAuth flow matches exactly with the one registered in Google Cloud Console.
 

Mr_fifty4

Member
Licensed User
Longtime User

Hi,
The error "Error 400: redirect_uri_mismatch" typically occurs when the redirect URI in your Google Cloud Console doesn't match the one being used by your application during authentication. Here are a few key points to verify and adjust to resolve the issue:

1. Check the Package Name and SHA-1

  • Ensure the package name you registered in Google Cloud Console matches exactly with the one in your Android app (com.b4a.sheet in this case).
  • Verify that the SHA-1 certificate fingerprint of your app’s signing key is correctly added in Google Cloud Console. This must correspond to the active keystore used to sign your APK (either the debug keystore or the release keystore, depending on your build).

2. Check the Redirect URI in Your Code

  • Confirm that the redirect URI used during the OAuth flow matches exactly with the one registered in Google Cloud Console.
hi,
check 1 is verified,
for check 2 in "hoja_de_google" example code where i can check this point?

thanks.
 

fernando1987

Active Member
Licensed User
hi,
check 1 is verified,
for check 2 in "hoja_de_google" example code where i can check this point?

thanks.
  1. Go to the Google Cloud Console.
  2. Navigate to the Credentials section.
  3. Select the key or credential you created for your application.
  4. At the bottom, in the advanced settings, you’ll find an option called Custom URI Scheme.
For it to work properly with B4A, this custom URI scheme must be enabled, even though Google mentions that it’s not recommended. Without this configuration, the integration may fail.
 
Top