Here is an example for retrieving Google Tasks using OAuth2.
The Sample code is taken from Google, but I changed some stuff since it was not working our of the box.
The most important change was setting the API_KEY:
static final String API_KEY = "AIzaSyCDQ6fgBkku5Hiz_Vta09jIXVs-JHWpUYc";
Currently you can use my API_KEY, but if you build your own application, make sure you generate your own API_KEY.
To do this
- Go to the API Console
- Create a new project,
- Set the status of the Tasks API to On.
- Click on the API Access on the Left.
- Copy you API key (Under Simple API Access).
Here is the Android installation file: