{"id":2274,"date":"2014-08-25T19:16:45","date_gmt":"2014-08-25T07:16:45","guid":{"rendered":"https:\/\/www.deltics.co.nz\/blog\/?p=2274"},"modified":"2014-08-25T19:16:45","modified_gmt":"2014-08-25T07:16:45","slug":"small-post-for-a-very-small-app","status":"publish","type":"post","link":"https:\/\/www.deltics.co.nz\/blog\/posts\/2274\/","title":{"rendered":"Small Post, for a (Very) Small App"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\">3<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span><p>On Saturday I was out and about with my family and found myself inspired to write an app.  By Sunday evening, it was done and in the Google Play store.<\/p>\n<p><!--more--><\/p>\n<p>We were in an area of Auckland called Parnell and needed to park the car on street, where a fairly standard &#8220;pay and display&#8221; system is operated.  Since (I think) 2005 Auckland City (and some other parts of NZ) have offered <strong>TXT-a-Pay<\/strong>\u2122 on their parking meters.<\/p>\n<p>It&#8217;s a very simple system:<\/p>\n<ol>\n<li>You select <strong>TXT-a-Park<\/strong>\u2122 as your payment method (rather than cash or credit\/debit card),<\/li>\n<li>The meter then displays a menu of codes, corresponding to different lengths of stay.<\/li>\n<li>You send the appropriate code as a TXT msg using an SMS capable phone to the number 7275 (P-A-R-K),<\/li>\n<li>The appropriate fee is charged to your mobile phone account, and the meter then prints your ticket for displaying on your dashboard.<\/li>\n<\/ol>\n<p>There is nothing particularly sophisticated about the system.  The code that you TXT to 7275 consists of 4 digits that identify the particular parking meter, and the final digit is the $ spend for the indicated length of stay.<\/p>\n<p>What has always bugged me about this is that smartphone SMS apps have become increasingly loaded up with features and the on screen keyboards ever more cramped with all sorts of great shortcuts for smileys and prediction and goodness knows what.<\/p>\n<p>Which is great when you are TXT&#8217;ing a novel, or a love letter or trying to track down your kids.  But when you just want a clean, clear, error-free way to whack in 5 simple numbers and send them to a specific SMS number, it can be a real PITA.<\/p>\n<p>So I decided to write an app.<\/p>\n<p>As soon as we got home later in the afternoon I set about it.<\/p>\n<p>It turns out that on <strong>Android<\/strong> sending a TXT really is very simple.  In fact, you can achieve it in a single line of code.  For example here&#8217;s the Java for sending the code &#8220;66169&#8221; to the 7275 <strong>TXT-a-PARK<\/strong>\u2122 number:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n   SMSManager.getDefault.sendTextMessage(&quot;7275&quot;, null, &quot;66169&quot;, null, null);\r\n<\/pre>\n<p>Which effortlessly translates into Oxygene code:<\/p>\n<pre class=\"brush: oxygene; title: ; notranslate\" title=\"\">\r\n   SMSManager.Default.sendTextMessage('7275', nil, '66169', nil, nil);\r\n<\/pre>\n<p>There is a bit more involved if you want to provide a callback for handling confirmation of the sending of the message (or failure) and\/or of delivery of the message.<\/p>\n<p>But in essence, I simply needed an app with a UI to enter 5 digits and send them as a TXT.<\/p>\n<p>And here it is (&lt;drumroll \/&gt;):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/screen-3.png?ssl=1\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/screen-3.png?resize=168%2C300&#038;ssl=1\" alt=\"TXT-2-PARK\" width=\"168\" height=\"300\" class=\"aligncenter size-medium wp-image-2276\" srcset=\"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/screen-3.png?resize=168%2C300&amp;ssl=1 168w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/screen-3.png?resize=576%2C1024&amp;ssl=1 576w, https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/screen-3.png?w=1080&amp;ssl=1 1080w\" sizes=\"(max-width: 168px) 100vw, 168px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>The app is called TXT<strong>-2-<\/strong>PARK rather than TXT<strong>-a-<\/strong>Park\u2122 since the latter is a trademark in NZ.<\/p>\n<p>I made things harder for myself by deciding that I would present my &#8220;message sent&#8221; confirmation using a custom layout for my message &#8220;toast&#8221; which turned out to be harder than I expected.  I will post about that soon.<\/p>\n<p>But, as I said, the app is now up in the <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=itchbox.txt2park&#038;hl=en\">Google Play Store<\/a>.  It is a free app, so if you are in Auckland or anywhere else that offers a compatible service (TXT a 5 digit code to 7275 in return for parking or whatever), then go grab it.<\/p>\n<h2>All In The Title<\/h2>\n<p>The title of this post is &#8220;Small Post, for a Very Small App&#8221;.<\/p>\n<p>How small ?  22 KB + change.  That&#8217;s how small.<\/p>\n<p>That is the <em>complete<\/em>, <em>fully functioning<\/em> app including a UI which, although no work of art, does at least scale nicely (well, effectively at least) on devices from very small screens (240&#215;320) up to phablets.  Or at least it should do &#8211; I have tested it with a range of emulated devices as well as my own <strong>Galaxy S4 Active<\/strong>.<\/p>\n<p>This small size means that the main goal of the app &#8211; convenience &#8211; is very well supported by the fact that it starts up and is ready to go <strong>instantly<\/strong> that you tap its shortcut.<\/p>\n<p>Meanwhile I&#8217;m now working on an <strong>iOS<\/strong> version (for my wife, among others) and <strong>Windows Phone<\/strong> (for my work colleagues, among others).<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">[Estimated Reading Time: <\/span> <span class=\"rt-time\">3<\/span> <span class=\"rt-label rt-postfix\">minutes]<\/span><\/span> On Saturday I was out and about with my family and found myself inspired to write an app. By Sunday evening, it was done and in the Google Play store.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[212,205,4,180],"tags":[153,240,181,280,279],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1TKYv-AG","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2280,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2280\/","url_meta":{"origin":2274,"position":0},"title":"Oxygene Constructor Magic on Cocoa","date":"30 Aug 2014","format":false,"excerpt":"Earlier this week I mentioned that I had published my TXT-2-PARK app for Android in the Google Play Store. Today I published the iOS version to the Apple App Store (still awaiting approval at this stage). As with the Android version, I implemented the iOS version using Oxygene, and things\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2285,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2285\/","url_meta":{"origin":2274,"position":1},"title":"While I Was Waiting For Apple&#8230;","date":"01 Sep 2014","format":false,"excerpt":"So Saturday morning I finished the iOS version of my application and published it to the App Store. Of all of the app stores, the approval process with Apple evidently takes the longest. So, whilst waiting for my app to be released, I developed (and published) the Windows Phone version\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2296,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/2296\/","url_meta":{"origin":2274,"position":2},"title":"Sign Here Please&#8230; (Using This Specific Pen)","date":"01 Sep 2014","format":false,"excerpt":"My original Android version of TXT-2-PARK has been in the Google Play Store for a little over a week now. But it was only on Saturday that I decided to install the release version onto my phone from the store itself, and found a problem. The application would download just\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1896,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1896\/","url_meta":{"origin":2274,"position":3},"title":"Getting Published in the Play Store (Google Apps)","date":"14 Oct 2013","format":false,"excerpt":"Well, this went far more smoothly than I had anticipated. At the XE5 World Tour event in Auckland, Brian Hamilton, creator of the iWD app, told us that getting his approved took about a week (if I recall correctly), and he had to submit a video showing how his app\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1624,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1624\/","url_meta":{"origin":2274,"position":4},"title":"Exploring Listeners With Oxygene","date":"16 Sep 2013","format":false,"excerpt":"Part 2 in a short series demonstrating the development of a simple camera app for Android using Oxygene. In the previous instalment we looked at the basic framework of our app. For this instalment I was going to show how to implement the camera preview or viewfinder for this instalment,\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1658,"url":"https:\/\/www.deltics.co.nz\/blog\/posts\/1658\/","url_meta":{"origin":2274,"position":5},"title":"Crash Bang Wallop, What a Picture!","date":"19 Sep 2013","format":false,"excerpt":"The fourth and final part in the not-as-short-as-I-thought-it-would be series on building a camera app for Android using Oxygene. In this penultimate instalment we will add the capability to actually take a picture. But that won't take very long, so then we will spend a bit of time tidying up\u2026","rel":"","context":"In &quot;Android&quot;","img":{"alt_text":"Very Ugly Duckling","src":"https:\/\/i0.wp.com\/www.deltics.co.nz\/blog\/wp-content\/uploads\/Screenshot_2013-09-19-19-38-56-1024x640.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/2274"}],"collection":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/comments?post=2274"}],"version-history":[{"count":3,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/2274\/revisions"}],"predecessor-version":[{"id":2278,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/posts\/2274\/revisions\/2278"}],"wp:attachment":[{"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/media?parent=2274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/categories?post=2274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deltics.co.nz\/blog\/wp-json\/wp\/v2\/tags?post=2274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}