Friday, September 2, 2016

Translate your Mobile App for free in 3 easy steps

This is a simple way to translate your Android (or iOs) application into multiple languages, without using an expensive professional translation service for the initial translation or having to write any additional code. The solution is easy to manage and share for review. I've used this approach in my last 4 jobs and it works for all classes of application. (In one company I used this approach to translate over 8000 strings for a web based app.).
Once you have completed the translation you can manage the strings in Google's Android Translation tool (

Warning: You should still use someone fluent in the chosen language to verify the final application and make sure you don't end up with something that does not fit your application.

These instructions assume that you have developed an Android application and have located your strings.xml file under the res/values/ directory. The steps are similar with iOs but are not covered here.

You will be using Google Spreadsheets, so you need a Google account. I could just share the spreadsheet - but where's the fun in that?

Step 1: Preparation

In your Android project copy the strings.xml file to strings.csv.
Open strings.csv in your favourite editor.
(I've used strings.xml in the screenshot to highlight specific strings).

 You are going to remove everything other than the text in yellow and white.

Remove all text before <resources> tag.
Remove the <resources> and </resources> tags.
Search and replace all </strings>
Search and replace all  <string name=
Search and replace all < characters with  ,

Your file should now look like this:

Step 2: Import into a Google Spreadsheet

Open a new Google spreadsheet. From the File menu click 'Import' and upload your csv file.

All being well you should have two columns in your spreadsheet. 

Now insert one row at the top of the spreadsheet.
Enter the following headers for each of the columns 

Col A: ui  - the meaning of your string
Col B: en - the two character language code of the source string (en = english in this case)
Col C: de - the two character language code of the target string (de = german in this case)
Col D: the target XML string 

You can read up on language codes here:

Your spreadsheet should look like this:

Step 3: Translate and generate <string> tags

Now here comes the fun ! Use the Google Translate function to do the translation for you.
The function takes the following format: source string, source language, target language. 

So based on this enter the following in column C, row 2. 


The $ will ensure you are always using the same Row or Column (depending upon where it is used) - so in effect you told Google to

=GoogleTranslate  - translate
$B2                        - the text in col B  row 2
$B$1                      - using the language locale in col B row 1
C$1                        - to the locale in col C row 1

Now you have the translated strings we need to create the XML strings to add back into your app.

Recreate the XML string by concatenating column A and D in a <string></string> tag.
Enter the following formula in column D, row 2 onwards.  

= CONCATENATE ("<string name=", A4, ">", B4, "</string>")

Once the strings have been translated you can select column D and copy the contents into a text file called strings.xml and store this as per the Android instructions (in our example we would store the strings.xml file in /res/values-de/ ).

That's it - you're done!

Step 4: Extra credits

OK - this is good - but what if you want to translate multiple languages in one go? Just clone the spreadsheet and change cell C1 from 'de' to the (two or four) appropriate language string you want - such as 'fr', 'pt' 'ko' etc.

Sunday, May 25, 2014

Host a static website on Google Drive (in 5 easy steps)

You need to host a static website but don't have the time, money or resources to set up a web server.  Perhaps you're learning to code or just doing a demo. Here's a way to set up a web site at no cost, in just a few minutes.

Step 1. Create a new folder in Google Drive.

From Google Drive, Click 'Create', select 'Folder' and enter the folder name.
(I chose 'hybrid' for this example, but you can choose anything you want).

Step 2. Share the folder.
First select the folder you created (displayed in the folder list), then click the sharing icon.

In the Sharing Settings popup, go to the 'Who has access' section and click 'Change'

The Visibility options pop up will appear. Change the Visibility option to 'Public on the web'. 
Although set by default, make sure that 'Access' is set to 'Can view'.
Click 'Save'.

The folder is now shared. Click Done.

3. Upload your web content.
Open the folder and drag/drop your web content into the folder.
You can upload HTML, JS, CSS.  (I'm sure you can try media files as well but I haven't).

(Note: I have used Hakim El Hattab's Stroll.js CSS experiment for this example. You can find the original content at ).

Double check that the files are also publicly viewable.

4. Create your site URL.
Your Google drive folder is accessed using a specific URL. The site URL has the following structure:
Google Drive host / folder ID / your web page.html

First get your folder's unique identifier. Look in your browser address bar, the URL will end with a long unique string after the last "/".

Copy that long string.  Based on this information, we have:

Google Drive Host:
Folder UID: 0B8SIN8IVD8DGRFByVGZ0Vjdfcnc    (** yours will be different)
Web page: index.html (this is the name of your web page)

Open up your favourite browser and enter the following URL (use your folder UID and web page name)

Your web page should now display. Yay !! Almost there.

5. Make the URL a friendly one.

That URL is a little long - so the final step is to use a URL Shortener such as or

Copy your URL and enter it into your chosen URL shortener. Once converted you will have a short and simple URL such as or

Enjoy !!

Wednesday, September 18, 2013

Turn that old box into an Internet TV for less than $70...

So you've got an old TV or computer monitor with a VGA or DVI socket and it's looking pretty outdated because all the latest devices are HDMI only - including the cheap but amazingly great value Google Chromecast.

Well all is not lost! You can get a DVI-to-HDMI or a VGA-to-HDMI adapter and connect your TV or monitor to the adapter and then plug the Chromecast to the adapter. The adapter comes with audio sockets to take the HDMI audio and play it through the TV speakers. Really simple to put together and no software to set up.

Chromecast:                        $35
VGA-to-HDMI Converter : $30 (or less on Amazon)

I have this setup on an old TV that was sitting in the garage. The picture quality is exceptional.

Monday, April 29, 2013

Watch the BBC iPlayer and ITV Player when outside of the UK on Ubuntu

This is a follow up to my post of a year ago. The instructions are simpler than last year's post. If you want instructions for the Mac go here.

I re-imaged an old laptop last year with Ubuntu (12.04 LTS).  If you've never tried Ubuntu before, head over to  to try the latest version. The installation is straightforward and you can install it without affecting your Windows image (if that's what you're running). Not only is this fast (boots in seconds) it also has better support for a wider range of devices - specifically Wifi.

To run the BBC iPlayer on Ubuntu, do the following...

Step 1: Download tor from this site :  The download button should detect your operating system. For Linux the direct link is here. Alternatively you can use the command line and enter sudo apt-get install tor.

Step 2: Unpack the tor tar.gz file. Open the folder that was extracted. On my machine it's called 'tor-browser_en_US'.  Double click the file called 'start-tor-browser'.

Press 'Run' when challenged.

 This will launch the Vidalia control panel. If all goes well, the control panel should connect to the Tor network and you should see the following status:

Once you are connected, the web browser bundled with Tor will appear and carry out a check to ensure you are online anonymously.

The bundled Tor browser is a cut down Firefox image that does not have Flash player installed - which is required for the iPlayer.  To use another browser, with Flash installed, we need to get the SOCKS host setting from the bundled Tor browser.

Step 3 From the bundled Tor web browser menu select Edit->Preferences->Advanced. Then press the Network tab. Click the 'Settings' button.   Make a note of the SOCKS host port (9050 on my setup).  If for some reason this is blank - then Check 'Manual Proxy configuration' and then enter for the SOCKS Host and 9050 for the port.

Step 4: Set up tor to use servers in the UK. On the Vidalia control panel click "View the Network". The Tor network map will open.

This shows you a list of the servers that are available all around the world.  Sort the list of countries by clicking the column header for the flags. Once the list is sorted by flag - scroll down until you see the Union Jack (British Flag).  Make a note of several relays by typing their names in a text editor (several incase one is offline or has poor performance).

Once you have made a note of the relays - Close the tor network map.

Step 5Setup the Tor servers in the Tor configuration file.

In the Vidalia control panel, press the 'Settings' button. Then press the Advanced tab.

In the Tor configuration file section, click 'Edit current torrc'.
The torrc configuration file will open.

At the bottom of the list of settings add the following two lines. Replace #R1, #R2, #R3 with the names of the relays that you picked out earlier.

ExitNodes  #R1, #R2, #R3, #R4
StrictExitNodes 1

For example:

ExitNodes  TorLand1, StickItToTheMan, obelix
StrictExitNodes 1

(StrictExitNodes forces Tor use the list of Relays that you provide).

Also add the SOCKS Host and port number (if it is not present) ensuring the values match your settings.

SocksPort 9050

Now press OK to confirm the changes and close the window. Press OK to close the Settings Window.

Step 6. Restart tor by pressing the Stop Tor button.  Once Tor has stopped - press Start Tor. When Tor has started successfully - then get excited - you're almost there !

Step 7a: Set up a Firefox to use Tor.  Open Firefox. Select Edit->Preferences->Advanced. Then press the Network tab.

Click the 'Settings' button.
Select 'Manual Proxy configuration'.  Enter for the SOCKS Host and 9050 for the port.

Press OK then Close to exit the preferences.

Step 7b: Set up Chrome to use Tor. Open Google Chrome.
Click the wrench on the toolbar, then click "Settings" from the menu options.

At the foot of the page - click "Show Advanced settings".

In the section marked "Network", click the "Change Proxy Settings" button.

Click "Network proxy" from the list on the left.

Select "Manual" from the Method pick list.
In the SOCKS Host field enter
In the field marked ":" enter the port number 9050 (or whatever your setting was)
Press Apply and close the Network settings dialog.
Now Google Chrome is set up to talk to Tor running locally on your machine

Step 8:  View !!  You made it ! You can now head to the BBC iPlayer page at .

You can also watch ITV at

Final notes

You are not limited to the UK. You can access online content any part of the planet. Just remember to change the relay for the host country.

Wednesday, November 28, 2012

It's a hybrid !!

The motor car industry is in transition right now. It is a slow process that will take the motor car back to it's roots as the 'electric carriage' of the 1830's.  Electric cars were common until the petrol (gasoline) overcame the limitations of battery storage capacity and vehicle distance, to dominate the market for over 100 years.  The long term trend in the rising cost of fuel, the impact of the combustion engine on the environment and changing social/work patterns have re-introduced the electric car back into the market.
Despite electric car innovation, if you are in the market for a new car today, it's likely that you will settle for a hybrid. The hybrid overcomes the deficiencies of current battery technology in electric cars while offsetting the rising cost of petrol.

Mobile application development can be described in much the same way. When people talk about writing mobile applications, they often talk about 'native' and 'HTML5' based applications. When you think of 'native' think 'petrol'. Developers will write apps in 'native' code - that is code that runs natively on the operating system. Because mobile devices use different operating systems, developers have to write their application multiple times - thereby incurring a high cost of development. And testing. And bug fixing. And enhancements. Even if you plan only on supporting iPhone and Android - that's still a hefty investment to make for the same piece of functionality. You will never have functional parity (think Windows and Mac software).  Don't be fooled by that starry eyed programmer who is telling you that writing a native application is the ONLY way to build your mobile application.

The alternative approach to developing mobile applications is to write a single web app that runs on the mobile browser, using HTML5, CSS3 and JavaScript, mitigating the high cost of writing multiple native apps. HTML5 mobile web apps are very much like the electric car. HTML5 is a new standard but the mileage is limited. HTML5 is a specification that has been evolving at the same time as the iPad - so naturally it falls short in supporting all the things you want to do on a smart phone or tablet today. Even with basic feature support (location, local storage and camera) HTML5 does not solve many of the mobility problems that developers face - specifically security, offline support and access to native device features and phone functionality such as push messaging.

Just like the motor car, there is also a third option - the hybrid.  The hybrid mobile application blends the best of web with native code operation. Hybrid apps run inside a native container and leverage the device’s browser engine to render HTML and process JavaScript locally. Hybrid development requires you to write one web application (HTML5, CSS3 and JavaScript) and access device features through a JavaScript API.  Apache Cordova (PhoneGap) takes this approach, as does emotive an mobile cloud computing platform (disclaimer: the company I work for).

There are many advantages to the pure hybrid model (by 'pure' I mean there's no  cross compilation of the source code - it is just run it as-is) - these include
  • faster time to market
  • standards based web programming model 
  • access to native device features
  • development team needs no training and no expensive native programmers to hire
  • reuse existing web assets - including mobile web assets
  • cost of maintenance is low
  • not locked into any vendor 
  • faster iteration time to build and revise applications

Yes - it's true that today you get more mileage from a native application over a web mobile application - but at a really high operational cost and you know that it is not the long term option.  HTML5 web mobile applications are cheaper and easier to produce but fall short in giving you full device access.

Just as with the car, if you are looking to build the next generation of platform independent, smart, context aware, enterprise mobile applications at low development and maintenance cost, then you want to go with a hybrid.

Monday, May 21, 2012

Sorry Sir, this club is SaaS only

Client: "....sounds great I'll take it. You do support on premise, don't you? We're an on-premise business"

Sorry Sir, we don't that. Let me explain why, Sir, by dispelling two software myths right off the bat.
1. companies that produce on premise software understand how to run it in production
2. your IT department can manage an app better than the SaaS company that makes it

Despite your disappointment and hurt feelings, Sir,  deep down you know that I'm right...

Client: "....I have some of the best ops guys in the business. You don't know my business"

  • Nice car Sir! Topped up the oil Sir? Water and air? But beyond that you probably leave car maintenance to the 'experts' Sir? The local dealer or the manufacturer that produces your car? Of course Sir, you're too busy and can't possibly spend the time to become a specialist in car maintenance Sir, can you? You are the car user but 'operations' is outsourced to a third party.
  • Nice house Sir! Assume you have running water, gas and electricity? Every one of these services is provided by a third party utility Sir? You could set up your own electricity generator and pump your own water from a well - but you don't have the time or infrastructure to do any of that do you Sir? You are a user and consumer of services, these services are provided by a third party.
Client: ".... nice examples - but this is software we're talking about. software is different....."
  • You run an on premise business Sir? Yes I understand. Your payroll is managed by ADP,  health by Blue Cross, copy machines by Xerox and email by Google, yes Sir? All the essential services you offer your employees are managed by third parties. These are the must-have "live or die" services you offer to your internal customers (your employees) and they had better be running in order for you to stay in business, wouldn't you say so Sir? You have implicit trust that these critical services are always available from these 3rd parties.

Now - lets consider the myths I mentioned shall we, Sir?

  • On premise software vendors spend years designing, writing, unit testing and performance testing their software. Excellent but they don't operate the software the way you do. Some companies "eat their own dog food" but there is no communication between those that operate the software and those that design the software. Since when does a product manager listen to the ops guy?  If they did perhaps there would less systems management, middleware and operations control software companies out there, wouldn't you say so Sir? And why is your maintenance budget so high? I suspect that your IT guys know parts of the software better than the on premise company that wrote it, because they run it every day in a real world setting with a mixture of other products and services.

  • SaaS companies are operating the software on a daily basis and their reputation depends on guaranteed service. For that reason, people designing the software consider the operational impact of their products and ensure that the revenue raised outweighs the costs to run and maintain. Many SaaS companies are deployed on a PaaS or an IaaS - meaning the specialism for managing the hardware, network and software stacks works on the principle of the division of labour - everyone focuses on doing a few jobs really well, instead of a lot of jobs really poorly. 

You know people aren't born with a natural understanding of any product or service. Why would you think that you can run this software yourself, better than the service we are providing Sir? We understand what we are building and how to operate it in a manner that ensures continued service and value to you.

So please, don't ask for on premise, we're not that kind of club.

Sunday, February 26, 2012

Let's get into character

There's a classic line in Quentin Tarantino's "Pulp Fiction". Two hit men, Jules (Samuel L. Jackson) and Vincent (John Travolta), are on their way to a job where they could be dealing with as many as six guys.

Jules says to Vincent that they should “get into character,” indicating that they each play a part when they go on the job. The job of hit man is nothing more than a career choice and they don’t necessarily define themselves within those parameters.

That's great advice that every software developer and product manager should take note of. Put yourself in the position of the user and really role play the moment or the "day in the life". Better still - get out of the office and go on the road and sit with the user you think you are building software for. I say "think" because most people building software are kidding themselves that what they are building is good for the user. 
Think like a movie star. You really need to get inside of the head of the user. Only then will you start to realise that the user really doesn't want to use your application because it SUCKS! More to the point, the user is just a transient, using your software for a brief, fleeting moment to accomplish a task (e.g. make the hit) - and then they need to get out.

If the answer to any of the following is "yes" then you're in trouble.
  • the user interface is dictated by the data model 
  • you built the technology and are now looking for a use case
  • the user is expected to remember the process steps
  • the app has a lot of neat features that users "might" want
  • executive management changed the design to suit themselves
  • that's how the desktop version works
  • "well it was good enough in my day"
Put simply - if the application doesn't do anything for the user - it sucks. The user won't use it again, unless forced to - and that itself is becoming an outdated, unworkable model.

Enterprise software vendors beware. If you hadn't noticed - users are walking with their feet - choosing to use other applications and devices.
Put yourself in the shoes of the user and forget about your bias for one technical solution or another.  

Of course technology matters because if you use the wrong tech or approach the performance or scalability will suffer and again the user won't use the software. Technology should be the second consideration, after you have nailed the user experience.

So the next time you sit down with your development team to knock out a new application or update an existing one - put on the white shirt, black tie and black suit, put "Misirlou" on the stereo and "get into character".....