Posts Tagged ‘android’

Why I haven’t written TwitToday for Android

Thursday, February 25th, 2010

(or “looking at the limitations of the Android home screen widgets framework”)

Twitter client for Windows MobileA couple of years ago, I wrote a Windows Mobile app called TwitToday : a Twitter widget for the “Today screen” (the default screen when the phone is on, with all apps closed or minimised).

The rationale was that it was useful to have a way to post a tweet quickly when you don’t want to have to wait for a full-blown client to start.

Or if you don’t want to incur the battery or memory cost of leaving a client running all the time.


A widget that doesn't work on AndroidAndroid has a “Home screen”, which is similar to the Today screen on Windows Mobile. And it has support for widgets. This led several people to ask me why I never ported TwitToday to Android.

The short answer is that I did try, but the current state of the widgets framework made it impossible.

I tried to write a TwitToday widget back when the Android widgets framework was first introduced in Android 1.5.

It all started quite well:

  1. I wrote the Android Service that would carry out the background task of posting a tweet. No problems there – it worked fine.
  2. I wrote the widget XML to define the GUI. This is what you can see running in the screenshot. And it works… sort of. It has a text box that you can type up to 140 characters into. And if you press the button, it causes a chunk of code to get invoked.

The problem came when I tried to link the two together: to get the Service that posts tweets to obtain the String from the text box in my widget.

This isn’t possible. Android’s widget framework as it currently stands is geared around displaying information to the user, not collecting user input.

(more…)

Using my mobile as a TV remote control for vdr

Monday, February 22nd, 2010

remote controlsI can never find the TV remote.

Whether it’s slipped somewhere in or under the sofa, or been hidden by the kids, I’m often at a loss to find it.

A mobile phone, on the other hand, is rarely too far from my hand 🙂

So I’ve hacked together a quick app to put a TV remote control interface on my phone. It’s definitely a quick-and-dirty chunk of code, but it does now mean that I can work my TV from my mobile if I can’t find the real remote.

On the off-chance that this is useful to other vdr users, I wanted to share how I did it.

(more…)

Your data. Mobile. (a hackday hack)

Thursday, November 12th, 2009

screenshot stored on PhotobucketWhat do the following have in common?

Weather Channel Max – an iPhone weather app. StockWatch – an iPhone stock prices app. CNN Mobile – an iPhone news app. FlightTrack – an iPhone flight updates app. Tweetie – an iPhone twitter app.

They are all apps which provide users with updates to their phone when some information changes. The information in question is different. But they’re all ways for users to get information that they are interested in, while they are on the move.

Having a dedicated hard-coded app for each type of data is great for information that a large number of people are interested in.

For example, there are enough people who are interested in the weather that it’s worth having an app dedicated to it.

But what if you want updates for information that isn’t so widely needed? What about niche interests?

We’re all different. There is going to be something that you’re interested in that not everyone else is. Or at least a particular set of interests that noone else exactly shares.

People’s needs and interests are almost infinitely varied, so we can’t come up with enough applications to meet everyone’s unique needs. Particularly for more esoteric topics, which are too long tail to each justify a specific mobile app.

For these situations, we need something generic that individual users can customise.

This was an idea I played with on the last IBM HackDay. I managed to get a proof-of-concept working on the day, but not had the chance to share it before now.

What I tried to create was:

  • a generic mobile application – something that can display an arbitrary number of bits of information
  • a browser extension approach – some way that a user can pick any bit of any webpage, adding it to their list of information that will be pushed to their mobile

I’ve recorded a video of it running. (Difficult to see without full-screen – sorry!)

To summarise, the steps involved are:

  1. User visits a webpage at their computer
  2. User highlights a portion of the page, and uses a Firefox extension to register this with my notifications server
  3. The notifications server informs the mobile app of the new topic of interest
  4. The notifications server continues to monitor the webpage
  5. When the highlighted portion of the webpage changes, the updated contents are pushed to the phone
  6. The mobile app notifies the user of the change

(more…)

Augmented reality for Hursley

Friday, November 6th, 2009

screenshot : click for better resolution imageOne of the themes at openMIC this week was augmented reality, and a topic that came up a couple of times was Layar.

Layar is a mobile app for Android and iPhone that lets you display location-based information overlaid on a real-time camera view.

For example, the screen normally shows a viewfinder-like view from your mobile’s camera.

Search for “coffee” and a bunch of markers appear on the view, showing you where the nearest coffee shops are.

As you move the phone around, the markers follow the approximate location of the places they are showing you.

That’s assuming you want to search ‘Google Local’, but that’s not the only option. Location data is provided through “layars”, and there are layars available for location-tagged Wikipedia articles, Flickr photos, brightkite users, and more.

The interesting thing talked about at openMIC was the Layar API which lets anyone create a new Layar with their own information.

So I decided to spend a quiet Friday afternoon in the office creating a Layar for around Hursley. 🙂

This means a phone with the Layar browser installed can browse and search for points of interest around the site.

It was really very easy, so I’ll quickly outline the steps involved.

(more…)

Push notifications for mobile apps

Wednesday, September 30th, 2009

Update (1 Feb 2011): I’ve shared some better sample code for Android

Last weekend, I went to Imperial College for Over The Air: a conference for mobile developers.

I gave a talk at the event on how to write a mobile application that uses push notifications. It was pretty well received, so I’d thought I’d share it here, too.

I’ve made some notes below to cover roughly what I said at the event. Any comments or questions (or corrections if you spot any!) are very welcome. 🙂

Update (24/10/2009): I revisited this presentation to address some of the feedback that I got on battery life implications of using MQTT.

(more…)

Developing for Android

Wednesday, November 26th, 2008

I wrote an admittedly gushing post a few weeks ago about my first impressions of the new “Google phone”, the Android-powered T-Mobile G1. Now that I’ve had a few weeks to play with it, I thought I’d add a comment about some frustrations with it as a developer.

None of this is to retract what I said before – I still agree with what I said before. But it’s worth adding a couple of comments.

I’ve not written any code for Android yet, but I’ve had a couple of tentative looks into how I might. And in general, it seems to be a combination of being really impressed by the theory, followed by being frustrated by the practice.

This is perhaps best described with a couple of examples.

(more…)

Android

Tuesday, November 4th, 2008

As a true early-adopting mobile geek, I was one of the people in my local T-Mobile store last week on the launch day for the new Android phone, the G1.

I’ve had a few days to play with it now, so I thought I’d share my thoughts on it so far.

If you want a considered review which discusses specific features, it’s worth checking out Engadget, Ars Technica, or CNET. Rather than duplicate proper reviews like that, I thought I’d share a less coherent post of my feelings about the device. 🙂

In short, I don’t regret buying it. I like it. But I’m not sure I’d recommend it.

I’ll try and explain why…

(more…)