SlideShare a Scribd company logo
1 of 29
USE RUBY TO WRITE (AND TEST) YOUR

 
 
 
 NEXT ANDROID APP
Joel Byler
Software Craftsman
@joelbyler
June 1, 2013
Pittsburgh TechFest
La Roche College
Saturday, June 1, 13
WHO AM I?
 
 
 
 JOEL BYLER
 Software Craftsman
 Organizer for CleRb
 Enterprise Java Developer
 Relatively new to Ruby
 ... and Android
Saturday, June 1, 13
Saturday, June 1, 13
NEW TO ANDROID AND RUBY???
 Software Craftsmanship
Reduce risk with TDD / ATDD
 <3 Ruby and want to learn more
 <3 Mobile apps, who doesn’t?
Warning: this may turn out to be a lot of code to absorb in a short
amount of time. Slides and code will be made publicly available
Saturday, June 1, 13
RUBY ON ANDROID USING RUBOTO
JRuby optimized for the Android OS
 JRuby is a JVM language
 Android uses something like the JVM
but actually Dalvik VM
=+
<<< MAGIC >>>
Saturday, June 1, 13
IRB ON YOUR ANDROID DEVICE
 Interactive Ruby Shell
 Edit and run scripts in Android
 demo...
Saturday, June 1, 13
PERFORMANCE CONSIDERATIONS
Other than initial startup to load
JRuby, the performance of the app
appears to be as good as many
native Android apps
Saturday, June 1, 13
RUBOTO CORE
 A separate app available on the
Google Play Store
 Allows Ruboto Runtime (JRuby
on Dalvik VM) to be shared
 An alternative would be to use
the --with-jruby option
Decisions, decisions...
Saturday, June 1, 13
HOW DOES THIS
MAKE YOU FEEL?
This is what your users will
see if they don’t already have
the Ruboto Core installed
Using the --with-jruby
option will add ~10mb
to the size of your app
or
Saturday, June 1, 13
CREATE A NEW PROJECT
Ruboto Application Generator
$ ruboto gen app --package com.leandog.mastermind.ruboto
--name MasterMindRuboto --target android-15
--with-jruby --path=RubotoMasterMind
This will generate application with
'What hath Matz wrought?' sample code.
Saturday, June 1, 13
RUBOTO CLASS GENERATOR
Ruboto Class Generator
$ ruboto gen class Activity --name MasterMindMainActivity
This will generate code for the activity and add it to
the project manifest.
You can also use this to generate a
BroadcastReceiver or Service class
Saturday, June 1, 13
YOUR GENERATED APP
Saturday, June 1, 13
YOUR GENERATED CODE (RUBY .RB)
Saturday, June 1, 13
YOUR GENERATED TEST (ALSO .RB)
Saturday, June 1, 13
RAKE INSTEAD OF ANT
$ rake install start
Install the project on a device or emulator and start
it running.
$ ant debug
$ adb install example.apk
$ adb shell am start -n com.foo.bar...
$ rake update_scripts
Install the project on a device or emulator and start
it running.
$ adb install example.apk
$ rake -T List other available rake tasks
Saturday, June 1, 13
ADD IN THE ATDD
$ gem install testgen
This is one of @chzy 's testing gems
$ testgen project yourapp --with-gametel
This will add everything you need to use cucumber
to test your Ruboto app
Saturday, June 1, 13
NOW FOR SOME UNIT TESTS
$ mkdir spec This is where your specs will live
Add rspec to Rakefile (created by testgen)
Saturday, June 1, 13
UNIT TESTING
Use rspec to test your ruby code, just like you
normally would.
rspec
JUnit 3
rake spec
Saturday, June 1, 13
INTEGRATION TEST?
Instruments and installs app on device when running
rake test
similar to ActivityInstrumentationTestCase2
Saturday, June 1, 13
ACCEPTANCE TESTING
Feature: Input Screen
Scenario: Welcome the user
When the application launches
Then I see "Enter four numbers below and submit your guess"
Scenario: User can guess
Given I enter 4 numbers
When I press the submit button
Then I see "Nice guess!"
rake features
Cucumber
Gametel
Brazenhead
ADB gem
class MainScreen
include Gametel
text(:number1, :index => 0)
text(:number2, :index => 1)
text(:number3, :index => 2)
text(:number4, :index => 3)
def guess (first, second, third, forth)
number1 = first.to_s
number2 = second.to_s
number3 = third.to_s
number4 = forth.to_s
end
end
Then(/^I enter 4 numbers$/) do
on(MainScreen).guess 1, 2, 3, 4
end
Saturday, June 1, 13
YOUR RUBOTO CLASS FILES
 They're just .rb files
 Allows you to make changes without a full
rebuild
 fast feedback
 Ruboto uses ruby classes that are backed by java
classes for improved performance.
 Can still reference Java resources
example:
R::string::header_text
Saturday, June 1, 13
QUICK TOUR OF THE CODE
* Time permitting
Saturday, June 1, 13
Saturday, June 1, 13
THE RUBOTO COMMUNITY IS GROWING
Some of these projects are still young or have a small
user base.
- They will probably continue to change (improve)
- Ruboto is only version 0.12
Example:
Wasn't able to add a menu to the main activity. Instead
I had to wrap it with the 'launch' activity.
The good news is that they could definitely use YOUR
HELP!
Anyone up for trying to make the debugger work?
Saturday, June 1, 13
CONCLUSION
Ruboto is a great Open Source project with a
growing community that promises to get even
better.
Yes, it does increase your app's startup time
slightly, but offers a great dynamic nature for
rapidly changing apps.
Virtually all code can be Ruby, but can also
reference Java resources if you so desire.
Saturday, June 1, 13
RESOURCES
Sample Code
https://github.com/joelbyler/Ruboto-MasterMind
Ruboto
http://ruboto.org/
ATDD Training Resource
https://leanpub.com/cucumber_and_cheese
More In-Depth Personal Training
http://www.TestAutomationBootCamp.com/
Saturday, June 1, 13
DOMO ARIGATO MR. ROBOTO!
Fun fact:
domo arigato actually means
"Thanks a lot!"
in Japanese
http://en.wikipedia.org/wiki/Domo_arigato
So....
Domo Arigato!
Saturday, June 1, 13
THAT’S A WRAP!
Joel Byler
@joelbyler
Saturday, June 1, 13
COME FLOAT WITH US!
Located on a 10,000 square foot boat on the
Cleveland waterfront, our team exemplifies
how Agile values & principles are practiced.
Come float, deliver, and learn with us, or
leverage our expertise to help you change
your company culture.
@leandog www.leandog.com
Saturday, June 1, 13

More Related Content

What's hot

Librerías Opensoure de Square
Librerías Opensoure de Square Librerías Opensoure de Square
Librerías Opensoure de Square betabeers
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React NativeTadeu Zagallo
 
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017Matteo Manchi
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react nativeAli Sa'o
 
What is FED
What is FEDWhat is FED
What is FEDSam Lee
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Adrian Philipp
 
What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?Evan Stone
 
Building native mobile Apps with ReactNative
Building native mobile Apps with ReactNative Building native mobile Apps with ReactNative
Building native mobile Apps with ReactNative Samuel Barbosa
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsMatteo Manchi
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React NativeWaqqas Jabbar
 
React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101Ranatchai Chernbamrung
 
Hot and spicy Java with Lombok. Live!
Hot and spicy Java with Lombok. Live!Hot and spicy Java with Lombok. Live!
Hot and spicy Java with Lombok. Live!Vladimir Tsukur
 
DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007Tim Bunce
 
Android is going to Go! Android and Golang
Android is going to Go! Android and GolangAndroid is going to Go! Android and Golang
Android is going to Go! Android and GolangAlmog Baku
 
Use groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsUse groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsFátima Casaú Pérez
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.aviSeongJae Park
 

What's hot (20)

Librerías Opensoure de Square
Librerías Opensoure de Square Librerías Opensoure de Square
Librerías Opensoure de Square
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
 
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react native
 
React native
React nativeReact native
React native
 
What is FED
What is FEDWhat is FED
What is FED
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016
 
What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?What's This React Native Thing I Keep Hearing About?
What's This React Native Thing I Keep Hearing About?
 
Building native mobile Apps with ReactNative
Building native mobile Apps with ReactNative Building native mobile Apps with ReactNative
Building native mobile Apps with ReactNative
 
Flutter Intro
Flutter IntroFlutter Intro
Flutter Intro
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
 
Learn Once; Write Anywhere
Learn Once; Write AnywhereLearn Once; Write Anywhere
Learn Once; Write Anywhere
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101React Native "A Bad Idea Or A Game Changer" at Code Mania 101
React Native "A Bad Idea Or A Game Changer" at Code Mania 101
 
Hot and spicy Java with Lombok. Live!
Hot and spicy Java with Lombok. Live!Hot and spicy Java with Lombok. Live!
Hot and spicy Java with Lombok. Live!
 
Capistrano for non-rubyist
Capistrano for non-rubyistCapistrano for non-rubyist
Capistrano for non-rubyist
 
DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007DBI for Parrot and Perl 6 Lightning Talk 2007
DBI for Parrot and Perl 6 Lightning Talk 2007
 
Android is going to Go! Android and Golang
Android is going to Go! Android and GolangAndroid is going to Go! Android and Golang
Android is going to Go! Android and Golang
 
Use groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsUse groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projects
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi
 

Similar to Use Ruby to Write (and Test) Your Next Android App

Tools/Processes for serious android app development
Tools/Processes for serious android app developmentTools/Processes for serious android app development
Tools/Processes for serious android app developmentGaurav Lochan
 
Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIJoel Byler
 
RubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with RubyRubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with RubyAstrails
 
Reverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android appsReverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android appsGaurav Lochan
 
Docker Deployments
Docker DeploymentsDocker Deployments
Docker DeploymentsDocker, Inc.
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahNick Plante
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with RubyAnis Ahmad
 
Philly Spring UG Roo Overview
Philly Spring UG Roo OverviewPhilly Spring UG Roo Overview
Philly Spring UG Roo Overviewkrimple
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projectsjazzman1980
 
Scaling Puppet Usage to a Global Organization
Scaling Puppet Usage to a Global OrganizationScaling Puppet Usage to a Global Organization
Scaling Puppet Usage to a Global OrganizationPuppet
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?Orest Ivasiv
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBrian Sam-Bodden
 
9 reasons why programmers should learn react native
9 reasons why programmers should learn react native9 reasons why programmers should learn react native
9 reasons why programmers should learn react nativeReact Sharing
 
JRuby and Google App Engine
JRuby and Google App EngineJRuby and Google App Engine
JRuby and Google App Enginejoshsmoore
 
Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" EngineRuby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" EngineJoseph Ku
 
Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac xRemote Stacx
 
Take A Gulp at Task Automation
Take A Gulp at Task AutomationTake A Gulp at Task Automation
Take A Gulp at Task AutomationJoel Lord
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020 Bogusz Jelinski
 

Similar to Use Ruby to Write (and Test) Your Next Android App (20)

Tools/Processes for serious android app development
Tools/Processes for serious android app developmentTools/Processes for serious android app development
Tools/Processes for serious android app development
 
Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CI
 
RubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with RubyRubyMotion: Put your Dreams in Motion with Ruby
RubyMotion: Put your Dreams in Motion with Ruby
 
Reverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android appsReverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android apps
 
Practical JRuby
Practical JRubyPractical JRuby
Practical JRuby
 
Docker Deployments
Docker DeploymentsDocker Deployments
Docker Deployments
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with Ruby
 
Philly Spring UG Roo Overview
Philly Spring UG Roo OverviewPhilly Spring UG Roo Overview
Philly Spring UG Roo Overview
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
 
Scaling Puppet Usage to a Global Organization
Scaling Puppet Usage to a Global OrganizationScaling Puppet Usage to a Global Organization
Scaling Puppet Usage to a Global Organization
 
Why don't you Groovy?
Why don't you Groovy?Why don't you Groovy?
Why don't you Groovy?
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
9 reasons why programmers should learn react native
9 reasons why programmers should learn react native9 reasons why programmers should learn react native
9 reasons why programmers should learn react native
 
JRuby and Google App Engine
JRuby and Google App EngineJRuby and Google App Engine
JRuby and Google App Engine
 
Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" EngineRuby on Google App Engine: Upgrade to Google App "Turbo" Engine
Ruby on Google App Engine: Upgrade to Google App "Turbo" Engine
 
Languages used by web app development services remotestac x
Languages used by web app development services  remotestac xLanguages used by web app development services  remotestac x
Languages used by web app development services remotestac x
 
Take A Gulp at Task Automation
Take A Gulp at Task AutomationTake A Gulp at Task Automation
Take A Gulp at Task Automation
 
roofimon@njug5
roofimon@njug5roofimon@njug5
roofimon@njug5
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 

Use Ruby to Write (and Test) Your Next Android App

  • 1. USE RUBY TO WRITE (AND TEST) YOUR NEXT ANDROID APP Joel Byler Software Craftsman @joelbyler June 1, 2013 Pittsburgh TechFest La Roche College Saturday, June 1, 13
  • 2. WHO AM I? JOEL BYLER  Software Craftsman  Organizer for CleRb  Enterprise Java Developer  Relatively new to Ruby  ... and Android Saturday, June 1, 13
  • 4. NEW TO ANDROID AND RUBY???  Software Craftsmanship Reduce risk with TDD / ATDD  <3 Ruby and want to learn more  <3 Mobile apps, who doesn’t? Warning: this may turn out to be a lot of code to absorb in a short amount of time. Slides and code will be made publicly available Saturday, June 1, 13
  • 5. RUBY ON ANDROID USING RUBOTO JRuby optimized for the Android OS  JRuby is a JVM language  Android uses something like the JVM but actually Dalvik VM =+ <<< MAGIC >>> Saturday, June 1, 13
  • 6. IRB ON YOUR ANDROID DEVICE  Interactive Ruby Shell  Edit and run scripts in Android  demo... Saturday, June 1, 13
  • 7. PERFORMANCE CONSIDERATIONS Other than initial startup to load JRuby, the performance of the app appears to be as good as many native Android apps Saturday, June 1, 13
  • 8. RUBOTO CORE  A separate app available on the Google Play Store  Allows Ruboto Runtime (JRuby on Dalvik VM) to be shared  An alternative would be to use the --with-jruby option Decisions, decisions... Saturday, June 1, 13
  • 9. HOW DOES THIS MAKE YOU FEEL? This is what your users will see if they don’t already have the Ruboto Core installed Using the --with-jruby option will add ~10mb to the size of your app or Saturday, June 1, 13
  • 10. CREATE A NEW PROJECT Ruboto Application Generator $ ruboto gen app --package com.leandog.mastermind.ruboto --name MasterMindRuboto --target android-15 --with-jruby --path=RubotoMasterMind This will generate application with 'What hath Matz wrought?' sample code. Saturday, June 1, 13
  • 11. RUBOTO CLASS GENERATOR Ruboto Class Generator $ ruboto gen class Activity --name MasterMindMainActivity This will generate code for the activity and add it to the project manifest. You can also use this to generate a BroadcastReceiver or Service class Saturday, June 1, 13
  • 13. YOUR GENERATED CODE (RUBY .RB) Saturday, June 1, 13
  • 14. YOUR GENERATED TEST (ALSO .RB) Saturday, June 1, 13
  • 15. RAKE INSTEAD OF ANT $ rake install start Install the project on a device or emulator and start it running. $ ant debug $ adb install example.apk $ adb shell am start -n com.foo.bar... $ rake update_scripts Install the project on a device or emulator and start it running. $ adb install example.apk $ rake -T List other available rake tasks Saturday, June 1, 13
  • 16. ADD IN THE ATDD $ gem install testgen This is one of @chzy 's testing gems $ testgen project yourapp --with-gametel This will add everything you need to use cucumber to test your Ruboto app Saturday, June 1, 13
  • 17. NOW FOR SOME UNIT TESTS $ mkdir spec This is where your specs will live Add rspec to Rakefile (created by testgen) Saturday, June 1, 13
  • 18. UNIT TESTING Use rspec to test your ruby code, just like you normally would. rspec JUnit 3 rake spec Saturday, June 1, 13
  • 19. INTEGRATION TEST? Instruments and installs app on device when running rake test similar to ActivityInstrumentationTestCase2 Saturday, June 1, 13
  • 20. ACCEPTANCE TESTING Feature: Input Screen Scenario: Welcome the user When the application launches Then I see "Enter four numbers below and submit your guess" Scenario: User can guess Given I enter 4 numbers When I press the submit button Then I see "Nice guess!" rake features Cucumber Gametel Brazenhead ADB gem class MainScreen include Gametel text(:number1, :index => 0) text(:number2, :index => 1) text(:number3, :index => 2) text(:number4, :index => 3) def guess (first, second, third, forth) number1 = first.to_s number2 = second.to_s number3 = third.to_s number4 = forth.to_s end end Then(/^I enter 4 numbers$/) do on(MainScreen).guess 1, 2, 3, 4 end Saturday, June 1, 13
  • 21. YOUR RUBOTO CLASS FILES  They're just .rb files  Allows you to make changes without a full rebuild  fast feedback  Ruboto uses ruby classes that are backed by java classes for improved performance.  Can still reference Java resources example: R::string::header_text Saturday, June 1, 13
  • 22. QUICK TOUR OF THE CODE * Time permitting Saturday, June 1, 13
  • 24. THE RUBOTO COMMUNITY IS GROWING Some of these projects are still young or have a small user base. - They will probably continue to change (improve) - Ruboto is only version 0.12 Example: Wasn't able to add a menu to the main activity. Instead I had to wrap it with the 'launch' activity. The good news is that they could definitely use YOUR HELP! Anyone up for trying to make the debugger work? Saturday, June 1, 13
  • 25. CONCLUSION Ruboto is a great Open Source project with a growing community that promises to get even better. Yes, it does increase your app's startup time slightly, but offers a great dynamic nature for rapidly changing apps. Virtually all code can be Ruby, but can also reference Java resources if you so desire. Saturday, June 1, 13
  • 26. RESOURCES Sample Code https://github.com/joelbyler/Ruboto-MasterMind Ruboto http://ruboto.org/ ATDD Training Resource https://leanpub.com/cucumber_and_cheese More In-Depth Personal Training http://www.TestAutomationBootCamp.com/ Saturday, June 1, 13
  • 27. DOMO ARIGATO MR. ROBOTO! Fun fact: domo arigato actually means "Thanks a lot!" in Japanese http://en.wikipedia.org/wiki/Domo_arigato So.... Domo Arigato! Saturday, June 1, 13
  • 28. THAT’S A WRAP! Joel Byler @joelbyler Saturday, June 1, 13
  • 29. COME FLOAT WITH US! Located on a 10,000 square foot boat on the Cleveland waterfront, our team exemplifies how Agile values & principles are practiced. Come float, deliver, and learn with us, or leverage our expertise to help you change your company culture. @leandog www.leandog.com Saturday, June 1, 13