Is over, yay! My favorite time of the year is here.

So over summer I should have been working on my University project, I did some.  I have instead, taken residence at a local creative studio writing loads of code and sipping lots of coffee, good times!!

I have been focusing on my iOS development and as a result have done 5 news apps.  Heres the bad news, one got rejected! its nothing special or bad, just a poor attempt at an app.

Heres the list…

Big Brother 2011

Yes, Big Brother has returned so why not?  The initial version was pretty shocking cosmetically, but that was addressed in the latest update.

Check it out here http://itunes.apple.com/gb/app/big-brother-news-2011/id446685894?mt=8

This has been pretty successful thanks to having the market to myself.  Channel 5 did have word of releasing a iPhone app however none have yet appeared.

The celebrity version has just finished and the normal version is about to begin so there is life yet in this app.

F1 Rumours

Formula 1 is one of my favorite sports, so it made sense to do this.  This contained the same source code as the Big Brother app above but used a different data source.

Check it out here http://itunes.apple.com/us/app/f1-rumours/id445282041?mt=8

X-Factor

This has been a very poor performer, partly thanks to the free and official app.  Again, as with F1, BB, this has the same base source code.  I have not updated this app, so what you see here is what the initial versions of BB and F1 looked like.

Check it out here http://itunes.apple.com/br/app/x-factor-rumours/id446693498?mt=8

And finally….

As my time with the University of Bolton is coming to an end.  I have about 2 months remaining and should I complete my project, I will graduate.  I decided to give something back.

I created a simple iPhone app. This is still waiting to be released on the App store but should be available soon.

It’s pretty basic at this stage but shows both university and student news from the website, shows the university twitter account. And a cool feature, allows you to view your timetable from within the app.

Here are the screenshots.

Javascript files can get pretty messy pretty quick if you prefer to keep everything contained in one javascript file.  Together with jQuery, I find that creating objects using the literal notation form works best.

Just like any language, it’s ideal to create objects that represent something or else you’re back to square one.  An example below will show several functions which will be broken down into page specific objects.

$(function(){

	homepageFunction();
	anotherFunction();
	setSomething();
	validateForm();
	makeSaveSubmit();

});

function homepageFunction(){
	// method code
}

function anotherFunction(){
	// method code
}

function setSomething(){
	// method code
}

function validateForm(){
	// method code
}

function makeSaveSubmit(){
	// method code
}

Now, assuming the first three functions are used on the homepage and the last two on a contact page, using literal notation to create the two objects, it would look something like..

$(function(){

	Homepage.homepageFunction();
	Homepage.anotherFunction();
	Homepage.setSomething();

	Contact.validateForm();
	Contact.makeSaveSubmit();

});

var Homepage = {

	homepageFunction: function(){
		//method code
	}, 

	anotherFunction: function(){
		//method code
	}, 

	setSomething: function(){
		//method code
	}
};

var Contact = {

	validateForm: function(){
		//method code
	}, 

	makeSaveSubmit: function(){
		//method code
	}

};

This can be further improved by moving each object specific initialize code into the object itself.

$(function(){

	Homepage.init();
	Contact.init();

});

var Homepage = {

	init: function(){
		this.homepageFunction();
		this.anotherFunction();
		this.setSomething();
	},

	homepageFunction: function(){
		//method code
	}, 

	anotherFunction: function(){
		//method code
	}, 

	setSomething: function(){
		//method code
	}
};

var Contact = {

	init: function(){
		this.validateForm();
		this.makeSaveSubmit();
	},

	validateForm: function(){
		//method code
	}, 

	makeSaveSubmit: function(){
		//method code
	}

};

If you need to pass parameters to a function when using literal notation objects, an object would look like..

var Telephone = {

	ringNumber: function(number){
		// do something with the number.
	}

};

And passing parameters into the object method would look like…

Telephone.ringNumber("077123222");

If you use an IDE such as Aptana, PDT or Zend, then there is a good chance the IDE will recognize these objects.

Tip: When creating the objects, be careful with your placing of commas after a function.  If you put a comma after a function and a function does not follow, in IE you will get errors.  Firefox and Chrome are forgiving.

This is wrong.

var Telephone = {

	ringNumber: function(number){

	},  // Notice this incorrectly placed comma.

};

A not so new feature of PHP which dates back to version 5.0 is PDO (PHP Data Objects).  PDO is a data-access abstraction layer that can access several database engines whilst maintaining the same set of functions.  I’m surprised I hadn’t discovered PDO earlier considering its been around way before I knew PHP.

As part of my project, my sponsor has asked me to look into the differences between mysql, mysqli (which will replace mysql at some point in the future) and PDO methods of interacting with a MySQL database.  The following table which I stumbled upon whilst researching explains it pretty well.

Source: http://www.php.net/manual/en/mysqli.overview.php

The original mysql extension listed in the third column has a development status of maintenance only.  My interpretation of this is that at some point, in a future release this extension will be dropped, meaning it’s time to move on and use something more up to date.

The mysqli (with the i meaning improved) extension looks to be the replacement for the original extension and the preferred for new projects.

The major difference between PDO and Mysqli is (of course) mysqli is limited to a MySQL databases.  PDO is an abstraction layer which can interact with a number of databases – the complete list of drivers are here.

Reading further into the two, another key difference between the two is that PDO allows prepared statements with named parameters.

So where the following would work with both PDO and mysqli

SELECT * FROM table WHERE id = ? AND display = ?

Only the following would work with PDO

SELECT * FROM table WHERE id = :id AND display = :display

Not a great difference, however the second option would in my eyes, be the preferred method of doing a prepared statement for the sake of readability.

Therefore, for my project, I will dump the old mysql extension and handle all database actions through the PDO layer.

I had an interesting project which involved a CD-ROM containing tens, if not hundreds of thousands of Piaggio/Vespa/Aprilia parts, one of these part catalogues nicely wrapped up in some kind of stand alone Java web application, Jetty I think it was.

The task, to extract all data and images from the CD, after looking through the file system of the application I concluded the application was using a Derby database and the images appeared to be wrapped in a .res file.  I had no luck in extracting the images from these files with various tools around on the internets.  I wasted too much time trying to get the data out of these files, so I gave up.

There had to be a better way of doing this and as with most things, there was.  Some years ago, I created CraigsCrawl – an awesome project which crawled CraigsList ads and extracted data (sorry CraigsList).  Since the parts data was presented in a web interface out comes C#.

Once I targeted the information needed, I automated the whole process extracting all the ranges, catalogues, parts and images from the CD.  All data was then stored in a nice MS SQL database and the images named and saved to a folder which linked (by filename) to records in the database.  Creating the application to crawl the parts data took roughly 2-3days (on and off) and countless cups of fresh, ground, fruity coffee. The extraction only took around 3 hours.

I mainly used the WebBrowser object to extract the data and the HttpWebRequest object for some of the data which hidden behind Ajax post calls.  The coffee was sourced from Sainsbury’s, the fresh fruity beans that need grinding up.  Nice stuff.

Update:

The total number of parts that were extracted for 3 brands came to 210k! Could you imagine the time it would take to manually extract that amount of data?

I’ve just submitted my project proposal for Uni and decide to make a start collating information, then I find out Google Base is going.

Google Base was supposed to be a major part of my final year project, however it appears Google has other plans. The whole service has been depreciated and will be gone by the 1st of June.

I was going to utilise the real estate data made available, but looks I’m going to have to find another source.  The closest I’ve found that I think will work is the data supplied by Zoopla.com.  This may be a good thing considering that the data google supplied was in most cases duplicated and very old.

Sadly, this will also affect the Property Market apps that are published to the Android Market. These will be useless in a couple of month.

Lets hope Rightmove decide to go Android for the Android users out there.

Since I posted here… Heres a catch up!

I’ve since started creating iPhone, iPad apps and backed off with the Android apps.  One reason, iOS pays compared to Android.  Maybe this will change in future but for the time being, I’m sticking with iOS and plan to push out random apps!  I’m looking for that one great idea that will be truly awesome and make a fortune, my Angry Birds/TrainYard.

University

I’m now approaching my final year, I have one exam (which I have to take later today) based on the Interwebs and Asp.Net development.

Topics I’ve covered this semester;

  • Professional Issues within Computing
  • Internet 2 (Asp.Net / VB.Net C#)
  • Building Office Applications (VBA (Completely pointless!1))

The best topic will have to be Internet 2 followed closely by Professional Issues.  Building Office applications was horrible, using VBA in Excel and Access is a nightmare and if anyone designs an application in either of these, please consider fellow developers and maybe reassess your choice of development tools because anything will be better than the mess VBA/Access/Excel produces!

Thats all for now, will aim to log in more often and update.

If you have followed my blog, a couple of months ago I started to develop a Rightmove app for Android.  I got to the stage where I felt I should seek permission to release the app using the data supplied from Rightmove before I continued.  Unfortunately they refused.

Never mind..

A few week ago I started to look for a new data source that provides property data to be included in the application.  I found that data from Google.

Over the past few days I’ve been working to get the application to a preview state where I feel it’s buggy  stable enough to use.   The application is now available to download via the Android Market.

Here are a couple of images showing the application in use.

Search Results
Search

And a promo image;

Promotion

Future plans include social sharing via email, twitter etc from within the application and also launch a website that can assist with displaying the properties to non android users.

Download

Use a QR code scanner

QR Code

Manually install from the Android Market

  1. Go to ‘Market’ on your Android-powered device.
  2. Select ‘Search’.
  3. Enter ‘UK Property Market’ into the search field.
  4. Once you’ve found the ‘UK Property Market’ app, touch to install.
  5. Follow the onscreen instructions to proceed with the installation.

Another week means another Android application that I’ve managed to push out :)

This week its a UK lottery results app which obtains the latest lottery results from the interwebs and displays it all nicely on the users screen.  The application will work from Android version 1.6, so theres a good chance your handset will support it considering the current version is 2.2 .

You can download via the Android Market by searching market market://search?q=pname:com.damonsk.lottoresults or if you’re posh and have a barcode scanner

<—-

Following on from last weeks app which was launched to the market.  This week comes another app available via the market.  At this rate I may have to set up ‘a app a week’ weksite – similar to Jayekai’s A Game A Week website :)  Doubt I have the time to be able to push one out every week.

Anyway, whats this new app about.  To summarise the application listens for incoming messages and compares the text to a set phrase.  If this phrase matches, the phone activates is GPS receiver and gets the current latitude and longitude.  It then attempts to query eighty-six.co.uk in return it will be provided with a URL in which a user can visit to see the current location of the phone.  All of this information is then returned to the number that initially sent the message.

The returned messages is similar to the one below;

The application does not need to be running for it to see the incoming message, therefore all incoming messages will be seen.

There admin side to this application provides a discreet interface, so if your phone is stolen, an application with the name Hawkeye will not cause alarm, compared to a name such as ‘Lost Phone Tracker’.  The initial screen also prompts for a password which is set when you use the application for the first time.  This provides an extra layer of security whilst preventing unauthorised changes. The admin side appears as below.

If the application is unable to contact eighty-six to obtain a URL, the application will sent the message with just the latitude and longitude so your phone can always be located by other means.

Click here to see an example of the URL sent.

Get it now from the market.

Since the Rightmove app was a non-starter, I’ve decided (in my quest to publish my first ever app for a mobile device) to create something else.

I’m not entirely sure where this app will end, but the initial app will be a simple directory with some advanced features.  Using the data I collected last year for Rentopoly.com, the app will allow searching by either entering the name of a university/institue, or using GPS find universities/institues near by.

Rentopoly.com was supposed to be the rightmove but limited to only properties to let to students.  Depending on how successful Rentopoly.com is, I may include properties as a major part of this application.  Maybe this app is what Rentopoly needs to get it going.

So heres what I’ve done so far….

Initial Screen

This is the welcome screen, the first thing a user will see when they launch the application.  Its nothing great at the moment just thrown together to test the code.

The idea is, the user can either search by name or use their location.  Since searching by name is nothing special, this example shows the application using GPS to get the current latitude and longitude.

Once the coordinates have been obtained, the following screen will be displayed.

Results

The next part above is a nice list of results.  This information is downloaded from Rentopoly.com as Json, limited to within 10 miles.  An advanced feature that will be added will allow this range to be altered.

So thats what I have so far, nothing special but slowly getting back into the Java/Android thing.  Stay tuned for updates.