Archive for the ‘Web Services’ Category

Adobe Acquires PhoneGap

Tuesday, November 8th, 2011

Good news on the mobile development front for Adobe fans…. PhoneGap is now under Adobe’s umberella. PhoneGap is a framework for developing HTML5/JavaScript/CSS apps that can be deployed accross multiple mobile platforms. You can build the apps using a free SDK, or use the paid version:

“..write your app using HTML, CSS or JavaScript, upload it to the PhoneGap Build service and get back app-store ready apps for Apple iOS, Google Android, Palm, Symbian, BlackBerry and more”

This seems to be the way things are heading…. cant wait to give it a try

Flex: testing/running php proxy locally

Friday, October 15th, 2010

When accessing URL’s through HttpServices from a remote domain, it often works fine on the local system but fails to connect when the swf is uploaded to the web (google searh ‘flex crossdomain.xml proxy’).

A common way around this is to place a PHP file on your web server that acts as a go-between for the remote site and the swf (an example discussed on Dennis Jaamaan’s site, with proxy code).

This article explains how to setup a local PHP server, and test your PHP proxy locally through Flex Builder 3

1. Download a PHP server: http://www.wampserver.com/en/download.php

2. Install it, leaving whatever default settings it suggests.

3. Click the WampServer taskbar icon, and go to PHP/PHP_extensions/ and click php_curl (need to enable this to use the example below). Then click Start All Services & Put Online.

4. Create a php file named flexProxy.php and put in the code below:

< ?php
$ch = curl_init();
$timeout = 30;
$userAgent = $_SERVER['HTTP_USER_AGENT'];

$url = $_REQUEST['url'];
$place = $_REQUEST['place'];

$fullGoogleWeatherPath = $url . $place;

curl_setopt($ch, CURLOPT_URL,$fullGoogleWeatherPath);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo curl_error($ch);
} else {
    curl_close($ch);
    echo $response;
}
?>

5. Save this file and put it in the localhost directory: C:\wamp\www\

Read the rest of this article…………….

Country – Capital XML List using GeoNames

Friday, October 15th, 2010

Was looking around trying to find an XML file of countries and capital cities.

Initially came accross some rather incomplete xml files with the ISO two digit country codes, but so far the best info I found is from GeoNames.

If your using Flash/Flex, it doesnt matter that their crossdomain.xml is outdated, because they use REST web services.

e.g.  http://ws.geonames.org/countryInfo?

In flex, you can use a HttpService to specify request attributes, good example here. Very handy.