Professional Documents
Culture Documents
$self
Ivn Mosquera
ZCE
PHP, Java, C.
PHP for Android project founder.
@ivmos
Irontec
Slides
http://www.slideshare.net/ivmos
http://www.slideshare.net/irontec
Index
Android.
PHP on Android
PHP compilation.
Intro..
Architecture.
PFAf
Android
Mobile OS.
Opensource.
200.000 /day.
tablet
Android
Android
PHP on Android
Android is Linux.
So it should work.
Of course it does..
PHP en Android
Linked to Bionic.
BSD.
sizeof(gnu_libc) * 0.5
Missing stuff.
PHP on Android.
Php-cli sapi
Agcc
Tweaks because of bionic.
=~ 2MB
Sockets, json.
The problem
API php OK
UI? (php-gtk?)
Calls?
Messages?
Location?
Sensors?
...
Mobile web.
The solution
The solution
Python.
Perl.
Ruby.
Lua...
Http://www.phpforandroid.net
@phpforandroid
SL4A PHP support.
APK.
Android PHP binary.
Framework.
Free software.
APKs
APKs:
SL4A
PFA
PHP bin.
Scripts
php_rX.zip
php_scripts_rX.zip
Misc
Android.php
php.ini
php_extras_rX.zip
SL4A
Script management.
Android Facades.
Interpreter install.
<?php
include 'Android.php';
$droid = new Android();
public function __call($name, $args) {
return $this->rpc($name, $args);
}
Json RPC
<?php
require Android.php;
$droid = new Android();
$droid->viewContacts();
WhereAmI script
Location.
Email building (google maps link).
WhereAmI script
$droid->startLocating();
Received: {"id":24,"method":"startLocating","params":[]}
Sent: {"error":null,"id":24,"result":null}
$location = $droid->readLocation();
Received: {"id":25,"method":"readLocation","params":[]}
Sent: {"error":null,"id":25,"result":{"network":
{"provider":"network","time":1288215482448,"longitud
e":3.0339431,"latitude":43.3319985,"speed":0,"accuracy"
:76,"altitude":0}}}
WhereAmI script
$droid->stopLocating();
Received: {"id":26,"method":"stopLocating","params":[]}
Sent: {"error":null,"id":26,"result":null}
$longitude =
$location["result"]->network->longitude;
$latitude =
$location["result"]->network->latitude;
$mapLink = sprintf('http://maps.google.com/maps?
q=%s,%s', $latitude, $longitude);
WhereAmI script
Received: {"id":29,"method":"sendEmail","params":
["","Donde estoy","admin_area : Pa\u00eds Vasco
\nfeature_name : 3 \nsub_admin_area : Vizcaya
\npostal_code : 48980 \nlocality : Santurtzi
\nthoroughfare : Calle del Puerto Pesquero
\ncountry_code : ES \ncountry_name : Espa\u00f1a
\n\nGoogle Maps: http:\/\/maps.google.com\/maps?
q=13.3319985, 6.0339431"]}
Sent: {"error":null,"id":29,"result":null}
PFAf
PFAf
start
credicts
info
locate
Development environment
SL4A...
[allow_url_fopen, allow_url_include] ON
Emulator, adb.
testnow.php
testcache.php
Remote scripting.
Script sharing
Roadmap
SL4A
API extended.
GUI...
Bugfixes.
PFA
Sqlite,... phpize.
supporting SL4A releases.
?????
Questions
Logo @Workoholics_