Monday, May 9, 2011
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
ContactsContractAPI 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.
QuickContactBadgesto 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
ContactsContractframework will automatically merge contacts, adding a very handy feature to our app without us having to do anything!
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