Archive for November, 2010

Source code for OAuth Android sample in Github

November 19th, 2010 No comments
Source code for Implementing the OAuth flow in Android has been uploaded to Github. oauth-android-logo
Categories: Uncategorized Tags:

Handling progress dialogs and orientation changes

November 14th, 2010 16 comments
ProgressDialogs in Android are easy. At least, that was my initial thought. As long as you don’t change the screen orientation that is. Once you start moving your phone around after – or worse, during – an active progress dialog, you’ll soon find that out that your application isn’t behaving the way it should.
Luckily for us, there are several ways to tackle this.I’ve created a sample application, available on GitHub outlining the problem, and some solutions of dealing with it gracefully. The repository is located here.

Continue reading “Handling progress dialogs and orientation changes” »

Google API Console

November 12th, 2010 No comments
As announced on the Google blog, Google has released an API console for developers to track, analyze and control their application’s API usage. If offers developers a way to create projects in the console (resulting in an API key per project) and track their API usage. google apis

Continue reading “Google API Console” »

Categories: Google APIs Tags: , ,

Creating github repositories with command line

November 11th, 2010 2 comments
Just thought I’d share a small post on creating github repositories using the command line.

If you want to create a repository through the commandline (CLI), you can use the following command from the GIT bash :

github logo

Continue reading “Creating github repositories with command line” »

Implementing the OAuth flow in Android

November 10th, 2010 35 comments
In this post, I’ll be showing you how to use the OAuth signpost library in an Android application. We’ll create a simple application that fetches your Google Contacts using the Google Contacts API, and display the contact names on the screen.
We’ll focus on using the Signpost API in an Android runtime, and implementing the OAuth workflow from the first step (requesting a request token) till the final API call with our access token. We’ll glue the entire OAuth workflow together in our Android application, using different techniques offered by the Android platform. As you can see from the screenshot below, it’s not the most aesthetically pleasing application, but it gets the job done.

Continue reading “Implementing the OAuth flow in Android” »

OAuth in java – the Signpost library

November 8th, 2010 No comments
For a quick command line java example, we’ll be using the oauth-signpost library, a java library with OAuth support that can also be used in Android projects (see Implementing the OAuth flow in Android) . The sample code below illustrates how easy it is to orchestrate the OAuth workflow from a java runtime. The sample program will use a command-line approach guiding you to the oauth flow. It will basically do the following steps :

  • get a request token
  • ask you to authorize access
  • exchange the authorized token for an access token
  • retrieve your contacts

Continue reading “OAuth in java – the Signpost library” »

Hands on OAuth with the playground

November 8th, 2010 1 comment
After having an overview of OAuth, we can now get a change to watch the OAuth dance unfold before us with a great site called the OAuth Playground where we can simulate all these OAuth requests. The site allows us to see the HTTP requests behind the OAuth workflow we discussed in the previous section. For the sake of this example, try to think of the OAuth playground as a rich application where you can view your Google contacts. (Obviously, OPlayground is a technical oriented site, allowing you to see the different request on the HTTP level, but the same principles apply. oauth-playground-logo

Continue reading “Hands on OAuth with the playground” »

Google OAuth Overview

November 7th, 2010 3 comments
If you’re like me, you were probably a bit overwhelmed the first time you started looking at the Google authentication and authorization APIs. Although everything is well documented, it took me a couple days to get the full picture, and actually start some work with it.  The goal of this article is to clarify some of the principles in a condensed form, and then start with some hands on examples in Java & PHP. oauth logo
  • We’ll start with an overview of how OAuth works, using the typical example of an application accessing user data from a Google service.
  • We’ll then focus on the oauth specific parameters that are associated with each request / response
  • In a follow-up post, we’ll be looking at hte OAuth playground, and implement a OAuth workflow using standard java and an Android app.

What’s important to realize is that OAuth provides you with a standard way of letting your application act on the users behalf when connecting to third party providers like Google, Yahoo, LinkedIn, Photobucket,….

It allows your application to integrate with these providers, without forcing the user to enter his credentials (username/password) in your application. The user is assured that your application will never have to read or store the user credentials, but thanks to OAuth, your application (after being granted permission by the user) will be able to interact with these providers on his/her behalf.

Continue reading “Google OAuth Overview” »