Sunday, 26 June 2011

Week 16 - Mobile Phones

Introduction 
This week's lesson was about mobile phone web development.In my opinion the word mobile phone has lost its original meaning as "mobile phone" is suppose to be gadget which allows a person to communicate with another person even being miles away and in different countries by the click of a button. Nowadays when people hear the word mobile phone what they mean is having in their hands the smallest gadget available, having internet connection, with a lot of applications, e-mails, facebook, games messaging, gps and any other possible feature. When mobile phones where introduced these were bigger in dimensions, probably having one in this century everyone would laugh. However people having those types of mobile phones in the past years where considered to be well off people or people having high positions at their work place.  Nowadays nearly everybody owns a mobile phone, some people even own more then on phone for instance they have two one which is for personal use and an other one for work. Also since they always want to improve quality and technology now there are dual-sim phones (phones having two sim cards)

Technology is making a point that everything will advance and be of better usage. Mobile phones now incorporated web development, making phones able to have different applications. To make good usage of websites on phones you need to have a website that is supported on phones and is easy to use without letting the user scroll to much. Applications are being made with java, javascript and also C. There are different types of mobile phones each having different brands and running different systems. Several types of phones are Apple, Nokia, Samsung, Sony Ericson, BlackBerry, Motorola, LG, HTC and many more. Also there are different type of browsers like focus, cursor, touch and multitouch browsers.

Below are certain platforms that smartphones can run on.

Microsoft - Certain phones that used this platform are Nokia, Motorola, Samsung and LG. People can now also have windows on their phone not only on their PC.

Apple - Used buy Iphones, which now a days is pretty much popular.

Android - HTC, Samsung, Sony Ericsson. Android is competing with Apple. Personally I used both Iphones and Android and for my tastes androids are on a higher scale at the moment. Android are open source.

The above platforms all use different browsers like Opera, Firefox, Android, Mozilla Firefox and others.

Coursework
This week's coursework is about an application that had to be created on a smartphone which is the geographic location. I will be doing this test on an android system.  The geolocation is a web application that one can access from his phone in order to determine his or her geographical location using longitude and latitude . Using this application will help you out where ever you are in the word. Getting lost when you are abroad is no longer an option! Below is the code that was used for the geolocation.

For starters i downloaded a mobile emulator from http://www.opera.com/developer/tools/mobile/ which allows you to test and preview web sites from your computer as if you are viewing them from your smartphone. When this application opens up, you have some settings which you can set according to your likings. You can set the profile to what phone you want and if the phone you will be using is not in the list you can edit using the custom button.



Below is the code used for the geolocation. 

1.  <html>
2.  <head>
3.    <title>Geolocation</title>
4.  </head>
5.  <body>
6.  <script type="text/javascript">
7.  navigator.geolocation.getCurrentPosition(userLocated, 8. locationError)
9.  function userLocated(position){
10.
11.    var lat = position.coords.latitude;
12.    var long = position.coords.longitude;
13.    var timeOfLocation = position.timestamp;
14.    document.write(lat + "<br/>");      
15.    document.write(long + "<br/>");
16.    document.write(timeOfLocation);
17.  
18.  }
19.  function locationError(error){
20.    alert(error.code);
21.  }
22.  </script>
23.  </body>
24.  </html>



Two important functions are seen here shown on line7:

userLocated() function - This function is used so that the current position of where the person currently is can be achieved.
locationError() function - This function is only used when there is an error. There will be an alert that there is an error
Then on lines 11 to 13 the variables are being declared for longitude, latitude and timestamp while lines 14 - 16 are being displayed.

At first when trying to make this attempt it failed. As on my phone I wasn't seeing anything but then I realized it was only because I didnt have any thing being displayed. Then I used the document.write and the longitude and latitude were displayed as shown below.


Conclusion
Mobile development is a huge improvement seeing a huge amount of people that cannot live without their mobile phone is a huge impact. When a few years back this never crossed peoples mind or people taught that most things we have today are impossible. I do sometimes think how would my life be without all this technology  and gadgets and did gadgets affect my life and others around me? The most obvious answer is yes it did. And another question that we would all have to wait for an answer is, How is the future of mobile technology going to evolve.

No comments:

Post a Comment