Archive for January, 2011

28
Jan
2011

Birdsong Quick Tip: Status Bar Icons

by Cain Ullah

The status bar in Birdsong provides you with an ‘at a glance’ view of the status of your timelines. To make the ‘at a glance’ status more intuitive it relies on iconography so following on from David’s Tweet Property Icons blog earlier today – this is a very brief blog explaining the icons used in the status bar.

Timeline Icons

Status Bar

Each timeline will have an icon associated to it to identify the timeline type. A brief description of each is below:

Friend Home – This timeline will include tweets for everyone you follow

Mention Mentions – Every tweet in which your tweet screen name is mentioned will appear in this timeline

DirectMessage Messages – Contains Direct Message conversations between yourself and other people who follow you

List List – Any saved list that you have specifically added in the timeline configuration will have this icon associated to it. If you have multiple lists configured they icon will be the same for them all.

Search Search – This is again a specifically configured timeline. This may be a saved search or a new search but both will be identified with this icon.

Download Status

When Birdsong is attempting to download your latest tweets, status indicators appear next to the timeline icons.

Status Bar - Downloadinggentleface.com free icon set Updating – When a timeline is being updated, this indicator will appear next to the icon for that timeline. This will only appear on one timeline at a time. In the image to the right the list timeline is currently being updated.

Status Bar - No Connectiongentleface.com free icon set Update failed – If Birdsong experiences a problem whilst updating one of your timelines a sad face icon will appear next to the relevant timeline icon. This is most commonly caused when Birdsong can’t access the internet.

These icons will remain there until the next successful download.

So, as I said, a very brief blog but hopefully this will be of some help to some of you.

Follow us at @redbadgerteam and don’t forget to feedback with any new enhancement requests and vote on existing ones. We will be prioritising our development according to user demand.

Get Birdsong Now!

 

28
Jan
2011

Birdsong Quick Tip: Tweet Property Icons

by David Wynne

One of our favourite features of Birdsong is the Tweet Property Icons – they appear to the bottom right of tweets in your timeline and quickly let you know what lies within.  Here’s a quick run-down of what they look like and what they mean.

ConversationConversation

If you see the conversation icon, it indicates that the tweet was “in reply to” someone and you’ll be able to tap through to the conversation and see every response in context.

 

 

 

PicturePicture

Birdsong’s integrated picture viewer recognises and integrates with all the major picture services (twitpic, yfrog, flickr, plixi and moby).  If you see the picture icon, you’ll get a thumbnail of the picture which you can tap on to view in full screen.

 

PlacePlace

We integrate with Bing Maps, so if your friends geo-tag their tweets you’ll get a thumbnail map of their location and be able to tap through to a full interactive Bing Map.

 

 

FavoriteFavourite

If you’ve earmarked a tweet as a favourite, you’ll see the star tweet property icon in your timeline.

 

 

 

ProtectedProtected

Some of your friends may choose to limit who can see their tweets and protect their account – if you’re one of the special ones,  you can feel even more special with this delightful padlock icon.

 

Follow us at @redbadgerteam to pick up on more quick tips!

Download Birdsong from Zune Now!

25
Jan
2011

Birdsong – A new Twitter client for Windows Phone 7

by Cain Ullah

ApplicationIcon1Red Badger are pleased to announce the release of Birdsong for Windows Phone 7, a premium Twitter application.  Birdsong provides a native, performant and functionally rich experience throughout.  Its innovative design has features such as infinite scrolling and off-line viewing that are powered by a custom document database.

Version 1 has shipped with a hatful of cool functionality and there’s lots more to come (version 1.1 is in development already).

We’ll be posting a number of blogs and videos demonstrating Birdsong’s functionality over the next few days and weeks; but for now, here is an overview of some of the key features.

Configurable Timelines

Timelines on the home screen are configurable. You can add lists, saved searches and new searches as well as changing the order in which the timelines appear.

01 - Configure Timelines 101 - Configure Timelines 201 - Configure Timelines 3

Integrated Picture Viewing

Tweets with pictures in your timeline are easy to spot using the tweet property icons.  An integrated image viewer then allows you to view the pictures in thumbnail and full-screen mode.

03 - Pictures 103 - Pictures 203 - Pictures 303 - Pictures 4

Threaded Conversations

Conversations are flagged with a tweet property icon.  Threaded conversations allow you to view an entire conversation in context.

04 Threaded Conversations 104 Threaded Conversations 204 Threaded Conversations 3

Direct Message Threading

Birdsong’s direct messages are organised like an email inbox.  All direct messages between you and your friends are automatically threaded.

05 - Direct Messages05 - Direct Messages 2

Places

Geo-tagged tweets are marked with a tweet property icon in your timeline.  Birdsong supports map previews and Bing Maps integration.

07 Places 107 Places 207 Places 3

TwitPic Integration

Share existing or new photos using the fast TwitPic integration.

08 TwitPic Integration 108 TwitPic Integration 208 TwitPic Integration 3

Integrated Web Browser

Using the integrated browser you can view web links without leaving Birdsong – there’s no need to launch Internet Explorer (although you can).

09 Integrated Web Browser 109 Integrated Web Browser 2

Status Bar

The status bar shows your configured timelines, which one you are currently viewing, your unread counts and each timeline’s update status.

10 Status Bar

Profiles

You can explore anyone’s profile, their timeline, friends, followers and favourites.

11 - Profile 111 - Profile 2

Integrated Theme

Birdsong will automatically inherit your theme settings, honouring your choice of background and accent colour.

12 - Theme 112 - Theme 2

Birdsong is available now in the Windows Phone Marketplace and has a (more or less) fully featured trial.

Don’t forget – version 1.1 is on its way, with even more functionality, but in the mean time if there is anything you want adding please let us know.

Get Birdsong Now!

22
Jan
2011

Windows Phone 7 Analytics with Mixpanel

by David Wynne

Having tried out the Microsoft’s WP7 analytics partner solution, PreEmptive, I was left underwhelmed by the tooling, UI and speed of reporting.  I like Google Analytics, but getting that working looked like a fair bit of inventive hackery and involves referencing the Silverlight Analytics Framework and who needs “yet another dll”™ in their app?  I’d also heard a few reports that the Google Analytics approach was pretty slow.  So inspired by Nick Gravelyn I thought I’d give Mixpanel a shot.

The beauty of the Mixpanel’s RESTful API is in its simplicity – there’s one method and practically everything you need to know about it is contained on this one page.  Each call logs an event and each event can have a collection of properties.  For example we log a “launch” event when our application starts up with the following properties: istrial, version, locale.  You don’t have to predefine any events or properties – just send them.

When you send an event, there are 2 properties you’re always going to need: token and distinct_id.  Token is the token Mixpanel generates for you when you create a project on their site and distinct_id is an arbitrary string you provide to define what makes a user unique.  On Windows Phone it makes sense to use the DeviceUniqueId from DeviceExtendedProperties.  This is returned as a byte array, so you’ll need to Base64 encode it to use as the distinct_id.

Finally Mixpanel wants your event object serialized into JSON (for which we can use Json.Net) and then Base64 encoded into a string.

Our TrackingEvent class inherits from Dictionary<string, object> to embody the name-value-pair nature of an event’s properties and encapsulates all of the serializing and encoding behaviour into a GetData method.  It looks a little something like this:

public class TrackingEvent : Dictionary<string, object>
{
    private const string DistinctIdProperty = "distinct_id";

    // TODO: Your Mixpanel token goes here
    private const string MixpanelToken = "";

    private const string TokenProperty = "token";

    private readonly string eventName;

    public TrackingEvent(string eventName)
    {
        this.eventName = eventName;
    }

    public string GetData()
    {
        if (!this.ContainsKey(TokenProperty))
        {
            this.Add(TokenProperty, MixpanelToken);
        }

        if (!this.ContainsKey(DistinctIdProperty))
        {
            this.Add(DistinctIdProperty, GetDeviceUniqueId());
        }

        JProperty[] properties =
            this.Select(keyValuePair => new JProperty(keyValuePair.Key, keyValuePair.Value.ToString())).ToArray();

        var json = new JObject(
            new JProperty("event", this.eventName), new JProperty("properties", new JObject(properties)));

        return Convert.ToBase64String(Encoding.UTF8.GetBytes(json.ToString()));
    }

    private static string GetDeviceUniqueId()
    {
        object deviceUniqueId;
        return DeviceExtendedProperties.TryGetValue("DeviceUniqueId", out deviceUniqueId)
                   ? Convert.ToBase64String((byte[])deviceUniqueId)
                   : "anon";
    }
}

Next we need to actually send the HTTP request – for this we use the always excellent Reactive Extensions (Rx) which means we can easily make the call asynchronously using the thread pool and process the response in a terse and elegant manner.

For the purpose of this example, we’ll demonstrate this via a static Track() method and then explain what’s happening:

public static class Analytics
{
    public static void Track(TrackingEvent trackingEvent)
    {
        var uriBuilder = new UriBuilder("http://api.mixpanel.com/track")
            {
               Query = string.Format(CultureInfo.InvariantCulture, "data={0}", trackingEvent.GetData()) 
            };

        WebRequest webRequest = WebRequest.Create(uriBuilder.Uri);

        Observable.FromAsyncPattern<WebResponse>
            (webRequest.BeginGetResponse, webRequest.EndGetResponse)()
                .SubscribeOn(Scheduler.ThreadPool)
                .Select(GetResponse)
                .Subscribe(
                    response => Debug.WriteLine("Response: {0}", response), 
                    exception => Debug.WriteLine("Error: {0}", exception.Message));
    }

    private static string GetResponse(WebResponse webResponse)
    {
        if (webResponse.ContentLength > 0)
        {
            using (var streamReader = new StreamReader(webResponse.GetResponseStream()))
            {
                return streamReader.ReadToEnd();
            }
        }

        return string.Empty;
    }
}

If  you’re not familiar with Rx the FromAsyncPattern call might look a bit daunting, but it’s incredibly elegant.  It wraps the asynchronous Begin/End pattern and produces an IObservable which you can subscribe to.  Because it’s an IObservable we can instruct Rx to execute the subscription on the thread pool.  Next we use a Select to project the WebResponse returned into a string via the GetResponse() method and then subscribe to the result.

Mixpanel simply returns a 1 or a 0 to tell you whether your request was logged, so day-to-day you don’t really care about the response, but during development it’s handy to see what’s coming back.  It’s worth noting that in my discussions with Mixpanel the 1 or 0 is really just an indication of whether they managed to deserialize your JSON (at time of writing), so it’s possible you could get a 1 back but still not get data logged because you forgot to set your token property.  Luckily Mixpanel stats are “real time” – so it’s easy to check that you’re data’s getting through.

Finally we just make a call to our Track method in our codebase whenever we want to track an event:

Analytics.Track(
    new TrackingEvent("launch")
        {
            { "istrial", new LicenseInformation().IsTrial() },
            { "locale", Thread.CurrentThread.CurrentUICulture.Name },
        });

Be aware that some values you might want to track, such as IsTrial, have overhead to obtain and should ideally be done once per session and stored, but you get the idea.  It’s probably also worth thinking about disabling tracking when you’re in debug/developing to save wasting data points or skewing your production figures.

It’s early days with Mixpanel, but so far we’re liking what we see.  If you’re planning to try Mixpanel and found this useful then feel free to signup via this referral link and we’ll both get an extra 5,000 data points and this delightful carriage clock… http://mixpanel.com/user/register/700134331/ (clock not included).