Archive for the ‘University’ Category

UK Universities – Android App (Week 1)

Saturday, May 29th, 2010

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.

Checking in…

Thursday, January 14th, 2010

My first semester back at University is almost complete, only two assignments (both completed) to hand in and then I’m done!  This semester has been quite easy, I’ve had to do 6 assignments in total, 4 in Java and 2 in .Net.  All the projects have been to create some kind of application, be it for a company who’s employee hierarchy resembles a pyramid scheme but overall nothing too hard.  At the end of it all, I can say I know Java, which opens the way for some Android development when the GooglePhone/Nexus One comes to the UK.

A couple of posts back I said I would learn C++ whilst learning Java.  I can honestly say this never happened, however I don’t see learning the language a challenge anymore.  One day I will finally get to program something in this language but I wont be going out of my way to do something in it.

A new year has forced me to get back into a exercise regime again.  So far I’ve been good and eventually I might be able to report some losses or gains.  My goal at the moment is to try and stay the same weight but lose some fat in exchange for muscle.

Onto work… The new year saw me working from home for the first time thanks to the weather (constant snow since Christmas).  A very different experience compared to working in a office (how do people work from home?) I will not miss it.  We have started a couple of new projects, both based in PHP using SOAP connected to a MySQL database, Good fun!.  Negotiated a pay rise over MSN :) and a bag of holidays left to take.

Thats it for now.

/*And God Said:*/ World mWorld = new World();

Saturday, December 12th, 2009

Ok so blogging isn’t really up there with my priorities. This just means I write more less often.

My semester at Uni is nearly over, only a couple of weeks left followed by a short break and i’ll be starting the next semester. The most interesting thing i’ve learned so far this year Object Orientatation. When I started my job at 3DPixel.net my first project was using PHP and OO techniques and I can honestly say I didn’t understand most of it at first but now it all makes sense.

I’ve started on a new personal project (http://rentopoly.com) to pass the time (when I have free time) which is a website targetted at students and landlords looking to rent properties. I will be using my new found knowledge of OO to build the website.

I have so far created one object which I think could be interesting for other people to use. This object connects to Yahoo! MapService API to resolve an address (via Curl) into geo latitude and longitude data. This is usefull if you need addressing lookup without having to purchase data like that supplied by the Post Office (PAF File).

To use the object;

$myAddress = new Address("House and Street Name", "Locality", "City Town", "Postcode");
echo $myAddress->getLatitude();
echo $myAddress->getLongitude();
/* You could also use the object to display address information */
echo $myAddress->getAddress1();
echo $myAddres->getCity();

You can use this with GoogleMaps to place a marker on a map.

Full object source.

 /*
 * Creates an address object
 * See - http://eighty-six.co.uk/blog/2009/12/oo-techniques/
 * @author Damon Skelhorn 
 */
class Address {

	private $postcode;
	private $address1;
	private $address2;
	private $city;
	private $longitude;
	private $latitude;
	private $url = "http://local.yahooapis.com/MapsService/V1/geocode?appid=yourapikey";

	function __construct($address1, $address2, $city, $postcode){
		$this->setAddress1($address1);
		$this->setAddress2($address2);
		$this->setCity($city);
		$this->setPostcode($postcode);
		$this->resolveAddress();
	}

	private function resolveAddress() {
		$stream = "location=" . $this->getAddress1() . ",".$this->getCity() . "," . $this->getPostcode() . '&output=php';
		$res = $this->fetchPage($this->getUrl(), TRUE, $stream, '');
		$res = unserialize($res);
		$this->setLongitude($res['ResultSet']['Result']['Longitude']);
		$this->setLatitude($res['ResultSet']['Result']['Latitude']);
	}

	private function fetchPage($url, $ispost, $params, $auth){
		if(!$ispost && $params) $url .= '?' . $params; //if not post and params (ie, if it's a get)
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
		if(is_array($auth)){
			curl_setopt($ch, CURLOPT_USERPWD, $auth['username'] . ':' . $auth['password']);
			curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
		}
		if($ispost){
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
		}
		$result = curl_exec($ch);
		curl_close($ch);
		return $result;
	}

    public function getAddress1() {
        return $this->address1;
    }

    private function setAddress1($address1) {
        $this->address1 = $address1;
    }

    public function getAddress2() {
        return $this->address2;
    }

    private function setAddress2($address2) {
        $this->address2 = $address2;
    }

    public function getCity() {
        return $this->city;
    }

    private function setCity($city) {
        $this->city = $city;
    }

    public function getPostcode() {
        return $this->postcode;
    }

    private function setPostcode($postcode) {
        $this->postcode = $postcode;
    }

    private function getUrl() {
        return $this->url;
    }

    private function setUrl($url) {
        $this->url = $url;
    }

    public function getLatitude() {
        return $this->latitude;
    }

    private function setLatitude($latitude) {
        $this->latitude = $latitude;
    }

    public function getLongitude() {
        return $this->longitude;
    }

    private function setLongitude($longitude) {
        $this->longitude = $longitude;
    }
}
?>

Back to University – A New Language++

Sunday, September 6th, 2009

I’ve recently got hold of my timetable for this years first semester at University and I’m quite excited!¬† My first year at uni was great, I really enjoyed everything I did except one subject which I felt was completely unrelated to what I was studying.¬† Anyway..¬† this year I will be studying Java along with more VB.Net and programming and design.¬† I have two lecturers which I had last year which is good as I enjoyed their classes.

Java has been something I have never really looked at in great detail, actually – in any detail at all so learning a new language is quite exciting.¬† Whilst studying Java and VB.Net at University, I will also start to study C++ in my own time.¬† I’ve always wanted to learn C++ however its syntax has always put me off in the past.¬† But with my new found experience with C languages (mainly Perl and PHP) which I have gained from working at 3DPixel.Net I’ve made the commitment to learn this language once and for all –
cout << “the basics anyway\n”;

In the past, I’ve only ever concentrated my time using a single language – this being VB.Net for any type of project.¬† Don’t get me wrong, I like using VB.Net simply because its quick and easy to use, however, is there really a demand for a VB.Net developer in the industry?¬† Surely a programmer that can write in a C language is sought after more? Not to mention the difference in salary.

I’ve recently forced myself away from using VB.Net with the exception of the program I am currently developing at my job and trying to use other languages instead of using VB.Net for anything that I feel the need to program.¬† Working at 3DPixel has helped me do this with project such as CheckMyBox.Net which was created in Perl (the backend anyway).

I’ve used VB since I was around 13, starting out by creating various chat bot programs for AOL, thats almost 10 years of using VB. Most recently (the past 3 years) I made the jump to VB.Net. This istelf was quite a challenge at the time considering I almost gave up on the idea of programming as a career after I left college.

Hopefully, I will pick up Java and C++ without any problems as I did with PHP and Perl.¬† If all goes well, I think Objective-C is next on the plate, but (for now) I’m not saying goodbye to VB.