Android Tutorial OAuth 2.0 / Google web services tutorial

adastra

Member
Licensed User
Longtime User
hi erel
i am having problem to get contact list.
showing error, sending you log

** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (act_gmail) Create, isFirst = true **
** Activity (act_gmail) Resume **
Starting Job: GetAccessToken
** Service (httputilsservice) Create **
** Service (httputilsservice) Start **
Error. Url=https://accounts.google.com/o/oauth2/token Message=Unauthorized
{
"error" : "invalid_client"
}
** Service (httputilsservice) Destroy **
 

Sergio Martinez

New Member
Licensed User
Hi , I tried to run the gmailcontacts example and I have the following error.
B4A version: 5.80
Parsing code. (0.01s)
Compiling code. (0.21s)
Compiling layouts code. (0.00s)
Generating R file. (0.04s)
Compiling debugger engine code. (0.80s)
Compiling generated Java code. Error
B4A line: 24
If init = False Then Process_Globals
javac 1.8.0_77
src\anywheresoftware\b4a\samples\gmailcontacts\httputilsservice.java:332: error: cannot find symbol
_process_globals();};
^
symbol: method _process_globals()
location: class httputilsservice

What should I do?
Thank you so much.
 

Attachments

  • Untitled.jpg
    51.7 KB · Views: 297
Last edited:

tpakis

Active Member
Licensed User
Longtime User
If you want to use this example with b4j in the google developer console make a new project of type "other" not android
 

tpakis

Active Member
Licensed User
Longtime User
In the project with the contacts, there is a comment in the getaccesstoken section about storing the refresh token. Is there any example on how to use it?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

tpakis

Active Member
Licensed User
Longtime User
I did the switch, i used this tutorial as a base for a B4J app. The link is very useful i couldn't find that info (and i really searched google's documentation). It's needed because the access tokens are very short lived only 1hour(!!!!) and i wouldn't like the user to go through the whole process every time he uses the app.
 

dbalman

Member
Licensed User
Longtime User

Same here. However, I am unable to retrieve the data from the custom fields of individual contacts. The name, gContact:userDefinedField, is returned, but the key and value are not. https://developers.google.com/google-apps/contacts/v3/reference#gcUserDefinedField

OAuth2.0 Playground returns the key and value, so perhaps it is an issue with the jXMLSax library? It appears that any field that is not tagged at both ends is ignored, e.g.,
<gd:fullName>Forrest Gump</gd:fullName> is displayed as expected while <gContact:birthday when="1993-12-25"/> is not.

B4X:
<gContact:userDefinedField key="Ticket#" value="6789GTX1B"/>
<gContact:userDefinedField key="Client ID" value="987654321"/>
<gContact:userDefinedField key="DR#" value="16-078912"/>
<gContact:userDefinedField key="Case#" value="12-23456789"/>
<gContact:userDefinedField key="SS#" value="123-45-6789"/>
<gContact:userDefinedField key="Docket#" value="987456321"/>
<gContact:userDefinedField key="File#" value="8675309"/>
<gContact:userDefinedField key="Court Name" value="Hershey Town Court"/>
<gContact:userDefinedField key="Violation " value="VTL 1180D"/>
<gContact:userDefinedField key="Judge Name" value="Judge J. Executioner"/>
In any case, can anyone think of a workaround that would allow me to get the key and its value without manually parsing the XML file?
 
Last edited:

Similar Threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…