Geolocation with html5 and javascript

Every April, NYU holds a huge open-house event called NYU Day that draws 60,000+ visitors to the campus to view exhibits highlighting the research conducted at the university and participate in various events and activities. All of the event details are entered into a ColdFusion application, and one of those details is the GPS coordinates (latitude and longitude) of where each event is taking place so visitors to the website can see where the events are located on Google Maps.

Now that smartphones are becoming more prevalent, I wanted to see if it was possible to build a web application that would show the user where they were currently located and then show them on a map how to get from their current location to a particular event.

So I did some research and learned that HTML 5 comes with a Geolocation API. This API allows you to execute Javascript functions within the navigator.geolocation object built into the browser that retrieve the supposed latitude and longitude coordinates of where the browser is located (and, if available, the altitude, heading, and speed at which the browser is moving).

Using the code examples I found on the Gelocation API page on the W3C website and on Oliver Wehren's geolocation demo page, I was able to create my own test page for determining my location and marking it on Google Maps. I then tried using the page with my iPod Touch, and my friend's iPhone.

The default web browsers on all three devices implemented the Geolocation API ( the Dolphin Browser, did not). Each of the browsers displayed a confirmation dialog asking for permission to share my location information with the web page (as mandated by the standard), and once I permitted the information to be used, my test page was able to place a marker denoting my location on the map.

However, the location wasn't as accurate as I had hoped. Although the API was coded to accept location data from the on-board GPS system in a mobile device, neither the iPhone nor the Droid seem to provide GPS data to the browser. If I was connected to the campus wireless network, my location was determined via the network topography, and it could be off by as much as 150 feet or so. The accuracy was even worse if I was relying solely on 3G: in that scenario, but the iPhone and the Droid had me located on the side of a state road on the outskirts of campus, a good twenty minute walk from where I actually was. I have no idea what caused both devices to pick that particular spot, as there certainly wasn't a cell tower anywhere near that location.

So I came to the conclusion that while the Geolocation API could be used to determine what town, city, or general area a user was currently in, it wasn't accurate enough (at least with these browsers in these devices) to provide walking or driving directions within a small area, especially given the fact that many of the users for the service I had in mind would only have access to the Internet via a 3G connection.

But if someone knows of a way of increasing the location accuracy of the Geolocation API, a way that doesn't require the end-user to modify their mobile browser in order to make it work, I'd love to hear about it.

Keep Smiling,

Love and Respect,
Veswan

The XCODE IDE

Seldom do people describe about the Xcode IDE.It is just left out in the corner, with the expectation that people will get used to its architecture, as they go along coding, but in my personal opinion, I believe that if you know the tips and tops of your IDE, you can code in any way you desire, with proper knowledge of error producing threads and the rest. You can even detect the compatibility and leaks and consistency of the code as desired.
Let's get started.
so this is what xcode logo looks like( if you've never seen one before)

There are multiple versions of xcode, the latest one being Xcode 4 released by apple on March 23,2011.
It is a complex programming platform for iphone and ipad development, where you can build and test your apps using the various possible simulator/emulator options available with the IDE.
As you tread along the Xcode IDE, you will come across a lot of new things which you are probably not familiar with. Let us go through them step by step :

As you can see in the figure, xcode 4 is also termed as single window IDE, where you can find different options in one place.
Xcode 4 presents an entirely new user interface and workflow for developers, along with new components for compiling, debugging and finding and correcting common errors. The result: better, faster code from more productive developers.
Rather than spawning new windows to search code, debug, build, and set parameters, everything can be done within a single window that echoes components of the design of iTunes, including a LCD-like status display.

The new window presents a dismissible Navigator control (akin to iTunes' Source List), with icon tabs that can present a variety of different types of development-related information within the same window column:

* a listing of projects and files
* a symbol listing of classes and methods
* a search feature that lists project-wide results
* an issues listing of build errors
* debugging information
* breakpoints
* a listing of build logs
The main area of the new Xcode windows is devoted to the document being viewed, whether code, a data model, or the project's graphical interface. This area can also be segmented to view multiple documents, presenting a comparison of their differences (such as for comparing two versions of the same code file). The content area also integrates support for viewing PDFs and other file types supported by the extendable Quick Look feature.

An integrated IB(interface builder) exists within this new xcode version.It's basic purpose is to add components to your project, including all simple functions like buttons and display of the UI. It will not only help developers code on the multiple window platform while looking at the existing code, but also help them achieve the goal of understanding the programming theme as they go along the project, which will in turn help in expediting the project at a much faster rate eventually.

This new comparison feature Will help people compare the codes in the project which will help them keep track of the flow of the programming parameters and the in general scenario as they tread along wiTh the project in the long run ,to understand where the error occurred and how it can be fixed.
besides these awesome features,another major feature delivered alongside Xcode 4 will be a new version of Instruments (originally code named Xray), Apple's graphical tool for code performance profiling based on Sun's DTrace technology.

The new Instruments adds new time profiler support for iOS development, and includes new features that help developers examine how their application code interacts with other apps and the system's kernel, in order to find where apps are spending their processing time and allocating their resources in a very complex computing environment.
This way xcode 4 IDE will make programming easy and make the whole process flow tracking, designing and coding experience fun, making project coding convenient for everyone involved in any given project at hand.

Thanks for reading,have a wonderful day !!!

Regards and smiles,
Vishwan Aranha :)

P.S: Instruments is also said to include support for identifying abandoned memory that has been referenced but not actually needed, enabling developers to reduce the memory footprint their apps demand. The tool will also add profiling analysis support for OpenGL ES, an important tool for iOS developers building high performance games and other apps that make use of sophisticated graphics.

Mobile Functional Specifications

It's been quite a while since my last blog.So I decided to write another one just to save my blog writing talent.

The topic that I selected for this blog " Mobile Functional Specifications", sounds like a very corporate oriented, very boring topic, but did you know it forms the heart of any Mobile development project. There are thousands of books on iPhone development out there, out of which very few discuss this topic in detail. I like to question these books right away. Why? Why can't you guys specify about the functional aspects and requirements, but rather jump to the coding aspect which is only of relevance when a person just wants to learn coding with no BS involved.
Functional Specifications(FS) are no BS, for starters, these comprise of the requirements and the functioning(obvious) of the modules associated with any app. You can be a hardcore developer or designer, but without requirements properly laid out, you will keep coding and designing, till 2012(end of the world).
The best way to avoid lot of coding errors and looping in programming, is developing a strategy(requirement analysis) followed by code layout/technical flow explained, which helps us developers understand how to go about the project. It is like a torch that leads us through the dark path when we are roughly aware what the project goal is, but not about how to go about this goal.

Functional Specifications are usually dealt with by business analysts in any corporate environment, so us developers, disregard the fact that it is our responsibility to go through it as they do.
For instance, I was among the people who did the same. I used to disregard the specifications and scan through the well defined diagrams in FS and start developing asap, resulting in an extremely erroneous output, which took me ages to fix. In my recent project, we did not have any business analysts. At first I was apprehensive about it, I wondered how would I go about this project without one? how would I do the development like this? There were some FS's which were very roughly laid out and not that obvious.
I had given up hope, I thought time for another big messy project and the stresses that I would have to deal with because of module coding errors. But to my surprise, I read articales on gizmodo, consulted some nice Business analysts, got the templates and design from them and was able to lay out the structure and fill it in myself. A few drafts were formulated, but eventually I was able to nail it and guess what? I had awesome understanding and knowledge of the project requirements at hand and how to go about them. sometimes I think I would have preformed even better in the previous projects if no Business analysts were involved. might take time to do it without them, but atleast it would save months of coding errors(which is equivalent to spending time in hiring business analysts/ their involvement)
No I am not trying to take away the jobs from Business Analysts, but I am trying to mention that maybe in the Mobile environment we will be better off doing things by ourselves just to get perfect practical knowledge of the project requirements at hand( best experience in life comes from doing things yourself)
Most general Functional Design/Analytical or Technical Specifications consist of the following attributes:
Introduction
Module details(consisting of the following):
1. Requirements
2. Requirements Analysis
3. Functional Diagrams(Mock-up diagram/ state flow diagram etc.)
4. Feature Priority
5. Possible alterations/ additions for future( which basically help to lay out appropriate design during development to incorporate the possibility for addition of new features, thus helping to avoid rewriting code logic again and again.
6. Technical Overall flow( with possible diagrams)

Thus these self explanatory steps form the basic milestones in any Mobile development projects and help in improving the quality and style of any coding practice and most importantly it SAVES a lot of time and we all know time is money!

Lesson to learn: Never ignore FS, as it can really help you with ANY mobile project at hand.

Cheers!
Vishwan :)

Followers

Vishwan Aranha. Powered by Blogger.