+ Reply to Thread
Results 1 to 3 of 3

Thread: (PHP) Using GPS modul in iPhone with iPFaces

  1. #1
    Edhouse is offline Newbie
    Join Date
    Feb 2010
    Posts
    6
    Rep Power
    0

    Lightbulb (PHP) Using GPS module in iPhone with iPFaces

    Hi,

    I want to show you some basic examples of creating iPhone applications in PHP with framework iPFaces. First of all, small introduction to architecture of iPFaces.

    The idea is similar to the web browser - web server model. The client sends HTTP(S) requests to the server and receives iPFaces specific HTTP(S) responses, where the content is an XML representation of the application's form which is be rendered on client-side together with the form's data.

    See Image01.png.

    How to start?
    Development of a complex iPFaces application is really simple because the simulation mode can be used. This mode is capable of transfering XML content to a HTML page, which can be displayed in a web browser. It is a helpful tool for developers who can see their iPFaces application in the browser window and they do not need a real iPhone device for main development.
    Developers can build and deploy an application to the application server and the browser will show them the GUI which is almost the same as a screen in an iPhone application. There is a difference in the GPS elements. A GPS field is working in a browser only as text field that can be filled by user and GPS coordinates will be submitted. The GPS field is hidden on mobile devices, because the location of the device is detected without interaction with the user.

    Image02.png and Image03.png
    Form representation on the iPhone device and in a web browser

    Hello World Example
    To use PHP iPFaces library, just include "ipfaces-php-lib-1.1.php" file, construct the component tree and call "render()" method on the component form.

    Code:
    require "path/to/ipfaces/library/ipfaces-php-lib-1.1.php";   
    $ipf_form = new IPFForm();   
    $ipf_screen $ipf_form->addScreen("screen""Hello World Application");   
    $ipf_screen->addLabel("label""Hello World!");   
    $ipf_form->render(); 
    Image04.png and Image05.png
    Hello World example

    Main example: Use of location service
    To obtain a user location from a mobile device use the IPFGsm class. Upon submission of a form, the location data will be sent as a parameter with the selected name (gpsElement in this example).

    Code:
    require "../lib/ipfaces-php-lib-1.1.php";   
    require 
    "citydatabase.php";   
      
    $form = new IPFForm();   
    $screen $form->addScreen("How Far Is It?");   
    $screen->addLabel("You can find distance between your position and selected city.");   
    $parser = new CityDatabase();   
      
    if (isset(
    $_COOKIE["city"])){   
        
    $value $_COOKIE["city"];   
    }   
      
    $select = new IPFSelect("citySelect"$value"Distance to" ,"list" );   
    $options = array();   
      
    for(
    $row 0$row count($parser->data); $row++){   
        
    $options[] = new IPFOption($row$parser->data[$row]["City"]);   
    }   
      
    $select->Icon "../img/distcalc.png";   
    $select->addOptions($options);   
    $screen->addItem($select);   
      
    $screen->addGps("gpsElement");   
      
    $screen->addButton("backButton""1""Examples""../index.php"IPFButton::BUTTON_TYPE_LINKIPFButton::BUTTON_POSITION_BACK);   
    $screen->addButton("submitButton""0""Calculate" "distance.php"IPFButton::BUTTON_TYPE_SUBMITIPFButton::BUTTON_POSITION_FORWARD);   
      
    $form->render(); 
    See Image06.png.

    I hope that this quick tutorial will be useful for you and you can now make your own iPhone application. iPFaces also supports Java and ASP.Net. So you can chose your favorite language. More information about iPFaces you can find at ipfaces.org.
    Attached Thumbnails Attached Thumbnails (PHP) Using GPS modul in iPhone with iPFaces-image01.png   (PHP) Using GPS modul in iPhone with iPFaces-image02.png   (PHP) Using GPS modul in iPhone with iPFaces-image03.png   (PHP) Using GPS modul in iPhone with iPFaces-image04.png   (PHP) Using GPS modul in iPhone with iPFaces-image05.png  

    (PHP) Using GPS modul in iPhone with iPFaces-image06.png  
    Last edited by Edhouse; 02-16-2010 at 05:15 AM. Reason: correcting mistake in Title

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Edhouse is offline Newbie
    Join Date
    Feb 2010
    Posts
    6
    Rep Power
    0

    Lightbulb New client application for BlackBerry

    Hi,

    we released new iPFaces client application for BlackBerry smartphones. It supports all the same features as the iPhone client expect display rotation and styling. The client integrates well into BB look and feel. It's distributed as Freeware.

    More information about BB client and installing can be found at BlackBerry Client Application | iPFaces | Mobile Application Framework

    Client application for J2ME is in beta testing.
    Attached Thumbnails Attached Thumbnails (PHP) Using GPS modul in iPhone with iPFaces-.jpg  

  4. #3
    Edhouse is offline Newbie
    Join Date
    Feb 2010
    Posts
    6
    Rep Power
    0

    Lightbulb New client application for Mobile Java (J2ME)

    Hi,

    we released client application for devices with Mobile Java (J2ME). This client is also distributed as freeware.

    See Mobile Java Client Application | iPFaces | Mobile Application Framework

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts