SlideShare una empresa de Scribd logo
1 de 23
Plack on SL4A
     clouder
What's SL4A?
• Scripting Layer for Android

• Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell
  are currently supported

• Access to UI, Camera, Sensors on Android

•                Shibuya.pm #14
    http://d.hatena.ne.jp/naoya/20100930/1285868397

•
    http://advent.perl.kr/2010-12-21.html
Try installing the Plack
SL4A installation

• Android SDK                       apk
 http://code.google.com/p/android-scripting/


 % adb install sl4a_r4.apk
 2546 KB/s (858471 bytes in 0.329s)
         pkg: /data/local/tmp/sl4a_r4.apk
 Success
Shell
Interpriter installation


•
Perl
It works!
• Perl debugger
Run script
• hello_world.pl

 use Android;
 my $android = Android->new;
 $android->makeToast(“Hello, Android!”);
hello_work.pl
Directory structure
• @INC
  /data/data/com.googlecode.perlforandroid/files/perl/
  site_perl/5.10.0/arm-eabi-linux
  /sdcard/com.googlecode.perlforandroid/extras/perl/
  site_perl/5.10.0
  /data/data/com.googlecode.perlforandroid/files/perl/5.10.0/
  arm-eabi-linux
  /data/data/com.googlecode.perlforandroid/files/perl/5.10.0
  /sdcard/com.googlecode.perlforandroid/extras/perl/site_perl
  .

•
    /sdcard/sl4a/scripts
Plack installation
• Android         SD            PC
 Plack
 DST=/mnt/sdcard/sl4a/scripts
 cpanm -l $DST/perl5 
     --reinstall 
     -qfn 
     CGI CGI::Util 
     HTTP::Date Time::Local 
     URI::Escape 
     Plack::Builder Plack::App::Directory 
     HTTP::Server::Simple::CGI 
     HTTP::Server::Simple::PSGI 
     HTTP::Message HTTP::Body 
     Hash::MultiValue
Plack installation(con’t)
mkdir -p $DST/lib/perl5/File/Spec
cp `perldoc -l File::Spec::Unix` $DST/lib/perl5/File/Spec
cp `perldoc -l integer` $DST/lib/perl5
cp `perldoc -l parent` $DST/lib/perl5
cp `perldoc -l DirHandle` $DST/lib/perl5
cp `perldoc -l FileHandle` $DST/lib/perl5
Script using Plack
 use   strict;
 use   lib '/sdcard/sl4a/scripts/perl5/lib/perl5';
 use   Android;
 use   Plack::Builder;
 use   Plack::App::Directory;
 use   HTTP::Server::Simple::PSGI;

• my $droid
  Plack    = Android->new;
 my $app = builder {
     mount "/" => Plack::App::Directory->new(root =>
 '/sdcard');
 };

 my $server = HTTP::Server::Simple::PSGI->new(8080);
 $server->app($app);
 $server->run;
Transfer script
• Android

 % adb push filer.pl /sdcard/sl4a/scripts/filer.pl
Start server before run
Server works!
Demo
Impressions

• XS              make

•

• SL4A     Perl          Perl

Más contenido relacionado

La actualidad más candente

Bootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stackBootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bram Vogelaar
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
Tatsuhiko Miyagawa
 

La actualidad más candente (20)

Plack at YAPC::NA 2010
Plack at YAPC::NA 2010Plack at YAPC::NA 2010
Plack at YAPC::NA 2010
 
A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices
 
Bootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stackBootstrap your Cloud Infrastructure using puppet and hashicorp stack
Bootstrap your Cloud Infrastructure using puppet and hashicorp stack
 
BitTorrent on iOS
BitTorrent on iOSBitTorrent on iOS
BitTorrent on iOS
 
Three Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside ContainersThree Years of Lessons Running Potentially Malicious Code Inside Containers
Three Years of Lessons Running Potentially Malicious Code Inside Containers
 
Plack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and serversPlack perl superglue for web frameworks and servers
Plack perl superglue for web frameworks and servers
 
Perl: Hate it for the Right Reasons
Perl: Hate it for the Right ReasonsPerl: Hate it for the Right Reasons
Perl: Hate it for the Right Reasons
 
React Native in Production
React Native in ProductionReact Native in Production
React Native in Production
 
May The Nodejs Be With You
May The Nodejs Be With YouMay The Nodejs Be With You
May The Nodejs Be With You
 
Alamofire
AlamofireAlamofire
Alamofire
 
Information security programming in ruby
Information security programming in rubyInformation security programming in ruby
Information security programming in ruby
 
Composer: putting dependencies on the score
Composer: putting dependencies on the scoreComposer: putting dependencies on the score
Composer: putting dependencies on the score
 
Mining Ruby Gem vulnerabilities for Fun and No Profit.
Mining Ruby Gem vulnerabilities for Fun and No Profit.Mining Ruby Gem vulnerabilities for Fun and No Profit.
Mining Ruby Gem vulnerabilities for Fun and No Profit.
 
Terraform - Taming Modern Clouds
Terraform  - Taming Modern CloudsTerraform  - Taming Modern Clouds
Terraform - Taming Modern Clouds
 
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...
 
Bringing modern PHP development to IBM i (ZendCon 2016)
Bringing modern PHP development to IBM i (ZendCon 2016)Bringing modern PHP development to IBM i (ZendCon 2016)
Bringing modern PHP development to IBM i (ZendCon 2016)
 
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
Titanium 3.2 CLI - TiAppCamp2 - 11/2/2013
 
GraphQL IN Golang
GraphQL IN GolangGraphQL IN Golang
GraphQL IN Golang
 
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOPHOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
HOW TO DEAL WITH BLOCKING CODE WITHIN ASYNCIO EVENT LOOP
 
BUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIOBUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIO
 

Similar a Plack on SL4A in Yokohama.pm #8

Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
Kazuto Kusama
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
Bachkoutou Toutou
 
Android Scripting
Android ScriptingAndroid Scripting
Android Scripting
Juan Gomez
 

Similar a Plack on SL4A in Yokohama.pm #8 (20)

Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
 
MOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfMOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdf
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDB
 
PySpark Best Practices
PySpark Best PracticesPySpark Best Practices
PySpark Best Practices
 
Deployment tales
Deployment talesDeployment tales
Deployment tales
 
Deployment tales
Deployment talesDeployment tales
Deployment tales
 
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloudOpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
 
Kubernetes security
Kubernetes securityKubernetes security
Kubernetes security
 
Start tracking your ruby infrastructure
Start tracking your ruby infrastructureStart tracking your ruby infrastructure
Start tracking your ruby infrastructure
 
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, KyivKubernetes Navigation Stories – DevOpsStage 2019, Kyiv
Kubernetes Navigation Stories – DevOpsStage 2019, Kyiv
 
Developing with-devstack
Developing with-devstackDeveloping with-devstack
Developing with-devstack
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
 
Php Inside - confoo 2011 - Derick Rethans
Php Inside -  confoo 2011 - Derick RethansPhp Inside -  confoo 2011 - Derick Rethans
Php Inside - confoo 2011 - Derick Rethans
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Android Scripting
Android ScriptingAndroid Scripting
Android Scripting
 
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCats
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Plack on SL4A in Yokohama.pm #8

  • 1. Plack on SL4A clouder
  • 2. What's SL4A? • Scripting Layer for Android • Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell are currently supported • Access to UI, Camera, Sensors on Android • Shibuya.pm #14 http://d.hatena.ne.jp/naoya/20100930/1285868397 • http://advent.perl.kr/2010-12-21.html
  • 4. SL4A installation • Android SDK apk http://code.google.com/p/android-scripting/ % adb install sl4a_r4.apk 2546 KB/s (858471 bytes in 0.329s) pkg: /data/local/tmp/sl4a_r4.apk Success
  • 5.
  • 8.
  • 9.
  • 10. Perl
  • 11. It works! • Perl debugger
  • 12. Run script • hello_world.pl use Android; my $android = Android->new; $android->makeToast(“Hello, Android!”);
  • 14. Directory structure • @INC /data/data/com.googlecode.perlforandroid/files/perl/ site_perl/5.10.0/arm-eabi-linux /sdcard/com.googlecode.perlforandroid/extras/perl/ site_perl/5.10.0 /data/data/com.googlecode.perlforandroid/files/perl/5.10.0/ arm-eabi-linux /data/data/com.googlecode.perlforandroid/files/perl/5.10.0 /sdcard/com.googlecode.perlforandroid/extras/perl/site_perl . • /sdcard/sl4a/scripts
  • 15. Plack installation • Android SD PC Plack DST=/mnt/sdcard/sl4a/scripts cpanm -l $DST/perl5 --reinstall -qfn CGI CGI::Util HTTP::Date Time::Local URI::Escape Plack::Builder Plack::App::Directory HTTP::Server::Simple::CGI HTTP::Server::Simple::PSGI HTTP::Message HTTP::Body Hash::MultiValue
  • 16. Plack installation(con’t) mkdir -p $DST/lib/perl5/File/Spec cp `perldoc -l File::Spec::Unix` $DST/lib/perl5/File/Spec cp `perldoc -l integer` $DST/lib/perl5 cp `perldoc -l parent` $DST/lib/perl5 cp `perldoc -l DirHandle` $DST/lib/perl5 cp `perldoc -l FileHandle` $DST/lib/perl5
  • 17. Script using Plack use strict; use lib '/sdcard/sl4a/scripts/perl5/lib/perl5'; use Android; use Plack::Builder; use Plack::App::Directory; use HTTP::Server::Simple::PSGI; • my $droid Plack = Android->new; my $app = builder { mount "/" => Plack::App::Directory->new(root => '/sdcard'); }; my $server = HTTP::Server::Simple::PSGI->new(8080); $server->app($app); $server->run;
  • 18. Transfer script • Android % adb push filer.pl /sdcard/sl4a/scripts/filer.pl
  • 20.
  • 22. Demo
  • 23. Impressions • XS make • • SL4A Perl Perl

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n