Monday, May 09, 2011

Social features for Endomondo Sports Tracker


By Jesper Majland, Endomondo Android Developer

This post is part of Who's at Google I/O, a series of guest blog posts written by developers who are appearing in the Developer Sandbox at Google I/O.


Endomondo is a sports community focused on making exercising more fun, more social and more motivating. Android includes great APIs to support adding a social community to an existing application.

Our Android app, Endomondo Sports Tracker, uses the device’s GPS to measure distance and speed while you are doing your favorite distance-based sport. The result can be shared, commented upon and analysed online within the social Endomondo community.

Until recently, the Endomondo community has only been accessible from a desktop web browser. Now we are bringing this community to your pocket.

So far, we have implemented these three feature areas:

1. Find and connect friends.

We use the ContactsContract API to scan the device for local contacts. We then hash-encode the names and email addresses and send them to our servers to see if they match existing members of the community. The result is a list of possible friends already using Endomondo. The user can then send a friend request by clicking on the relevant person.


2. Sync with a cloud service to get updates.

Once the user has added some friends, we can add some content from our cloud service.
The Sample Sync Adaptor API was exactly what we were looking for. First, we created a new Endomondo account using the AccountManager. Our next step was to write our own synchronization manager by extending AbstractAccountAuthenticator. When the user logs in or signs up, our app automatically creates a new account. The new account can be controlled using Android’s built in “Accounts & sync settings” service.

You can find a very good “how to implement” description here: part 1, part 2.

3. Extend the app to access Contact info.

Our in-app friend list now shows a list of all friends in the community, with a short description of the latest activity and a nice profile picture for each.

We use QuickContactBadges to show friends' profile pictures and to quickly pivot to other ways to contact them; perfect for planning a run together!

When our users and their friends add new accounts, the Android ContactsContract framework will automatically merge contacts, adding a very handy feature to our app without us having to do anything!

For implementation inspirations, take a look here: QuickContactsDemo.

We’re just getting started with adding social dimensions to Endomondo. There are plenty more exciting developments in the works. One of them is the ability to send pep talk messages to friends out exercising, directly from the app. You can download our app from the Android Market and try it out for yourself.

Any input or good ideas are more than welcome. Please post your feedback in the comments.


Come see Endomondo in the Developer Sandbox at Google I/O on May 10-11.

Jesper Majland is involved with all parts of app developing from idea, design and implementation to test/release and bug fixing. In his spare time, he tries to get outside to bike, ski or go for a short run.

Posted by Scott Knaster, Editor

6 comments:

  1. Hi Jesper - Endomondo is a damm good tool, and a funny way to get social messages :-) Henrik

    ReplyDelete
  2. Running is running! But running with Endomondo is fun!

    ReplyDelete
  3. I wish it would sync with Google Health

    ReplyDelete
  4. Yes, +1 for Google Health synchronization. This would be super useful.

    ReplyDelete
  5. And share with google+ would be nice as well :)

    ReplyDelete
  6. Is there a way to make it a Gadget on a blog? I would love to be able to have it sync to my blog in the form of a gadget.

    ReplyDelete