{"id":162,"date":"2007-05-27T23:06:30","date_gmt":"2007-05-27T23:06:30","guid":{"rendered":"http:\/\/dalelane.co.uk\/blog\/?p=162"},"modified":"2007-05-27T23:33:47","modified_gmt":"2007-05-27T23:33:47","slug":"working-out-where-my-pda-space-has-gone","status":"publish","type":"post","link":"https:\/\/dalelane.co.uk\/blog\/?p=162","title":{"rendered":"Working out where my PDA space has gone"},"content":{"rendered":"<p>I <a href=\"http:\/\/dalelane.co.uk\/blog\/?p=161#comment-20124\">mentioned last week<\/a> that watching Doctor Who made for a good chance to absentmindedly play with some code. I seem to have started a new habit, so thought I&#8217;d share what I was worked on this week. \ud83d\ude42<\/p>\n<p>One of the problems with my <a href=\"http:\/\/www.europe.htc.com\/products\/qtek9000.html\" target=\"_blank\">HTC Universal<\/a> is running out of storage space when trying to install new apps. The core Windows Mobile 5 tools that you can use to work out why you&#8217;re short of space are fairly limited:<\/p>\n<ul>\n<li><strong>Search<\/strong> &#8211; listing all files on the device larger than 64KB (an odd size to choose &#8211; and without the ability to specify which folder(s) to search in, you end up with a very long list)<\/li>\n<li><strong>File Explorer<\/strong> &#8211; shows file sizes and lets you sort a folder&#8217;s contents by size (but going through each and every folder on the device manually is fairly tedious, and there is no way to get the size of a folder without adding together the size of the contents yourself)<\/li>\n<li><strong>Memory applet<\/strong> &#8211; showing you how much space available and how much in use (useful to identify that you have a space issue, but not any use in working out why)<\/li>\n<\/ul>\n<p>You often just look around and rely on trial-and-error to free up space. (Like clearing the Pocket Internet Explorer cache then finding that you have a big chunk of space freed up.)<\/p>\n<p>The aim for yesterday evening was to produce something to visualise the usage of storage space on the device.<\/p>\n<p><a href=\"post-images\/diskviewscreenshots\/diskviewB.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskviewB.jpg\"\/><\/a><\/p>\n<p>Not a terribly original idea (basically a simplified approach to drawing a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Treemap\" title=\"wikipedia reference\" target=\"_blank\">tree map<\/a>), but unless my ability to use Google is getting worse, I don&#8217;t think anything like this is available for Windows Mobile at the moment. <\/p>\n<p>I think it might be a useful little app, and it only took a bit of an evening to throw together. \ud83d\ude42<\/p>\n<p><em>If you&#8217;re curious, read more to see some screenshots and a quick description of what I did.<\/em><br \/>\n<!--more--><br \/>\n<a href=\"post-images\/diskviewscreenshots\/diskview1.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview1.jpg\"\/><\/a>I start off by showing the folders and files in the root directory. With a small screen and slow processor, I don&#8217;t do any recursing at this point &#8211; just show the relative sizes of the different folders and files in the root directory. <\/p>\n<p>I omitted any external storage like Storage Cards, because they are so much bigger than the device&#8217;s own storage that it just completely skews the image. <\/p>\n<p>The colours are fairly hideous &#8211; I wrote something to just pick a random character for each block and try not to use the same colour for any adjacent blocks.<\/p>\n<p><a href=\"post-images\/diskviewscreenshots\/diskview2.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"right\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview2.jpg\"\/><\/a>I don&#8217;t label any of the blocks, because the screen size makes that fairly unreadable. Instead, if you click on any block, I add a black border around it and display the path and size below. <\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskview3.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview3.jpg\"\/><\/a>I&#8217;ve added a context menu &#8211; tap-and-hold on any block to get two (fairly poorly named!) options. <\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskview4.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"right\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview4.jpg\"\/><\/a>The first option: <strong>Drill-down<\/strong> makes it recurse down into the selected directory one level. By breaking it up, you can see what that directory is made up of. So you can see from this screenshot that Tom Tom Navigator makes up a hefty chunk of my &#8220;Program Files&#8221; directory at 2.63MB. <\/p>\n<p>It only breaks it down by one level &#8211; if you want to divide up a sub-directory further, you can do the drill-down again on that sub-directory.<\/p>\n<p>I like this, because it shows the size of a sub-directory in relation to the size of the whole storage. But with such a small screen, you probably don&#8217;t want to repeat this too many times as the blocks start getting very small. <\/p>\n<p><a href=\"post-images\/diskviewscreenshots\/diskviewD.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskviewD.jpg\"\/><\/a>For example, this is the sort of thing I can get if I keep drilling down into sub-folders &#8211; the Windows folder has a large number of smaller files and folders which are hard to tell apart. <\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskview6.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"right\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview6.jpg\"\/><\/a>The second option &#8211; <strong>Zoom in<\/strong> &#8211; is an alternative approach. It opens the selected folder up into the whole screen. For example, selecting <code>\\Windows<\/code> and choosing Zoom in gives me:<\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskview7.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview7.jpg\"\/><\/a>A break-down of the <code>\\Windows<\/code> directory. It means you lose the idea of how big the contents are in relation to the size of the whole device storage, but it does give me more room to show the contents. <\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskview8.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"right\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview8.jpg\"\/><\/a>So here I can look at the size of Tom Tom Navigator again &#8211; this time in relation to the size of my Program Files folder. <\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskview9.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview9.jpg\"\/><\/a>To avoid trying to draw very small boxes, I lump together anything smaller than a certain threshold into an &#8220;other&#8221; block &#8211; giving the size of all of the files lumped together, and the number of files and folders in the block. (With a little slider GUI to change the size of this threshold).<\/p>\n<p>I still have the &#8220;Drill-down&#8221; menu option for breaking this lump apart though.<\/p>\n<p><a href=\"post-images\/diskviewscreenshots\/diskviewA.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"right\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskviewA.jpg\"\/><\/a>By using drill-down on several sub-directories, you can start to produce something approaching a tree-map image&#8230;<\/p>\n<p><a href=\"post-images\/diskviewscreenshots\/diskviewB.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskviewB.jpg\"\/><\/a><\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskview5.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskview5.jpg\"\/><\/a>By default, I only display the device&#8217;s main storage. I&#8217;ve added a menu item to switch to displaying removable storage like Storage Cards.<\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskviewE.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"right\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskviewE.jpg\"\/><\/a>So here I can see the size of my video clips directory on my PDA&#8217;s microdrive. <\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskviewF.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"left\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskviewF.jpg\"\/><\/a>And here after breaking the sub-directories further to show the relative sizes of my mp3 folders&#8230;<\/p>\n<p><br clear=\"all\"\/><a href=\"post-images\/diskviewscreenshots\/diskviewG.jpg\" target=\"_blank\"><img decoding=\"async\" hspace=5 vspace=5 align=\"right\" src=\"post-images\/diskviewscreenshots\/thumbnails\/diskviewG.jpg\"\/><\/a>Here is my mini-SD card, showing that the bulk of it is filled with my maps for Tom Tom Navigator. <\/p>\n<p><br clear=\"all\"\/>So there we go &#8211; that&#8217;s what I&#8217;ve done so far. I think I might even end up using it from time to time!<\/p>\n<p><em>If people think that they might find it useful, let me know and I might bother finishing it off properly!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I mentioned last week that watching Doctor Who made for a good chance to absentmindedly play with some code. I seem to have started a new habit, so thought I&#8217;d share what I was worked on this week. \ud83d\ude42 One of the problems with my HTC Universal is running out of storage space when trying [&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-162","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\/162","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=162"}],"version-history":[{"count":0,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=\/wp\/v2\/posts\/162\/revisions"}],"wp:attachment":[{"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalelane.co.uk\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}