Upcoming Samsung Android Event

Samsung here in Nigeria is hosting an Android-event at the end of this month for top corporate organisations from the financial, insurance, healthcare entertainment and news publishing industries. The aim of the event is to show that companies can now confidently and securely adopt Android devices for handling a number of their corporate processes.

To this effect, Samsung is interested in showcasing some of the android apps built locally with the intention of helping you increase visibility, giving you a chance to engage with top executives and decision makers in those industries and possibly putting your app on the market. Samsung has also expressed interest in making such applications to be installed by default for tablets and phones being shipped to Nigeria & West Africa in the near future.

If you have built or are developing an android app you would like to showcase at the event, please send a quick description of the application to gtuglagos [at] gmail.com and include mobile number for further discussions.

I Can Now Pay for Android Apps from Nigeria….So What?

The fact that the Android App Market now supports payments from cards that originate in Nigeria and a number of other African countries is no longer news. After the initial excitement that greeted this news, I guess the real question running through the minds of the developers on the street is :

So what?

The reason is not farfetched. Developers in Nigeria as well as a number of other African countries are still looking forward to that glorious day when they will be able to receive payments for their toil in real time the way their colleagues in Europe, America and Asia do (Unless you just dropped from the moon or just came out of cryogenic storage I am sure you know by now that the likes of PayPal and Google Checkout currently do not settle to merchant accounts in Nigeria and several African countries)

While that day is still some way in the future, we can look upon this latest development as a step in the right direction, in fact some have gone as far as saying that 30% of the battle has been won. So the issue now is what are the possible implications of this development and how can Nigerian / African developers use it to their advantage?

First off a very brief look at some aspects of the card payment industry in Nigeria is in order.

In Nigeria today there are currently a number of card schemes in existence of which Visa and Mastercard rank among the stronger brands and together account for (by my own humble estimation) about half of the active cards in Nigeria. This means that today about half of the card carrying Nigerians (if they were to have internet access) should be able to download paid apps from the Android market. As at today this number should be nothing less than four million Nigerians.

This means that as at today the Nigerian android developer has a potential market of about 4 million people who can download his/her app. Of course this number reduces drastically when you factor in internet access and number of Android applications. Twenty to thirty thousand becomes a more realistic figure (of course this will change favorably when the $100 android smart phones come to Nigeria, something we hope will happen in a matter of months).

So…access to about twenty thousand potential paying Nigerian downloaders with the potential to grow to about ten times that amount in the next one year is a lot (I think), at least it is almost twenty thousand more than it was a year ago. These are people who would be looking to download reasonably priced applications that address local problems like traffic, events and venue location, access to the closest pepper soup and African Salad joints and stuff like that. It is here that I see a big opportunity for the Nigerian / African developers who are willing and able to build these apps.

So you ask…ok….i have built all these lovely apps…so how do I get my money?

Well…the way I see it, there are two options:

  1. You wait until that long awaited day arrives
  2. You partner with a person/company that has an offshore account that you can use to receive payments (a strong legal agreement is necessary here of course)

The call also goes out to Nigerian and African banks to come up with innovative ways of helping African developers / Merchants get paid while exposing the buyer to as little risk as possible. I do not think it is rocket science (both in terms of technology and policy). It just requires some focus. There is also the glimmer of hope being offered by the mobile payment providers that will soon be licensed by the Central Bank of Nigeria , the successes of M-PESA in Kenya and the recent introduction of Google Wallet. I would like to take this to mean that the dark days are almost behind us…and the day of total financial inclusion for the African developer is almost at hand

We look forward to that day.

OpenVR, the Story Behind the Story

Our guest blogger today is Femi Taiwo, lead developer for the OpenVR project. The OpenVR Application was used to register more than 70 million voters in the just concluded general elections in Nigeria. Read on as Femi takes us behind the scenes of an application that has possibly changed the face of elections in Nigeria for ever.

OpenVR – short for Open Voters Registration – is a free and completely open-source biometrics capture solution built on open standards.

OpenVR is the software that was used to register over 73million people during the voters registration exercise held earlier this year in Nigeria. And it was BUILT (from scratch) BY NIGERIANS – all members of the team are volunteers – software engineers born, bred, trained in Nigeria.

The Team

Nyimbi ODERO – System Architect

Ronke DOMINGO – Project Manager

Femi TAIWO – Lead Software Developer

Sola AJAYI – Software Developer

Fisayo ORIMOLOYE – Software Developer

Doyin KASSEM – UI Designer

CHUKWUEMEKA Ujam – Biometrics Expert

To its credit, OpenVR can boast of

– Aggregating over 85 Tera-bytes of Data

– Printing 73M+ Voter’s Cards

– Generating over 4,600,000 Pages of Reports in PDF

– Collecting over 500,000,000 Fingerprints

– Installation on over 132,000 machines and hundreds of servers

– An effective one-click patching system

– Full Integrated AFIS

From gtug_blog

Built from ground up to be very secure and unobtrusive at the same time, OpenVR software runs on Ubuntu – a Linux Operating System and supports a variety of fingerprint scanners, external hard drives, printers and web-cameras. It also features an in-built Automatic Fingerprint Identification System (AFIS) to reject multiple registration attempts. It comes as a bundled solution that works right out of the box, without any configuration required on most hardware.

We created it as a one-click-to-install solution – it automatically installs and configures the video drivers, sound drivers, network and wireless card drivers, scanners, printers and other devices. We chose Ubuntu for several reasons including – ease of customization, rigorous quality assurance, hardware compatibility and a renowned security track record.

So, why did INEC choose to go Open-source on a very important, critical and failure-intolerant project? And why did we volunteer to build it?

For me to answer the first question, I’d like to explain what open-source really means.

Free Software and Open-Source Software

These terms are easily misunderstood.

Open source describes practices in production and development that promote access to the end product’s source materials – in this case – the sourcecode for OpenVR. Phrased from the free sharing of technological information, Open source software is software whose source code is published and made available to the public, enabling anyone to copy, modify and redistribute the source code without paying royalties or fees. Open source code evolves through community cooperation. These communities are composed of individual programmers as well as very large companies. The Linux operating system is a great example of opensource software – and in this case, it’s the complete operating system that is opensource.

Free software is a matter of the users’ freedom to run, copy, distribute, study, change and improve the software. More precisely, it means that the program’s users have the four essential freedoms:

The freedom to run the program, for any purpose.

The freedom to study how the program works, and change it to make it do what you wish. Access to the source code is a precondition for this.

The freedom to redistribute copies so you can help your neighbor.

The freedom to distribute copies of your modified versions to others. By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.

This essentially means that anyone with the publicly available source-code of the OpenVR software can make modifications to the software, and release such changes, without payment to the developers of the original version.

Essentially, for INEC, this meant complete freedom from proprietary software and vendor lock-ins,It which is something that has left many institutions and other government bodies with a bitter after-taste in their mouth. It also meant that there were no hidden backdoors, no quick hacks “just make it work mentality” and that they could get independent resources at any point in time to run a peer-review of the entire software – architecture, source code and implementation. Now that’s complete control.

At the onset of this project in August (did I already mention it took under 3 months from start to finish?), there were 9 core questions

1. Will it work?

2. Will it be ready in time?

3. Will it be secure?

4. Will it be easy to use?

5. Will it be fast?

6. Will it be stable?

7. Will it be scalable?

8. Will it be re-usable?

9. Will it be extend-able?

From gtug_blog

Will it work? Yes!

By using Linux, and a baseline API for accessing all peripherals we were able to support 8 different types of fingerprint scanners, any video camera supported by Linux (for the Photo capture), and over 3500 printers (we had at least 2000 HP printer drivers installed!)

Will it be ready in time?

Good programmers thrive when working with impossible deadlines. We had a ‘healthy’ set of milestones and an incredible amount of pressure, not to mention the negative articles in the media.

Nights turned into days and the only other times we were not in front of our laptops or white-board, we were crashed out. We drew up feature quadrant – Must Have, Should Have, Could Have, Good to Have. With lots of feedback, criticism and insight from people who were around during the previous exercises we got a pretty clear idea of where each ‘brilliant’ feature went and the direction.

Will it be secure?

128 Bit Encryption. Built with fraud in mind. Used a white-list approach. Restrictive, but works like magic. Every bit (or byte if you choose) of data was encrypted – inside and outside the machine. Since there was no possibility of network coverage, the only other option was to use a removable drive to backup and transfer data – using the encrypted file-system support in the Linux kernel to protect the data and additional hashing algorithms to detect any unauthorized modifications during transfer.

Will it be easy to use?

After one of our demonstrations, a security guard sat in front of the machine and registered himself without supervision. In programmers lingo, there’s this thing called KISS. Keep It Short and Simple (there are other less polite versions). The KISS principle states that simplicity should be a key goal in design, and that unnecessary complexity should be avoided.

Effectively and intensely training 240,000 operators to learn how to use a software within a short space of time is a really difficult task.

With this understanding and knowing that the operators would have varying degrees of computer-literacy, anything that was NOT downright obvious and intuitive was considered unusable.

Will it be fast?

Our target was a maximum of 8 minutes per individual. We ended up with 4minutes (less really). A lot of things were sent to the background and managed to pull 1260 comparisons per second.

Will it be stable?

Linux prizes itself in its stability. Even when operated under ‘hectic’ conditions for extended periods of time. We had our fare share of untrappable interrupts from hardware devices which kept crashing the software. There was also the expected hardware faults. Crashed hard drives, faulty backup removables, motherboards burnouts, broken screens, faulty keyboard, corrupt boot sectors – a mile-long list of things that could possibly happen to render a system unusable after it’s been on the field and been used to capture a few hundred people.

We had a two-pronged approach. First ensure the system itself is as stable as possible – a barrage of tests of extended use with a large amount of data. Two, in the event of a failure, use the Swiss Army Knife – the OpenVR Recovery DVD. We created a DVD containing tools specifically customized for

a purpose – recovering data and restoring broken machines without data loss. The ability to recover data when everything else has gone wrong – we think this was a critical singular component and success factor in the OpenVR deployment.

Will it be scalable?

What happens when you have 10 people registered? Or 250 or 500 or 2000? Will it slow down at all? Or slow down considerably or crash outright? Will it make use of the multitasking/multi-threading capabilities of the underlying hardware? Will it handle growing amounts of work and features in a graceful manner or not?

First we identified the bottlenecks in the system – Fingerprint – AFIS. When a fingerprint is captured, we need to compare that finger against the existing database of fingerprints to check for multiple registration. The larger the database, the longer that process will take. Initially we had a sequential process – the search ran in a straight sequence – like going through (potential) records from id 1 to id 300. Instead we break up the records into sets, with each set containing a number of records – 30 for example and run a threaded process against each set. The size of each set and comparison is determined by the underlying hardware – processor, memory (free memory) and very importantly – the true multitasking features of the Linux operating system.

Will it be reusable?

It needed to be – for continuous registration and for similar implementations.

Will it be extend-able?

We needed to be able to make changes to the software – out there on the field- on 120,000 machines. And we needed to update the machine, change the way it operated, fix bugs with minimal user interaction and without data loss. If we lived in a connected environment – Internet, that would have been a walk in a park.

However, there’s no Internet. No network coverage. The GSM networks effectively cover less than 60% of the country, not to talk about how much of that amount can carry data consistently. Beyond software updates, we also needed to transfer all registration data from each machine down to the central database at the state level. Therefore using a network would have been prohibitively expensive. So we made the entire software – including the operating system itself PATCHABLE. We used Sneaker-net – the transfer of electronic information, especially computer files, by physically couriering removable media such as magnetic tape, floppy disks, compact discs, USB flash drives, or external hard drives from one computer to another. We created patches (encrypted archives as well) that work just like a virus – except that it needed users to click the Update OpenVR. This came in especially handy after the first four days of registration that was the most trying period in the entire exercise. Nothing worked as expected.

From gtug_blog

What helped, what worked and what didn’t

What helped?

Immense feedback and ideas from the ICT department in the commission, and technical advisory from IFES (International Foundation for Electoral Systems), and UNDP (United Nations Development Programme). This helped in clearing up the gray areas and think through the best approach in each scenario.

The most used phrase? : It’s not working.

Anticipate problems. Because they will come. Every time we were reminded of Murphy’s law: “Anything that can go wrong will go wrong”.

If you perceive that there are four possible ways in which something can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop.

From gtug_blog

All of 3 months – that’s all it took for 3 young and determined programmers, 1 brilliant architect, 1 persistent project manager, 1 intuitive designer and 1 knowledgeable biometric expert to build the entire OpenVR from scratch and deploy for the voters registration exercise. And we did it for free.

This is the biggest Open source effort (and Linux Based effort too) yet to come out of Nigeria – and Africa as a whole. Disruptive technology. That’s what this is all about.

We strongly desire the growth of the software industry here in Nigeria and Africa. It is our passion and love for our country that was the fuel that drove us to succeed and even exceed expectations in many aspects.


Partner at INITS Limited, a firm specialized in creating custom desktop solutions and web apps.

Ardent C++ and PHP Programmer.

Over 9 years of experience creating applications.

Heavy Linux user.

Things to have in mind as the deadlines for the Google Android Challenge Approaches

As the deadlines for the Android Challenge approach we should bear the following in mind:

July 1st is the first deadline, this means that latest by this weekend, you should have settled on your ideas as you will have less than a month to put it all together for the first submission (which is less than a day in developer land)

If you feel that your project idea is small enough for just you or a small team (that you should have already selected) to work on then you are good to go and should have already gone far in hashing out your app.

If on the other hand you think that your idea is something that is bigger than you given the timeframe, you may want to consider looking for team mates that would help you acheieve your goals faster. Several of us have put up links that can help us put our ideas out there and source for team mates (remember, time is short, you should have finished this step by now, in case you have not, you can look here and here),

If your team has three or more members, you may want to look at ways in which you can work together remotely. A good idea would be to set up a repository online (you can use git or any one of your choosing depending on your needs)

Again if you are in a team and like many people are tied up in school work or work-work and can hardly find time to collaborate, you may want to consider organizing a mini-hackathon preferably on weekends to get things rolling. This will come in particularly handy in the initial stages of the project as you struggle to overcome inertia.

Depending on what the response is, the Lagos GTUG could organize a hackathon for interested parties to polish up their code sometime after G-Nigeria where we could try and get our resident Android gurus to assist those who may have questions as they code.

Again, if you are in a team or trying to form one, remember that you may need more than just android skills in your project, particularly if your project has a cloud component. Skills like PHP, python, J2EE, html and even technical writing (yes, documentation is key) could come in handy.

Also take out time to learn the best practices in Android application development, many of them are spelt out in the videos on the Anroid developer challenge CD. Like we said before, a limited number of these CDs are available for collection/copying. For information on how to get/copy it send an email to gtuglagos@gmail.com. Note that the contents of the CD are also available online, so if you have a fast internet connection, you can also download the content online.

We would like to wish everyone well as they embark on their projects, looking forward to seeing interesting submissions.

Anrdroid Challange Open House, Unilag

The Lagos Google Technology User group (Lagos GTUG) held its Andorid focused open house on Saturday the 23rd of April 2011 at the Centre of information Technology Systems in the University of Lagos. It was a well attended event with 57 attendees. The attendees included people from Ibadan and our neighboring GTUGs (Akure and Abeokuta).

From Lagos_GTUG_AndroidSSA

The event kicked off at about a quarter past three in the afternoon with a welcome address from Emeka Afigbo, the manager of the Lagos GTUG. who explained what the event was all about and ran through a the agenda for the day. He then handed the mic to our first guest speaker Chinedu Efoagui, a developer with System Specs who took us through a lecture on Google Maps to whet the appetite of the audience in prepration of things to come.

From Lagos_GTUG_AndroidSSA

The lecture covered the basic aspects of Google Maps such as :

  • Proximity Detection.
  • Geocoding.
  • Directions Services
  • Calculation of Distance
  • Markers (Clustering),InfoWindows,polylines.
  • Location Detection.

One good thing about the presentation was that he gave us insights as to how to apply Google Maps which brought to light that fact that many applications of Google Maps did not need to have a map displayed.
He also showcased a site that he had created: The Very Place that applied a number of features of Google Maps.

From Lagos_GTUG_AndroidSSA

Next up was the Android Trivia Quiz, where the audience had to split themselves into groups of 8 and answer 21 questions on relating to the Google Android Platform. As Emeka reeled out the questions, team members scrambled to provide the answers. After all the team members had submitted their answers, we moved on to the high point of the occassion which was a talk introducing the Google Android platform delivered by Bolaji and Bobola of the Fans Connect Online Team. Their talk covered the introductory aspects of the Android platform and also how to use the Android SDK to develop a “Hello World” application on Eclipse. They also gave us some useful tips and tricks to use when developing Android applications such as the android garbage collection model. They then took us through an Android application which they had developed called Naija Places.
After the talk it was finally time to announce the winners of the Android quiz and the honors went to the Minders team.

From Lagos_GTUG_AndroidSSA

For their troubles the eight team members each left the event with special branded Android T-Shirts.
The last talk was by Emeka who took the audience through an overview of the Android Challenge which included things like:
What the challenge was meant to achieve
The prize money (obviously!)
The important dates
. The audience was encouraged to form teams so as to stand a better chance of winning.
Attendees went home with some branded Google goodies such as Android stickers, bags and key holders to cap off a fun filled evening
We would like to thank the following for making the event possible:

  • Google for all the swag and support
  • Staff of the CITS in the University of Lagos for being there even on Easter Saturday
  • Chinedu Efoagui for his talk and helping with some of the pictures and videos
  • Bobola Oniwura , Bolaji Olawoye and the rest of the Fans Connect Team for their talk and support
  • Parkway Projects Ltd for sparing some of their staff to make this event happen
  • and White Chapel and Partners for handling a lot of the logistics

You can see the slides from the Open House here

Pictures of the event are available in the picasa album below:


You can also see some videos of the event below:

What to expect at the Lagos Google Technology Open House on 23rd April 2011

Its almost here people, the much talked about open house that will pave the way for the Big One (G-Nigeria)
will be taking place on the 23rd of April at the University of Lagos at the Center for Information Technology.

Like we have said earlier, the event will be focused on Android and mobile technologies (with a trickle of other Google technologies thrown in)
As usual , the event promises to be a great forum for networking and keeping up with the latest in Google and Open source technologies.
The Program will be as follows:

  • Welcome Address and General Introductions
  • Android Trends & Brief Discussion based on a special announcement from Google
  • Talks on Google Android from subject matter experts including Fans Connect Online (developers of the Naija Places Android Application)
  • A talk on Google Maps from Chinedu Efoagui (developer of theveryplace.com)
  • Refreshments & Networking

Who is invited?

  • Mobile developers , android fans and of course people who are interested in Google Technology.
  • Students will be required to register online at http://sites.google.com/site/lagosgtug/

What do i need to come with ?

  • Yourself (compulsory)
  • As much knowledge about Android as my brain can carry (Compulsory)
  • Laptop with internet connection (optional)
  • Flash drive for copying code and tools (optional)

How long would the event last ?
Kick off time is 3pm prompt and we intend to be there for at most 3 hours. So we should be done by 6.00pm

We look forward to having you there…it will be fun

Google Technology Open House 23rd April 2011

Its happening again folks!
We are finalizing arrangements for the next Google Technology Open House in Lagos.
It will be taking place in the same venue as the last one (University Of Lagos Akoka).
The theme for this open house will be centered around mobile applications and the Android platform.
So make sure you keep 23rd of April free….and we gurrantee you that you will not regret it!

Enter the Google Map

Our guest blogger Chinedu Efoagui is a Sun Certified Java Programmer as well as a Sun Certified Business Component Developer with a Masters degree in Computer Science from the University of Hertfordshire. He is very passionate about technology and envisions a world entirely driven by it.

His interests include Object Oriented Analysis and Design, Java/.NET technology, Functional programming, Database technology and Open Source efforts.

When he is not fooling around with his computer, he likes to analyse chess games and write fiction.




Pretty Fast Internet Connection.

JQuery 1.4+

Assumed Knowledge of XML, XSLT, JavaScript


Google Maps is an exciting technology. Since it was first lunched, it has been applied in lots of interesting ways e.g. in measuring actual sizes of buildings to resolving border conflicts! Over the years,I have had very good experience using Google Maps . I developed http://www.theveryplace.com/ – a website that uses a lot of Google Map features which give users the ability to get driving instructions and other location based stuff. Anyway, this blog entry won’t be as far reaching in showing what can be achieved using Google maps.

Before we go to the sample application proper, let me follow tradition and display a “hello world” example. We will be using JQuery- a popular JavaScript library, to simply the code. To run the hello world example, copy and paste the code below and view it on your browser. Also, you can just open the hello.html included in downloadable sample app.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>



<title>Ezenna Group of Companies Ltd</title>

<style type=”text/css”>
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#zamap { height: 400px,width:600px}

<script type=”text/javascript” src=”js/jquery.min.js”>


<script type=”text/javascript”



<script type=”text/javascript”>

$(document).ready(function () {



function showmap(){

//Lagos Nigeria

var latlng = new google.maps.LatLng(6.43616,3.41647 );

var myOptions = {

zoom: 12,

center: latlng,

mapTypeControlOptions: {

style: google.maps.MapTypeControlStyle.DROPDOWN_MENU


mapTypeId: google.maps.MapTypeId.ROADMAP


var map = new google.maps.Map(document.getElementById(“zamap”), myOptions);




<body><div id=”zamap” ></div></body>


Step 1.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN” “http://www.w3.org/TR/html4/strict.dtd”>

The strict XHTML declaration instructs the browser to show the html document as is so the browser load the page faster than transitional declaration for instance because there is no extra step of validating html document.

Step 2.

{ height:
{ height:
100%; margin:
0px; padding:
#zamap { height: 400px,width:600px}

The CSS describes how the html document will be shown. the height, margin and also describes the height and width of the <div id=”zamap”> which acts as a placeholder for our map.

Step 3.

<script type=”text/javascript”



This script tag loads the Google Maps Api necessary to create the map and version is 3.2 and sensor is false which means that the device does NOT use a sensor e.g. GPS to detect the user’s location.


$(document).ready(function () {



What this JQuery function pretty much does is execute any function or code after the entire HTML document has been fully rendered. In this case it runs the showMap function which has the instructions to create the Google Map. Note: Don’t forget to load the JQuery like so.

<script type=”text/javascript” src=”js/jquery.min.js”>


var latlng = new google.maps.LatLng(6.43616,3.41647 );

Inside the showMap function, the first step in creating a Map is to declare the latitude and longitude coordinates of the location, in this case, the city of Lagos Nigeria. The latlng of the location (Lagos) has already been got through a process known as Geocoding. Google Maps comes with that feature but I won’t talk about it since it is beyond the scope of this blog. If one doesn’t know what latitude and longitude are then you might want to get a geography lesson or better still google it.

Steps 6.

var myOptions = {

zoom: 12,

center: latlng,

mapTypeControlOptions: {

style: google.maps.MapTypeControlStyle.DROPDOWN_MENU


mapTypeId: google.maps.MapTypeId.ROADMAP


Step 7

var map = new google.maps.Map(document.getElementById(“zamap”), myOptions);

Takes the initialization settingstored in the myOptions variable, and id of the div which we get the reference of via the document.getElementById method and loads the MAP on the div.

<div id=”zamap” ></div>

Remember the DIV acts a placeholder for the Google Map.

The Options variable holds the Map initialization variables like the “zoom”. “Center” indicates the actual location from the latlng coordinates. “mapTypeId” here is initialized as “RoadMap”., there are other options like terrain , satellite, hybrid. “MapTypeControlOptions “shows the MapType options as a dropdown menu if one wishes to conserve space.

Behold The Map!

Figure 1 showing the Google Map

If you can see the image above then congratulations, for creating your first Google map.

Right now the Map does not look like much. It just shows Lagos. We will now proceed to adding a marker to indicate exactly where we are in Lagos.

//adding a marker

var marker = new google.maps.Marker({


map: map,

title: “I am here!”


The piece code displays the marker on the map by setting the position to the latlng coordinates and the map to the map variable and we will create a title for the marker.

One can change the marker icon. That I will illustrate in the sample app so stay tuned.

Hover your mouse above the marker to see the title.

So see the marker below:

Figure 2 showing a marker

Now I promised a hello world example and not a “I am here” so we will take the tutorial a notch up by display an Infowindow with the Famous words.

//add an infowindow

var infocontentDiv = ‘<div id=”content”>’+

‘Hello World!’+


var infowindow = new google.maps.InfoWindow({

content: infocontentDiv


//event listener to open the infowindow on click

google.maps.event.addListener(marker, ‘click’, function() {



The variable infocontentwindow holds the content we would like to display.

google.maps.InfoWindow creates an Infowindow and uses the infocontentwindow as its content.

Since we want the infowindow to open when the marker is clicked on, we add the event listener to the marker.

Click on the marker and VOILA! The infowindow pops up with the”Hello world” message.

Figure 3 Showing the “Hello World” Infowindow

Now I will illustrate the following Google Maps capability such as detecting user location, populating several locations on a single map using a sample project as a case study. This application will be called “Ezenna Group of Companies”. Legend has it that Ezenna as a typical Igbo man, had so many businesses scattered all over the world. Since they were so many, he forgot the whereabouts of some of them. Fortunately for him, he met an I.T consultant who advised him (at a huge cost) to get a directory of all his businesses so they will easy to find. I won’t tell you who the consultant was; I am sure by now you have a pretty good idea.

To make everything simple, the data of Ezenna’s business will be stored in xml instead of a RDBMS.

See below at a snippet of the xml

<STORE id=”1″>

<NAME>YouLike Clothes</NAME>

<DESCRIPTION>Best collection of designer clothes and accessories. Cool Perfumes, watches in stock.</DESCRIPTION>




<Address>No 12 Aba Road, Port-Harcourt</Address>








It contains attributes describing store such as name, description, location and so on. We shall employ JQuery to load and manipulate our XML data to show all the locations on the map. So enough talking, let’s see some code.

$(document).ready(function () {

// showmap();








We use the ajax to asynchronously fetch the xml data.

To loop through the data, we use find method to get all the <STORE> tags and iterates through and initializes the Store properties leike name,description and so on.


var id=$(this).attr(‘id’);

var name=$(this).find(‘NAME’).text();

var description=$(this).find(‘DESCRIPTION’).text();

var type=$(this).find(‘TYPE’).text();

var lat=$(this).find(‘LAT’).text();


We create the Map the usual way then add the

var bounds = new google.maps.LatLngBounds();

// Extending the bounds object with each LatLng

bounds.extend(new google.maps.LatLng(lat,long));

// Adjusting the map to new bounding box


The bounds object adjusts the map so that the different markers fit inside the bounds being passed to it.

var marker = new google.maps.Marker({

position: new google.maps.LatLng(lat,long),

map: map,

title: name


The title of the marker is set to the name property of the <STORE> tag.

Figure 4 showing all of Ezenna’s stores

The Ezenna’s stores are shown on the map but there seems to be different the type of stores on the map.
So we change the marker code to reflect the marker image we’ve got.

var zapic=$(this).find(‘LOGO’).text();


recycleh = new google.maps.MarkerImage(imageloch);

// Adding the markers

var marker = new google.maps.Marker({

position: new google.maps.LatLng(lat,long),

map: map,

icon: recycleh,

title: name


Figure 5 Showing different set of Marker Images

The icons can be downloaded here from this URL. http://code.google.com/p/google-maps-icons/

Meanwhile, the rest of the Store properties are set on the InfoWindow. As shown below with Zoom In and Zoom out link configured on it.

var infocontent=document.createElement(‘div’);

var title=document.createElement(‘strong’);

title.innerHTML =name;

var descriptionlink = document.createElement(‘p’);


var breakr = document.createElement(‘br’);

var plink = document.createElement(‘p’);

var websitelink = document.createElement(‘a’);

websitelink.innerHTML = ‘Website’;

websitelink.href = “http://www.theveryplace.com”;


var a = document.createElement(‘a’);

a.innerHTML = ‘ Zoom In’;

a.href = ‘#’;

// Adding a click event to the link that performs

// the zoom in, and cancels its default action

a.onclick = function() {

// Setting the center of the map to the same as the clicked marker


// Setting the zoom level to 15


// Canceling the default action



var zoomout = document.createElement(‘a’);

zoomout.innerHTML = ‘ Zoom Out’;

zoomout.href = ‘#’;

// Adding a click event to the link that performs

// the zoom in, and cancels its default action

zoomout.onclick = function() {

// Setting the center of the map to the same as the clicked marker


// Setting the zoom level to 15


// Canceling the default action



// Appending the link to the second paragraph element




// Appending the two paragraphs to the content container






// Setting the content of the InfoWindow


This piece of code set the zoom level as the bounds are increased .

var listener = google.maps.event.addListener(map, “idle”, function() {

if (map.getZoom() > 16) map.setZoom(16);



Figure 6: showing the infowindows.

If we click on ZOOM IN .We get to see what is shown in the picture below.

User Location detection

Detecting a visitor’s location to one’s website is useful feature and has many applications in fraud management for example if the user’s credit card address is far from the location at which transaction is being carried out would be an indication of high risk transcation. Also one can get useful analytics to the demographics of one’s website visitors.

To detect user’s location, one can use gears, browser based geolocation or Ip based geolocation. Ip based geolocation is the least accurate.

To use gears, one needs to add the script tag to the header of the web page

<script type=“text/javascript”



For IP-based

One could use The Google API for

// Getting the position

if (google.loader.ClientLocation.latitude && google.loader.ClientLocation.longitude) {

// Defining the position

var latLng = new google.maps.LatLng(google.loader.ClientLocation.latitude,


From my experience, I found out that Google’s client location though is bit more accurate than other offerings but in the case of Nigeria, it returns null on most IP addresses so I decided to switch to a different ip-based geolocation provider.

I assume they depend on your Google Key for something because it is one of the parameters needed.

You can get it here http://www.maxmind.com/app/geolitecity

<script type=“text/javascript” src=“http://ip-geo.appspot.com/geo_data.js?key=ABQIAAAAB1D5xVb4mI8xxT8KFKKwzRSErSB8v-HR33wr-yJFmv6d0Y_MuhTMyw2HB3rb_IKp1nyiWRjlYETbtA”>


Either way, IP-based geolocation is not very accurate. Actually, they are the least accurate as seen it the picture below which shows my location as Ikeja while I am on the Lagos Island.

Some smart mobile phones have GPS which provide very accurate location. Also GSM cell sites use triangulation to determine one’s position.

The Geolocation API specification is found at www.w3.org/TR/geolocation-API/.

To use the standard browser based geolocation API download the geo.js file which is the W3C standard. Please note that Internet explorer does NOT support this.

if (geo_position_js.init()){

geo_position_js.getCurrentPosition(setPosition, handleError,{enableHighAccuracy:false,options:6000});


To get around any of the hiccups associated with the lack of I.E support, Google Gears becomes a good alternative. Although, one of the problems of gears is that it is not ubiquitous. User geolocation with Gears is quite accurate as in shown in the picture. As at the time of writing this blog , I was at Lagos Island and voila , Gears shows me on the Island exactly.

To include Gears add this to the header of your webpage

<script type=”text/javascript”



Then the following option to your control flow.

if (google.gears) {



function UseGears() {

browserSupportFlag = true;

var geo = google.gears.factory.create(‘beta.geolocation’);

geo.getCurrentPosition(function(position) {




If you are concerned about privacy issue concerning auto detection of your location, don’ be since you will have to accent to any of it.

Therefore as a rule of the thumb one should use Ip.based Geo-coding as a fall-back and either Gears or the W3C standard as the first options as shown in the sample code.

Next Steps

So we have learnt how to detect user location, transverse through xml data with JQuery, show multiple locations on a map. Some nice features I left out are getting driving directions to any of the Ezenna stores and proximity detection i.e. showing the user, the nearest Ezeani Store to the user’s location. You may want to look at see below for a working example of calculating distance between two coordinates [1]

For example, Murtala Mohammed Airport Coordinates are

Latitude= 6.57722, Longitude 3.32111

Great Circle Distance Formula using radians:

3963.0 * arccos[sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 – lon1)]

If you do NOT first convert the latitude and longitude values in the database to radians, you must include the degrees-to-radians conversion in the calculation. Substituting degrees for radians, the formula becomes:

Great Circle Distance Formula using decimal degrees:

3963.0 * arccos[sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) * cos(lon2/57.2958 -lon1/57.2958)]


r * acos[sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 – lon1)]

Where r is the radius of the earth in whatever units you desire.
r=3437.74677 (nautical miles)
r=6378.7 (kilometers)
r=3963.0 (statute miles)

One can see all these concepts on display on this website –


Get the source code for the example


1. Wikipedia http://en.wikipedia.org/wiki/Great-circle_distance

2. Google Maps Api http://code.google.com/apis/maps/documentation/javascript/

3. Developer Guide http://code.google.com/apis/maps/documentation/javascript/basics.html

4. http://code.google.com/apis/maps/documentation/javascript/overlays.html

5. Beginning Google Map API 3, Gabriel (Svennerberg, 2010)

6. W3C, www.w3.org/TR/geolocation-API/.


Why Should I Use Google Big Table or any non relational database for that matter?

One of the very first things that comes to a web developer’s mind when faced with the option of developing an application on
Google App Engine is the fact that the database is non relational and also that you cannot instantly do “Joins” on your data!
At first glance this seems like a major bottle neck but then it all begins to make sense once you get one thing straight and that is :
Non-relational databases (Google Big Table, CouchDb, Mongo etc) are not nessecarily a one size fits all replacement for relational Databases (e.g. My SQL, Oracle, SQL Server) .
They each have situations to which they are best suited and once you have understood that, life becomes a whole lot easier.
Having said that, there are developers who have sworn to stick to one side of the divide (relational or none relational ) and as such have done everything within their power to adapt their applications to their databases of choice.
So the big question is: When is it best to use a non-relational database like BigTable ?
Well…the answer varies depending on who you talk to, but some digging around the web yielded the following answers:

  • Your data is stored and retrieved mainly by primary key, without complex joins.
  • You have a non-trivial amount of data, and want to avoid the pains of RDMS management such as Replication etc
  • Your data mirrors a real life document or log/audit trail (e.g. a ticket, a receipt or even an invoice) whose contents will not change once it has been created and/or is used in an “append-only” mode

Another possible reason is if you have a strong suspicion that your database will NOT age gracefully (see http://push.cx/2009/rules-of-database-app-aging )
Putting the above scenarios together could result in the following picture:
You have to build an application that underneath is very simple in structure, but will potentially handle a lot of data with high traffic and you want to be able to retrieve data from this application using a primary key and/or also some key words/tags (a many to many relationship). Such an application is a good candidate for a database such as BigTable.

Of course like was said earlier a lot of developers have over the years found ingenious ways to use non-relational databases to achieve a lot of the things that are currently being done with relational databases today.
Also suffice to say that Google has unleashed App Engine for Business and in the second quarter of this year this will support hosted SQL databases. This initiative will make it easier for business to migrate their business applications and databases to the Google Cloud.



It would be interesting to hear from you about situations where you have considered moving from a relational database to a non-relational database and vice versa.
Here are some articles that should make interesting reading:



What could the Microsoft – Nokia Collabo mean for Android?

If you have not been living on the cyber moon and if you have not been so bogged down by work or play that you did not have time to scan the web (which is the same thing as saying that you have been living on the cyber moon), then i am sure you have heard about the recently announced partnership between Nokia and Microsoft.
If you have not heard or read about it , you can quickly bring yourself up to speed by reading the announcement from Microsoft’s site.
In case you do not want to read through the whole thing, here are the highlights:
Nokia and Microsoft are engaging in a partnership such that:

” 1.) Nokia would adopt Windows Phone as its principal Smartphone strategy, innovating on top of the platform in areas such as imaging, where Nokia is a market leader.

2.) Nokia would help drive the future of Windows Phone. Nokia would contribute its expertise on hardware design, language support, and help bring Windows Phone to a larger range of price points, market segments and geographies.
3) Nokia and Microsoft would closely collaborate on joint marketing initiatives and a shared development roadmap to align on the future evolution of mobile products.
4.) Bing would power Nokia’s search services across Nokia devices and services, giving customers access to Bing’s next generation search capabilities. Microsoft adCenter would provide search advertising services on Nokia’s line of devices and services.
5.) Nokia Maps would be a core part of Microsoft’s mapping services. For example, Maps would be integrated with Microsoft’s Bing search engine and adCenter advertising platform to form a unique local search and advertising experience
6.) Nokia’s extensive operator billing agreements would make it easier for consumers to purchase Nokia Windows Phone services in countries where credit-card use is low.
7.) Microsoft development tools would be used to create applications to run on Nokia Windows Phones, allowing developers to easily leverage the ecosystem’s global reach.
8.) Nokia’s content and application store would be integrated with Microsoft Marketplace for a more compelling consumer experience.”

Most of the commentary i have seen online touts this as Nokia’s reaction to the threat of the IPhone. However it was after reading this article that another angle became a bit evident (thanks Tunde for the Facebook post!)
The main gist of this article is that with this move a lot of Symbian developers will be left without a platform in the coming years and as such the developers will be left with a number of options:

A.) Migrate with Nokia to Windows (How many pure blooded Symbian developers will do this is anybody’s guess)
B.) Migrate to IPhone (An attractive choice as this platform has probably the biggest appstore around)
C.) Migrate to Android (An upcoming platform, but perhaps the most open of all the options
D.)Migrate to BlackBerry another platform of choice
E.) Give it all up and start maintaining blogs like this one (That’s what I would choose:-D)

So what’s the point of this little piece?
The thing is that with so many mobile platform developers pondering their future over the next 6 months, the battle for their souls will soon start in earnest and it is just possible of all the options, Android being the most open of them might be the most attractive. Of course this depends on how Google chooses to play the game and also on what the android community does to welcome in these developers from the cold.
Only time will tell…..
We are watching.