When Perl Met Android (YAPC::EU 2010)
Upcoming SlideShare
Loading in...5

When Perl Met Android (YAPC::EU 2010)



These are the slides I used at a lecture in YAPC::EU 2010 about running Perl on the Android mobile device operating system. ...

These are the slides I used at a lecture in YAPC::EU 2010 about running Perl on the Android mobile device operating system.

There is a screencast (audio + video) of it, which will hopefully become available soon.



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

When Perl Met Android (YAPC::EU 2010) When Perl Met Android (YAPC::EU 2010) Presentation Transcript

  • When Perl met Android
  • About me
    • Sawyer X
    • Sysadmin / Perl Ninja
    • http://search.cpan.org/~xsawyerx/
    • http://blogs.perl.org/users/sawyer_x/
  • What is Android?
    • GNU/Linux-based operating system
    • Developed by Google for mobile devices
    • Java UI framework.
  • Some statistics
      Smartphone OS first quarter of 2010 in the US:
    • BlackBerry OS holds 36% - 1st place
    • Android holds 28% - 2nd place
    • iOS holds 21% - 3rd place.
    • [NPD Group study]
  • Some more statistics
    • 2nd most popular mobile development target
    • Over 70,000 apps available for Android
    • About 60K Android devices sold daily, about 22M a year
    • About 60% of Android Apps are free compared to iPhone’s 25%
    • U.S. make up 65% of Android devices.
  • Features
    • Free
    • Linux-based
    • Open source
    • Community-driven
    • Pretty UI
    • Well supported
    • Has an emulator.
  • Obstacles
    • Java.
    • Java..
    • Java...
  • Enter SL4A (previously ASE)
    • Scripting Layer for Android
    • (Formerly ASE: Android Scripting Environment)
    • Java bridge between interpreters and Android
    • JSON RPC server
    • Serializes object methods and params to JSON
    • Root required for new interpreters
    • Supports Python, JRuby, Perl, Lua, Javascript...
    • 6 lines for a barcode scanner!
  • Stuff you can do
    • TTS (Text To Speech)
    • Dialogs (input, alert, selections, progress, etc.)
    • GPS, ringer mode, airplane mode, etc.
    • Sensors, vibrators, etc.
    • Data on the phone (contacts, SMS msgs)
    • Run servers in the background
    • (Stevan got Plack running!)
    • (I got Dancer running!)
  • How does the code look?
    • Android.pm (written by Jarkko Hietaniemi)
    • Provides an object
    • Uses AUTOLOAD to provide any API method
    • Returns hash with results (errors, msgs, etc.)
    • use Android;
    • my $droid = Android->new;
    • $droid ->speak( “Hello from Perl!” );
  • GPS-based messaging (Alex Elder)
    • You set GPS coordinates
    • An SMS msg and a contact
    • It sends the SMS when you reach the location
    • Supports tags (such as country name)
    • Roughly 90 lines of code in a single file
    • Would have helped me avoid my first ticket.
  • Where do I start?
    • Download and install Android SDK
    • Create a virtual device
    • Install SL4A
    • Add a Perl interpreter
    • Write your script
    • Upload it to the virtual device
    • Run, Forest... RUUUUUN [the script] !!