Tuesday, June 25, 2013

Google+ and dot42

The Google+ platform for Android lets you authenticate a user with the same credentials they use on Google every day. Once a user signs in with Google, you can create more engaging experiences and drive usage of your app.

Download sample from GitHub.

Create a new Google+ project

It is assumed that you have dot42 with either Visual Studio 2010/2012 Pro or SharpDevelop installed.

If you create a new project and want to add Google Play Services to your project, you can do this by checking the library in the New Project wizard:


You will notice that when you check Google Play Services then Android Support Library will be checked automatically because it is required.

After hitting OK, you will be asked to accept the Android SDK License agreement:


After hitting I agree, your new project is created. If you expand the Reference node in the Solution Explorer, you will see that references to both dot42.AndroidSupportLibrary.dll and dot42.GooglePlayServices.dll have been added:



Register your app in the Google APIs Console

Before you can run your app on a physical device, you need to register your app in the Google APIs Console as follows:

(the following is partly copied from https://developers.google.com/+/mobile/android/getting-started, Step 1. but modifed for dot42)

1. In the Google APIs Console, create an API project for your application.

2. In the Services pane, enable the Google+ API and any other APIs that your app requires.

3. In the API Access pane, create an OAuth 2.0 client ID by clicking Create an OAuth 2.0 Client ID:

a. Type a product name in the dialog box that displays, and click Next. Providing a product logo and home page URL are optional.

b. Choose Installed application as your Application type and select Android as type.

c. In the Package name field, enter your Android's app's package name. You can find this on the Android tab of your Visual Studio project properties dialog.


d. Make sure the Output view is visible and compile the project. Copy the SHA1 fingerprint from the output view:


e. Paste the SHA-1 fingerprint into the Signing certificate fingerprint field.

f. To activate interactive posts, enable the Deep Linking option.

g. Click the Create client ID button.

Google+ Sample

The Google Play services package includes the Google+ sample located in <android-sdk>/extras/google-play-services/samples/plus. We have taken this sample, ported it to C# and made it run as a dot42 app. View it on GitHub.




No comments:

Post a Comment