Thursday, 9 February 2012

Updated MonoTouch articles available

Last year I made available an intro article and an in-depth tutorial on using MonoTouch, which was at version 3 at the time, and sold by Novell.

Since then lots has changed. MonoTouch is now sold by Xamarin and is at version 5. Also, Apple’s Xcode kit, which is used to design MonoTouch UIs has bounced from version 3.x to version 4.2 with huge changes therein.

Because of all this, those articles have been horribly out of date for some time.

However I’ve now updated them both. Use these links to access my updated MonoTouch introductory article and MonoTouch extensive tutorial, the latter of which covers navigation controllers, SQLite, location-detection, some sensors, web services, splash screens and more.

Friday, 3 February 2012

English pronunciation idiosyncrasies

Anyone who speaks English, or has tried to learn it, will be well aware of the amazing array of odd pronunciations we have in the language. These are mostly caused by amassing words from so many other languages over hundreds of years, but nevertheless make learning the mapping between what’s written, the context it’s written in and how it’s pronounced a very tricky goal.

There have been various stories, essays and verses written to highlight many ambiguities and irregularities present in the pronunciation of different but similarly spelt words. An excellent example of this is a lengthy poem called The Chaos, written by Gerard Nolst Trenité (aka Charivarius), 1870-1946, and published in 1920 in the 4th edition of his 1909 textbook Drop Your Foreign Accent: engelsche uitspraakoefeningen.

Since its original publication it has been modified and reworked several times, with the original author’s version being 146 lines long and his last version (in the 7th edition of the book in 1944) was nearly twice as long. Various subsequent updates and revisions have been made around the world since then. The version presented by The English Spelling Society is 274 lines and highlights over 800 irregularities, and is preceded by a detailed history on the poem.

The poem’s first lines suggest it is written as if to one of Trenité’s students, Susy.

Anyway, here’s the authoritative version as presented by The English Spelling Society, with every tenth line numbered and set out like the author’s original version, with alternate couplets indented and problem words italicised.

Mono for Android book available

Early in this blog's life I mentioned a book on MonoTouch that acts as a great intro to developing for iPhones with the MonoTouch framework. Or at least it did at the time. MonoTouch requires use of Xcode and things have changed quite a lot with the new Xcode 4 and MonoTouch 5 - I'm not sure if the book has been updated as yet.

Anyway, the principal author, Wallace McClure, has since been hard at work with Mono for Android and is on the cusp of releasing a book on working with the current version of Mono for Android, getting to grips with all the key aspects of Android development using the Mono for Android framework. The book is called Professional Android Programming with Mono for Android and .NET/C# by McClure, Blevins, Croft, Dick & Hardy, and is published by Wrox. You can pre-order it at Amazon – the amazon.com and amazon.co.uk links are below:

 

Wireless Android Control

I’ve bumped into a couple of wireless Android control apps lately, one targeted at developers and one targeted at users. The two apps rely on both your Android device and the computer that will be wirelessly connected to it being on the same Wi-fi network, which is fair enough – you’ll be using this in a home or work environment.

adbWireless

adbWireless one is solely aimed at developers, and I was introduced to it by Jim McKeeth’s blog post on using it in conjunction with Oxygene for Java.

Once you enable the app with the big red button on the main screen you can have adb on your computer hook up to your device across the Wi-fi network, rather than via the more typical USB cable connection. This is done using the adb connect <IP_address> command, where the IP address has a port specification and is supplied by adbWireless after the button is pressed.

adbWireless

After making this wireless adb connection, you can work normally from the computer, deploying, running and debugging against the device. This works from any Android development tool, such as Eclipse or Oxygene for Java.

One rather large caveat, however, is that adbWireless only works on a rooted device. Rooting your device to gain root access is not risk-free (so on your own head be it!) and not always achievable.

In my case I recently tried to root my HTC Desire, but failed to do so (fortunately without bricking it). This was not due to a lack of information on how to proceed – indeed the Desire is (relatively) old now, being introduced in February 2010. However the avenue I took to root it (unrevoked – a very straightforward, automated, hands-free approach) had not been updated to cope with the most recent firmware update that was applied to the telephone not long ago. I’ll have to try again when unrevoked is next updated.

I very much like the idea of adbWireless, but currently I’m not in a position to try it out….

AirDroid

AirDroid is a general way of controlling your phone, using its services and accessing its data from a web page loaded on a machine on the same Wi-Fi network.

When you start AirDroid it shows you a simple IP-based local network URL that you can enter in a web browser on your computer, and a password to log in with.

AirDroid_Phone

Navigating to the URL in a desktop browser shows the web site pushed out by AirDroid, offering many options including:

  • browsing, playing and setting your ring/notification/alarm tones
  • browsing your photos, including options to download, set as wallpaper or delete)
  • browse your SMS conversations, compose and send SMS messages
  • browse/edit/delete your contacts
  • browse all details of your call log
  • browse installed apps, export apps and install new apps
  • browse details of storage
  • and more besides…

The app itself also allows you to analyse/control various aspects of your device, including running tasks (and the obligatory task killer) memory usage:

AirDroid_Phone2

I’ve already found this app very useful. On my old phone I had a couple of apps that I’d refused to update with newer versions as I had seen the newer versions crippled the (free) apps and removed functionality from what I had installed. Additionally there was an app that had since been removed from the Android Market. With AirDroid I simply exported the apps in question from the old phone web site, then used the web site of the new phone to install them – problem solved!

Here’s the AirDroid web page showing storage analysis on a new phone that has been in active use for a few days:

AirDroid_Desktop

Note that AirDroid works on any Android device, regardless of whether it has been rooted or not.

Also note that AirDroid is currently in beta and so you do occasionally get little hiccups, but in general it is an impressive piece of work.

Thursday, 2 February 2012

Problems installing and/or launching Android apps (2)

Further to my previous post on common problems installing and/or launching Android apps, here’s a little titbit to add into the mix.

In that previous post I mentioned:

Sometimes a small change in the application, like updating the package name or altering the signing process (i.e. changing the package’s signature), will mean an application can’t be re-installed over a previous version.

Just to add more detail, I realised there is a classic case of this type of issue. In building up either Android samples or proper applications in Oxygene for Java, I often copy the project between machines, switching between a couple of laptops and a VM on a desktop machine. In the case of simple projects this machine switch is either done using a shared network drive or using my DropBox folder.

The point is that as soon as I switch to another machine and start building a regular Android application I can no longer install it from the development environment. This is because Oxygene wants to re-install the application (so that any app data, such as SQLite databases) are preserved between increments of the application. That’s nice of Oxygene, but it’s hitting an issue with this goal.

Here's the problem. As I mentioned in another article, without a dedicated certificate, the Android SDK tools invoked by Oxygene will use the default Android debug key to sign the application. The Android debug key is created on a given machine the first time the SDK tools are used to build an application. From machine to machine each Android debug key will be different, so when you go to re-install the same application compiled on a different machine Android will notice the inconsistencies in debug certificates and reject the re-installation attempt.

You have no choice but to drop to the command-line and use adb to uninstall the application. After this, the application should install and run just fine.

Of course you get the same problem when using a dedicated certificate and you re-create it for whatever reason, or if on a given machine the Android debug certificate expires and gets recreated by the SDK tools (this happens every year, as the debug certificate is created with a validity period of 365 days).

DropBox

Yes, we all know that making regular backups is essential, don’t we? And for work stuff that’s probably done as a matter of course. Sometimes personal documents aren’t treated quite so diligently and run the risk of being lost in the case of a disk crash or the laptop accidentally falling off the desk.

Lately I’ve been trying out DropBox as a means to help backup certain documents, but also to gain various other benefits.

When you sign up, DropBox gives you a free 2GB of online storage. The way it works is that you install DropBox onto your Mac or PC and it sets up a DropBox directory, which is then monitored. Any files you put into this directory (subdirectories therein) will be automatically backed up and mirrored to the online DropBox storage.

Moreover, if you have DropBox installed on several machines (physical or virtual) changes to files in a DropBox folder are automatically and instantly synchronised to those machines as well (based on the size of files and Internet connection speed).

If you are disconnected, the changes will stack up and be applied to the online version when you reconnect.

If you change a document from two machines, DropBox doesn’t bother trying to merge the changes – it stores two separate versions.

Additionally, DropBox keeps a record of previous versions of your files, which can be restored at will, and which do not eat into your storage allocation.

If you need access to these stored documents when not at your own machine you can access them after logging in to the DropBox web site.

Additionally you can share folders of files within your DropBox storage to specified people.

I’m finding DropBox a really convenient way of working on documents and projects from wherever I happen to be working, with whatever machine, with the peace of mind that things are automatically backed up.

If you feel like trying DropBox, please sign up and install via this referral link, which means that you will get an extra 250MB of storage on top of your initial 2GB (as will I <g>).

Jan 2012 Release of Oxygene

On 27th January RemObjects released their first update to their Oxygene 5 products, Oxygene for .NET (aka Delphi Prism, aka Prism) and Oxygene for Java (aka Project “Cooper”).

Oxygene for .NET v5 was released as part of Embarcadero’s RAD Studio XE2 in September 2011 and Oxygene for Java was initially released in September 2011.

Both products feature a completely re-written Oxygene compiler, no longer written in C#, but written in Oxygene itself, both the .NET and Java versions sharing the same code base. The integration into Visual Studio was also entirely re-architected and re-implemented to support better future extensibility.

The January 2012 release of Oxygene cleans up a whole bunch of teething problems inevitable in a complete re-write of a product and also inevitable, in the case of Oxygene for Java, in a product targeting a whole new platform. It also introduces new features and covers a number of user requests. The change log details the plethora of updates, improvements and fixes.

If you already have Oxygene in one of its various guises and have an active subscription, then you can pull down the update from the RemObjects downloads page. The update will work out which Oxygene edition (or editions) you have and update accordingly.

If you want to try Oxygene, either for .NET, Java or both platforms, pop along and get the updated trial version.

Grammar Mistakes

There are many articles online that focus on the more common English grammar mistakes – correct use of “its” vs. “it’s”, correct use of “there”, “they’re” and “their”, correct use of “could of” vs. “could have” and so on.

I recently bumped into a very interesting article, 20 Common Grammar Mistakes That (Almost) Everyone Makes, that looks at some more intricate grammar errors that are quite common. It was enlightening to learn the specifics of “which” vs. “that” and “who” vs. “whom,” and I’ve definitely been guilty of using “less” instead of “fewer”…

Definitely a good read!

On a more light-hearted note, I also bumped into these quite amusing takes on what is sometimes said vs. what is meant and what is heard.

This one looks at expressions that British people might use and contrasts what might be meant by them, versus how they may be interpreted by non-British people:

BritishPhraseInterpretations

This one is more of a wry look at various phrases that are sometimes written in formal essays and articles, and what might really be meant by them:

ArticlePhrases