Share This:

Phonegap is an open source platform created by Adobe allow website developers to make mobile applications for multiple different devices using languages they are already familiar with. it has picked up quite a bit of popularity after it was revieled that companies such as Facebook and Wikipedia use phone gap for their mobile apps.

Since mobile computing has become very popular special mobile web languages have been created to create mobile websites. And even though website developers don’t need to use these tools to make a mobile website they usually do to get the best functionality.

Some features mobile web languages use.

  • GPS Access
  • Webcam Access
  • Touch Screen Support

In addition to mobile web languages mobile web browsers as well as HTML5 have features that are meant for mobile devices.


<a href="tel:+1234555555">When a user clicks this link it will dial the phone number</a>


<a href="sms:+1234555555">When A User clicks this link their text message app will open up and they can send the number an SMS message</a>


<a href="mms:+1234555555">Due to limiitations with sms mms can be used to send media messages with pictures or video</a>

Many mobile devices these days have touch screens and can recognize multiple pointers and gestures from the users fingers. This is why a group of people created a custom version of JQuery known as jQuery Mobile which makes mobile site development much easier.




Yet other web developers choose to use Sencha Touch. The two languages have slight differences and offer different features, unfortunately you can’t use both jQuery Mobile and Sencha Touch.

 

There will always be some things a website just can’t do, which requires a program to be installed on your computer or in the mobile world a mobile app. This is where PhoneGap comes into play.

With PhoneGap you can do access many parts of a mobile device such as the list below.

  • Battery Status
  • Camera
  • Contacts
  • Device Information (Phone Number or Make And Model)
  • Device Motion
  • Device Orientation
  • Dialogs
  • FileSystem
  • File Transfer
  • GeoLocation
  • Globalization
  • Media
  • Network Information (Connected To WiFi Or 3G, 4G or no access)
  • Vibration

PhoneGap also has plugins and developers are free to build their own plugins for personal use or to redistribute.

One thing many web developers don’t like is that phonegap only works on a single page. This is because before the page loads the PhoneGap cordova engine starts. In theory you could have numerous web pages in a PhoneGap app, but would require the cordova engine to start each time a new page loads. This is why most PhoneGap Apps usually only have the index.html file.




Another thing web developers new to using phonegap is that they can’t use server side wont work inside of phone. This requires web developers who need to use PHP to build scripts using client side languages to communicate with the servers. What Facebook and Wikipedia do to display a news feed or data inside their MySQL databases they make JSON file of the MySQL database that gets displayed to the user. Another less secure method is to allow cross domain policies for every IP address inside your PHP script then to use JQuery to display the content.

Since there is always something you simply can’t do with a client side language you will need to use PHP occasionally. Sometimes it is very common uses that you can use for example when writing a PHP script to submit a form, simply use HTML to create the form and in the form tags add the location to the PHP script. This in many cases is used on the web in general because it cuts back on validation code and data only gets submitted when the submit button is clicked, not when the page loads or reloads.


<form action="http://myserver.com" method="post">
<input type="text">
<input type="submit"
</form>

Resources