{"id":102,"date":"2007-01-18T22:11:51","date_gmt":"2007-01-18T22:11:51","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=102"},"modified":"2007-01-19T09:54:21","modified_gmt":"2007-01-19T09:54:21","slug":"making-the-interface-that-works-best-for-you","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=102","title":{"rendered":"Making the interface that works best for you"},"content":{"rendered":"<p>I&#8217;ve mentioned several times before how easy Visual Studio makes it to knock up mobile applications. This is one of my favourite aspects of Windows Mobile. Why put up with an interface that doesn&#8217;t work for you? If you&#8217;ve got a spare hour, make a customized interface that gets your phone to work in way that suits you better. You can create a new interface (a &#8216;form&#8217;) without knowing any code &#8211; just drag-and-drop to put buttons, pictures and text where you want them. Then fill in the empty methods to get the buttons to do stuff &#8211; most of the core applications expose an API that let you drive them from your own forms. <\/p>\n<p>In this post, I&#8217;ll go through an example &#8211; what I didn&#8217;t like about the WM interface, why it didn&#8217;t work well for me, and how I hacked together a new interface this evening. <\/p>\n<p><!--more-->I use <a href=\"http:\/\/www.garishkernels.net\/egress.shtml\" title=\"Egress\" target=\"_blank\">Egress<\/a> as a <a title=\"wikipedia ref\" target=\"_blank\" href=\"http:\/\/en.wikipedia.org\/wiki\/Podcast\">podcast<\/a> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Aggregator\" title=\"wikipedia ref\" target=\"_blank\">aggregator<\/a> on <a href=\"http:\/\/www.europe.htc.com\/products\/qtek9000.html\" title=\"HTC Universal\" target=\"_blank\">my phone<\/a>. It downloads podcasts overnight (using my home wifi) direct to my phone, which I listen to in the car.<\/p>\n<p>The way that I can start them playing &#8211; while driving &#8211; is frustrating, so this is what I tackled tonight. The problem is that the mobile Media Player doesn&#8217;t have a file-browse ability to find these newly added mp3 files, and files not synced from desktop Media Player don&#8217;t get added to the Library. So you have to launch them from the File Explorer. This involves:<\/p>\n<table border=\"0\">\n<tr>\n<td>1. Click on the start menu <br \/> <img decoding=\"async\" src=\"post-images\/070118-manual_1.gif\" alt=\"1. click on the start menu\" \/><\/td>\n<td>2. Start the File Explorer <br \/> <img decoding=\"async\" src=\"post-images\/070118-manual_2.gif\" alt=\"2. start file explorer\" \/><\/td>\n<\/tr>\n<tr>\n<td>3. Go up to the root folder <br \/> <img decoding=\"async\" src=\"post-images\/070118-manual_3.gif\" alt=\"3. go up one folder\" \/><\/td>\n<td>4. Open the Storage Card folder <br \/> <img decoding=\"async\" src=\"post-images\/070118-manual_4.gif\" alt=\"4. go into the podcasts folder\" \/><\/td>\n<\/tr>\n<tr>\n<td>5. Go into the Podcasts folder <br \/> <img decoding=\"async\" src=\"post-images\/070118-manual_5.gif\" alt=\"5. go into a directory for a podcast\" \/><\/td>\n<td>6. Go into a directory for one of the podcasts <br \/> <img decoding=\"async\" src=\"post-images\/070118-manual_6.gif\" alt=\"6. click on one of the podcasts\" \/><\/td>\n<\/tr>\n<tr>\n<td>7. Click on one of the podcasts and away you go! <br \/> <img decoding=\"async\" src=\"post-images\/070118-manual_7.gif\" alt=\"7. a podcast playing\" \/><\/td>\n<\/tr>\n<\/table>\n<p>A bit of a pain. Especially when driving. The controls to navigate the File Explorer (while fine in most other circumstances) are small and fiddly. And with some of the podcasts being quite short (like the daily <a href=\"http:\/\/news.com.com\/News.com+daily+podcast\/2030-11424_3-5845846.html\" title=\"CNET news podcast\" target=\"_blank\">CNET News podcast<\/a> which is typically 5 &#8211; 10 minutes long), this means you have to do this again 10 minutes into your car journey! <\/p>\n<p><img decoding=\"async\" src=\"post-images\/070118-podcast_launcher.gif\" hspace=\"10\" alt=\"podcastlauncher screenshot\" align=\"right\"\/> So, I decided to put together something more appropriate for my needs. A simple interface to launch the different podcasts &#8211; with buttons big enough I can quickly jab them with a finger. <\/p>\n<p>Created in Visual Studio, the code essentially wrote itself. The whole thing took about half-an-hour (most of which was spent finding images to <strike>steal<\/strike> borrow for the buttons!). I drag &#8211; and &#8211; dropped the images to where I wanted them, then double-clicked on each one to create a method to be called when they are clicked on. I then filled each in those methods with a call to my launchPlaylist method.<\/p>\n<p>The code looks like this:<br clear=\"all\"\/><\/p>\n<pre><code>private void launchPlaylist(String path)\r\n{\r\n    ProcessStartInfo mediaPlayer \r\n        = new ProcessStartInfo(\"wmplayer.exe\", \r\n                               \"\\\"\" + path + \"\\\"\");\r\n    Process.Start(mediaPlayer);\r\n}\r\n\r\n\/* one of these methods (below) for each button *\/\r\nprivate void btnCNET_Click(object sender, EventArgs e)\r\n{\r\n    \/* where CNET is a string containing the playlist path *\/\r\n    launchPlaylist(CNET);\r\n}<\/code><\/pre>\n<p>This starts Windows Media Player to play the selected podcast. Media Player, being the most recently started application, then fills the screen. (The ability to launch minimised applications, although possible in .NET, is not included in the .NET Compact Framework you get on Windows Mobile).<\/p>\n<p>I did consider playing the mp3s within my launcher application itself, without using Media Player. This can be done like this:<\/p>\n<pre><code>\/* need to add a reference to the media player dll in Visual Studio *\/\r\nWMPLib.WindowsMediaPlayer wmplayer = new WMPLib.WindowsMediaPlayer();\r\nwmplayer.URL = CNET;\r\nwmplayer.settings.volume = 100;\r\nwmplayer.controls.play();<\/code><\/pre>\n<p>I decided against this because I like the controls (pause, volume control etc.) that I get with the full Media Player (especially with the <a href=\"http:\/\/www.microsoft.com\/korea\/windowsmobile\/_assets\/images\/downloads\/voicecommand\/New-VC-Media-Skin.gif\" target=\"_blank\">Voice Command skin<\/a> I use), and saw no point in re-implementing them in my launcher. If nothing else, it would&#8217;ve taken up space I&#8217;d rather use making my buttons as big as possible. Once a podcast has finished I can close the Media Player easily enough, returning me back to the launcher to start another. <\/p>\n<p>And that&#8217;s it. <\/p>\n<p>I&#8217;m not claiming that the Windows Mobile interface is bad, or that my approach is better &#8211; that&#8217;s not the point that I&#8217;m trying to make. The point is that it&#8217;s better for my needs. And if, after trying it on the way to work tomorrow I find that it&#8217;s not quite right, I can change it until it is. This is very cool &#8211; I can tweak and hack my phone until it is the device I want. <\/p>\n<p>I realise that I&#8217;m not a typical user, and that most people aren&#8217;t going to want to do this. Even so, I hope that Apple does change their mind about allowing developers access to the <a href=\"http:\/\/www.apple.com\/iphone\/\" title=\"iPhone\" target=\"_blank\">iPhone<\/a> as this (and the price!) is probably the bit that disappointed me most in the iPhone release blurb. <\/p>\n<p>In fact, far from locking it down, we should be making it easier for consumers to do this. Isn&#8217;t customizability and personalisation still supposed to be an &#8216;in&#8217; thing? Why not at least make interfaces that are easy to skin? Or are different coloured covers as good as it gets? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve mentioned several times before how easy Visual Studio makes it to knock up mobile applications. This is one of my favourite aspects of Windows Mobile. Why put up with an interface that doesn&#8217;t work for you? If you&#8217;ve got a spare hour, make a customized interface that gets your phone to work in way [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/102\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}