SlideShare ist ein Scribd-Unternehmen logo
1 von 50
EzSMS
A simple SMS gateway for Android
            in Ruby



                            Chandan Jog
                     Habibullah Pagarkar
                         Anand Agrawal
Chandan Jog
    @jog_chandan
cjog@thoughtworks.com
Habibullah Pagarkar
       @mhabibp
 hulk@thoughtworks.com
Intended Take-Aways
                Why SMS?

Your options for building an SMS based app

      Quick introduction to Android

        A taste of Ruby on Android
SMS is omnipresent

Logical choice and not a “hot new”
            technology

Caters to the technically un-savvy
SMS is powerful



MOTECH and mHealth
     Suite of services
   Basic mobile phones
Antenatal and neonatal care
SMS is useful
In the cloud
Or, deal with them
DIY
http://socialwebdaily.com/wp-content/uploads/2011/12/grandma_meme_large1.jpg
Can your grandma get it up?
We <3
We <3
http://walyou.com/android-exploded-shirt/
Anatomy of an Android app
Linux, but not quite


   Linux kernel + Dalvik VM

No X. No GNU libraries. No JVM.
Activities


Visual components
Activities


An application consists of multiple
    loosely coupled Activities
Activities


An Activity is notified of change in state
          through application
           life-cycle callbacks
Views and Layouts


  Views and Widgets

       Layout
publ i c class Exam eAc t i vi t y extends Act i vi t y {
               s       pl                s
        @Override  e
        publ i c void onCreate(Bundl e savedInstanceState) {
                     d                                    )
                s uper .onCreate(savedInstanceState);   ;
        }

      @Override  e
      pr ot ect ed void onStart() {
                 d     d         )
              s uper .onStart();
                               ;
      }

      @Override  e
      pr ot ect ed void onResume() {
                 d     d          )
              s uper .onResume();
                                ;
      }

      @Override  e
      pr ot ect ed void onPause() {
                 d     d         )
              s uper .onPause();
                               ;
      }

      @Override  e
      pr ot ect ed void onStop() {
                 d     d        )
              s uper .onStop();
                              ;
      }

      @Override  e
      pr ot ect ed void onDestroy() {
                 d     d
              s uper .onDestroy();
                                 ;
                                   )                           Activity
      }
}
Intent


Roughly analogous to a message
Intent

    Use Intents to communicate

within components of an application

      or between applications
Intent

I nt ent intent = new Intent(I nt ent .ACTION_SEND);
       t      t     w                              ;

intent.putExtra(I nt ent .EXTRA_EMAIL, recipientArray);
                                     ,                ;

startActivity(intent);
                     ;
Intent Filters

              Explicit Intents
Designate a target component by its name

            Implicit Intents
          Do not name a target
Manifest

      AndroidManifest.xml

 Declaratively specify application
components, services, permissions,
 minimum Android API version etc.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.example.android.notepad">
      <application android:icon="@drawable/app_notes"
                    android:label="@string/app_name" >
           <provider android:name="NotePadProvider"
                      android:authorities="com.google.provider.NotePad" />
           <activity android:name="NotesList"
                      android:label="@string/title_notes_list">
                    <intent-filter>
                           <action android:name="android.intent.action.MAIN" />
                           <category android:name="android.intent.category.LAUNCHER" />
                    </intent-filter>
                    <intent-filter>
                           <action android:name="android.intent.action.VIEW" />
                           <action android:name="android.intent.action.EDIT" />
                           <action android:name="android.intent.action.PICK" />
                           <category android:name="android.intent.category.DEFAULT" />
                           <data android:mimeType="vnd.android.cursor.dir/vnd.google.note" />
                    </intent-filter>
                    <intent-filter>
                           <action android:name="android.intent.action.GET_CONTENT" />
                           <category android:name="android.intent.category.DEFAULT" />
                           <data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
                    </intent-filter>
             </activity>
     </application>
</manifest>
Service

BroadcastReceiver

ContentProvider

       …
Open

DBAdapter.java
http://awesomebmovies.com/2011/04/bill-and-teds-back-in-action/
It’s like, too much code, dude!
              Whoa!
options_from_collection_for_select
Konnichiwa, Ruboto-san

Aims to make JRuby a first class Android
                citizen

        Lends to easy scripting

    Maps underlying Android layer
Flavour 1

             ruboto-irb

Interactive environment on the phone
Flavour 2

         ruboto-core

Packages Ruby scripts as an APK
Pre-reqs

   JRuby

Android SDK

  Ruboto
Application Generator
$ ruboto gen app
--package com.yourdomain.whatever
--path path/to/app
--name AppName
--target android-version
--min-sdk another-android-version
--activity MainActivityName
Class Generator


$ ruboto gen class
BroadcastReceiver --name
AwesomenessReceiver
Packaging Tasks
$ rake install

$ rake update_scripts

$ rake install:clean

And many more with rake -T
Poll Box


A simple feedback gathering application



          http://Poll-Box.com
http://www.caribdirect.com/2012/01/31/hows-my-driving-too-fast-too-bad/
How are we doing?
SMS 08800493714

    code Y/N comment

ezsms Y The talk is awesome!
poll-box.com/response/102/ezsms
http://en.wikipedia.org/wiki/Linus_Torvalds
Talk is cheap




                       the code
                We’ll show you
Fork it



github.com/chandanjog/ez_sms
Good news everyone!




                                       http://hollywoodhatesme.files.wordpress.com/2011/09/prof-farnsworth.jpg
 Use your existing Ruby knowledge

                      Type less ;)

               Best of both worlds
                        Android APIs
                          RubyGems
Bad News
JRuby isn’t designed for constrained devices

  Stack space limitations on the Dalvik VM

 Ruboto doesn’t completely abstract away
         Android’s complexities

         Slow JRuby start-up time
Ruby conf2012
Ruby conf2012
Ruby conf2012
Ruby conf2012

Weitere ähnliche Inhalte

Andere mochten auch

Javascript patterns
Javascript patternsJavascript patterns
Javascript patternsChandan Jog
 
Hp secap android
Hp secap androidHp secap android
Hp secap androidrajeshckr
 
DevFest Nordeste - 2014 - Ruboto - Breno Moura
DevFest Nordeste - 2014 - Ruboto - Breno MouraDevFest Nordeste - 2014 - Ruboto - Breno Moura
DevFest Nordeste - 2014 - Ruboto - Breno MouraBreno Moura
 
PPT on Android Applications
PPT on Android ApplicationsPPT on Android Applications
PPT on Android ApplicationsAshish Agarwal
 
SMS Setup in Practo
SMS Setup in PractoSMS Setup in Practo
SMS Setup in Practopracto
 
My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my collegeSneha Lata
 

Andere mochten auch (7)

Javascript patterns
Javascript patternsJavascript patterns
Javascript patterns
 
Hp secap android
Hp secap androidHp secap android
Hp secap android
 
DevFest Nordeste - 2014 - Ruboto - Breno Moura
DevFest Nordeste - 2014 - Ruboto - Breno MouraDevFest Nordeste - 2014 - Ruboto - Breno Moura
DevFest Nordeste - 2014 - Ruboto - Breno Moura
 
Ruboto
RubotoRuboto
Ruboto
 
PPT on Android Applications
PPT on Android ApplicationsPPT on Android Applications
PPT on Android Applications
 
SMS Setup in Practo
SMS Setup in PractoSMS Setup in Practo
SMS Setup in Practo
 
My presentation on Android in my college
My presentation on Android in my collegeMy presentation on Android in my college
My presentation on Android in my college
 

Ähnlich wie Ruby conf2012

Android training in mumbai
Android training in mumbaiAndroid training in mumbai
Android training in mumbaiCIBIL
 
android level 3
android level 3android level 3
android level 3DevMix
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development PracticesRoy Clarkson
 
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
 
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016Loïc Knuchel
 
rssfeeds.classpathrssfeeds.project rssfeed .docx
rssfeeds.classpathrssfeeds.project  rssfeed  .docxrssfeeds.classpathrssfeeds.project  rssfeed  .docx
rssfeeds.classpathrssfeeds.project rssfeed .docxjoellemurphey
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recieversUtkarsh Mankad
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...Ted Chien
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)Jose Manuel Pereira Garcia
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)Bramus Van Damme
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better PerformanceElif Boncuk
 
How to code to code less
How to code to code lessHow to code to code less
How to code to code lessAnton Novikau
 
Android tutorial (2)
Android tutorial (2)Android tutorial (2)
Android tutorial (2)Kumar
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basicsAnton Narusberg
 

Ähnlich wie Ruby conf2012 (20)

Android training in mumbai
Android training in mumbaiAndroid training in mumbai
Android training in mumbai
 
android level 3
android level 3android level 3
android level 3
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Android - Anatomy of android elements & layouts
Android - Anatomy of android elements & layoutsAndroid - Anatomy of android elements & layouts
Android - Anatomy of android elements & layouts
 
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
 
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
Ionic2, les développeurs web à l'assaut du mobile, BDX I/O le 21/10/2016
 
rssfeeds.classpathrssfeeds.project rssfeed .docx
rssfeeds.classpathrssfeeds.project  rssfeed  .docxrssfeeds.classpathrssfeeds.project  rssfeed  .docx
rssfeeds.classpathrssfeeds.project rssfeed .docx
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
Android activity, service, and broadcast recievers
Android activity, service, and broadcast recieversAndroid activity, service, and broadcast recievers
Android activity, service, and broadcast recievers
 
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
viWave Study Group - Introduction to Google Android Development - Chapter 23 ...
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 
Android dev
Android devAndroid dev
Android dev
 
How to Make Android Native Application
How to Make Android Native ApplicationHow to Make Android Native Application
How to Make Android Native Application
 
Android Intro
Android IntroAndroid Intro
Android Intro
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)From Idea to App (or “How we roll at Small Town Heroes”)
From Idea to App (or “How we roll at Small Town Heroes”)
 
Optimizing Apps for Better Performance
Optimizing Apps for Better PerformanceOptimizing Apps for Better Performance
Optimizing Apps for Better Performance
 
How to code to code less
How to code to code lessHow to code to code less
How to code to code less
 
Android tutorial (2)
Android tutorial (2)Android tutorial (2)
Android tutorial (2)
 
Android app development basics
Android app development basicsAndroid app development basics
Android app development basics
 

Kürzlich hochgeladen

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
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.pptxRustici Software
 
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...Jeffrey Haguewood
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
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 FMESafe Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
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 WorkerThousandEyes
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
"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 ...Zilliz
 
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...DianaGray10
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
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...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
"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 ...
 
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...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+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...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Ruby conf2012