Posts Tagged ‘windows mobile’

Writing a Bluetooth-based location-based reminder app

Sunday, May 25th, 2008

My bad back means that I’ve not spent too much time writing code for the past week or two. Tonight, I’m in the mood to try and hack something together.

I should probably try and do some work on my CurrentCost setup – now that I’ve got the new home server connected to the CurrentCost meter, I could write a script to start collecting data and do something with it.

But that can wait for another night – for tonight, I want to get back to doing something mobile.

One idea that I’ve had kicking around since last month is a location-based reminder app based around people – using Bluetooth as a way to know who is near you.

The idea was to have an application which lets you assign tasks in your Tasks list to Bluetooth device IDs for mobile phones and laptops. Then, when your phone sees that Bluetooth Device, it could remind you about that task.

For example, I could know that I want to talk to Will about a particular project. I can put this in my To Do list, but unless I’m actually looking at my To Do list when Will is around, it’s not very helpful.

But with this app, I set my To Do list to remind me to talk to him about it the next time I am near him – the next time his phone and/or laptop is within Bluetooth range, my mobile can prompt me with an alarm.

(more…)

Programmatically making an Internet connection in Windows Mobile in C++

Tuesday, April 29th, 2008

Although a lot of people seem to be finding my Twitter widget for Windows Mobile useful, it seems that there are also a few people who noticed that it was hacked together in a few hours overnight!

One of the more noticed issues was the fact that the widget reused the mobile’s existing Internet connection.

It was described in emails such as:

Some times I have to invoke a data session with PIE or another networked app before it will let me send a twit. Anyway to make it start it’s own network session if one doesn’t already exist?

and in tweets such as

ooh i'm liking cetwit. But not you, twittoday

oh and a side note to data apps everywhere: if you want a connection, REQUEST IT YOURSELF. I have better things to do than holding your hand

The issue is that when you use the web services APIs, this is all handled for you. But I rolled my own HTTP POST code using the wininet API. And these low-level calls aren’t so helpful.

It wasn’t a problem for me, because my phone is always connected anyway. But enough people have mentioned it, so I figured it was worth looking into!

If anyone is interested in how you start a connection programmatically in C++, read on.

(more…)

But, I like transcoding!

Sunday, April 20th, 2008

screenshot - Image Hosted by ImageShack.usMobile transcoding – services which turn a webpage into something better suited for a mobile web browser – is an often contentious topic. It’s a topic which has come up several times recently, and at best people will begrudgingly describe it as a necessary temporary evil.

Don’t get me wrong – it hasn’t been without problems. It has been used in inappropriate ways, and I know web-developers whose sites have been broken by poor (and inflicted!) uses of mobile transcoding.

But as a practical, day-to-day tool – I kinda like it.

I started using Google’s transcoder (GWT) because when you use the mobile version of Google’s RSS reader, any links you click on are transcoded by GWT for you. And I find it very useful.

It creates efficient pages which render well in Pocket Internet Explorer. Plus it stops my phone trying to download some ridiculously large webpages over GPRS (argh… curse web-developers who have 1MB webpages on the front of your sites!).

It also adds a link to any RSS feeds it finds in a page at the top – clicking on which will take you to the feed in Google Reader (my RSS reader of choice at the moment), from where you can subscribe to the feed. (Slightly roundabout, but the only way I know to subscribe to new feeds from Google Reader Mobile).

I like.

But it’s a bit of a faff getting a page transcoded by GWT if you aren’t already given a link to a transcoded page. So (in the tiny window between tonight’s screaming fits… gah – when will the baby start sleeping through the night?!) I added a new tool to my set of Pocket Internet Explorer (PIE) extensions: one that will re-open the current page using Google mobile transcoder.

(more…)

Mobile translation – an unfinished hack!

Saturday, April 5th, 2008

Fourth of the random ideas for Over The Air hacks – a mobile service that lets you translate foreign text that you come across from your mobile phone.

The plan was to:

  • reuse some old code from last year to control my cameraphone and take a picture
  • upload the image to LeadTools, using their OCR web service to get the text back from the picture
  • translate the text into English using the Google translate API web service
  • display the English text on the phone screen

Unfortunately, too much time spent drinking beer, listening to talks, and generally slacking, meant that I didn’t finish this one.

But I thought it still might be interesting to share my experiences with the LeadTools service.

(more…)

Browser syncing – mobile to desktop

Saturday, April 5th, 2008

Completing the loop for my browser sync hack for Over The Air – this time, syncing back the browser history from your mobile browser when you get back to your desktop computer.

When you connect your mobile to your computer, the URL history of Pocket Internet Explorer is queried and the most recent item is opened on the desktop using your default web browser.

This was a little tricky to implement and needed me to cobble a few bits and pieces together:

  • A C# service running on the desktop that uses RAPIManager to trap and handle device connection events
    On connection, the service uses RAPI to invoke a process on the mobile…
  • The process on the mobile is something that I wrote in C++ to query the PIE cache – using the FindFirstUrlCacheEntry / FindNextUrlCacheEntry API. The URL retrieved is written to a file on the mobile.
  • The C# service on the desktop transfers the file containing the URL from the mobile, and uses Process.Start to launch it in the desktop’s default web browser

It’s a little icky… but it seems to work!

Browser syncing – desktop to mobile

Saturday, April 5th, 2008

Third of the random ideas for Over The Air hacks – a browser sync for Windows Mobile.

The aim was to let you transfer your browser history from desktop to a Windows Mobile PDA, so when you leave your desk, you can pick up where you left off in whatever you were doing online.

I’ve written the hack as a Firefox extension, and it currently has two modes:

  • Always on
    Every web page you view in Firefox gets opened on the mobile browser in the background without you noticing. When you disconnect your mobile from the computer, you not only have the most recent page all ready for you in your mobile browser, but you also have a mirror of the Firefox history – so clicking ‘Back’ on your mobile browser will take you back to the previous page you were viewing with desktop Firefox.
  • Single sync
    Take the current page you are viewing in Firefox, and open it on your mobile browser

The toggle to start/stop the ‘always on’ mode, and the switch to perform a single sync are both provided as toolbar buttons.

Install the Firefox extension here

(more…)

Data Capture widget for Windows Mobile

Friday, April 4th, 2008

Second of the random ideas for Over The Air hacks – a Data Capture widget for Windows Mobile.

Data Capture widget for Windows MobileScribble a note or capture an idea without waiting for a second or two for an app to be launched!

Enter some text in the box, then tap OK. The text will be appended to a file or Note (of your choice – specify the path it should write to in ‘Options’).

If you tap on the icon, the notes app (of your choice – again, specifying the path to it in ‘Options’) will be launched to the page the widget writes to.

Create an “incoming” or “to be sorted” note or page, and add to it throughout the day. When you’re ready, launch the notes app and go through and process what you’ve collected.

Very GTD. 🙂

It’s a lightweight C++ app, reusing a lot of the code from the Twitter client I posted about earlier.

Download a copy here
To specify paths, go to the Options dialog for “bLADE Wiki Today” from the Today screen control panel applet.

Twitter for Windows Mobile

Friday, April 4th, 2008

First of the random ideas for Over The Air hacks – a Twitter client for Windows Mobile.

Twitter client for Windows MobileWhen posting a tweet, the key is speed. I don’t want to wait to launch an app, I don’t want lots of features. I just want something to take my message and post it.

When reading tweets, I don’t mind waiting (e.g. for the list to be gathered).

And on mobile, I don’t really want regular notifications or polling. Following over a hundred people, I’d either hose my phone battery by constantly getting updates, or I’d miss most updates anyway. I just need to be able to see a list of updates when I want.

I went for a Today screen widget for posting, written in C++ to keep it quick and lightweight.
And if you click on the twitter logo, it launches your default browser at the mobile Twitter site http://m.twitter.com/. The best of both worlds 🙂

Download a copy here
To set your username and password, go to the Options dialog for “Twit Today” from the Today screen control panel applet.

(more…)