When Perl met Android
About me <ul><li>Sawyer X
Sysadmin / Perl Ninja
http://search.cpan.org/~xsawyerx/
http://blogs.perl.org/users/sawyer_x/ </li></ul>
What is Android? <ul><li>GNU/Linux-based operating system
Developed by Google for mobile devices
Java UI framework. </li></ul>
Some statistics <ul>Smartphone OS first quarter of 2010 in the US: <li>BlackBerry OS holds 36% - 1st place
Android holds 28% - 2nd place
iOS holds 21% - 3rd place.
[NPD Group study] </li></ul>
Upcoming SlideShare
Loading in...5
×

When Perl Met Android (YAPC::EU 2010)

6,097

Published on

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.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
6,097
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
31
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

When Perl Met Android (YAPC::EU 2010)

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

    Clipping is a handy way to collect important slides you want to go back to later.

×