Latest Post
Tampilkan postingan dengan label Android. Tampilkan semua postingan
Tampilkan postingan dengan label Android. Tampilkan semua postingan

Build PHP XML-RPC Server, Client and Android application

Written By Unknown on Selasa, 29 Oktober 2013 | 09.10

In this article I will show how to build PHP XML RPC server and how to consume provided services with PHP and an Android application as a client. PHP side of things will be built on top of Zend Framework and for Android will be using very thin XML RPC library android-xmlrpc ( http://code.google.com/p/android-xmlrpc/ ).

To read more about this article Click Here

To download files Click Here

Getting Started with iPFaces Mobile Application Framework

Written By Unknown on Senin, 13 Februari 2012 | 08.43


iPFaces is a flexible solution for easy development of form-oriented network mobile applications. With the iPFaces solution, mobile devices are able to render content received from a server using their native UI components.


It uses thin presentation client (must be installed on device) to render application content. Using iPFaces it is possible to build an application where users can use their device's specific component behavior and additional device features, such as location service and additional graphic components of the device (lists, pickers etc.).

Architecture

The solution is based on the use of a thin presentation client installed on the device and an application/web server which generates the content for clients. The client and the server communicate with each other using the network.

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.



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.



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.



  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();




More complex example

The following example is not complete. It only illustrates how easy it is to define forms for iPhone using iPFaces. For complete examples please visit http://www.ipfaces.org

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).

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_LINK, IPFButton::BUTTON_POSITION_BACK);
$screen->addButton("submitButton", "0", "Calculate" , "distance.php", IPFButton::BUTTON_TYPE_SUBMIT, IPFButton::BUTTON_POSITION_FORWARD);

$form->render();





PHP for Android adds a new Dimension to app development

Written By Unknown on Kamis, 02 Februari 2012 | 09.18

Android app development is taking over iPhone and will soon go wild. However, the app development process is not as well defined as app development for Windows desktop yet. Though, this is sure to change once we see a sway of developers towards Android.

Android app development using Java (on Eclipse) has gained wide popularity and is in the mainstream already. However, there are many alternative ways of developing Android apps which developers are unaware of. This includes app development using JavaScript, CSS and HTML and Android app development using the latest App Inventor from Google. Whether the App Inventor from Google will support writing codes or not is still doubtful. Adding to the list, now we can develop Android apps using PHP as well.

PHP for Android is aiming to bring over app development with PHP for the Android environment just as we have app development with JavaScript for Android. Android apps developed in PHP will run using the Android scripting environment. PHP supports a vast library and this app development process is sure to take advantage of this fact.

Irontec, a Spanish startup specializing in Linux Systems, is the company behind PHP for Android. The PHP port comes with a very user-friendly documentation, which can help fire up the jets for developers. PHP for Android makes use of the Android Scripting Environment project, which is maintained by Google itself. This adds support for executing scripts directly on the Android device using a native interpreter.

To start with app development with PHP on Android, you will need the Android scripting environment and PHP for Android. Get them here:

QR Codes


 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger