Your SlideShare is downloading. ×
Ruby conf2012
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby conf2012


Published on

Building a SMS based application involves dealing with 3rd party service providers and mobile network operators. As you can imagine, this is time consuming and, given the cost structures in place, …

Building a SMS based application involves dealing with 3rd party service providers and mobile network operators. As you can imagine, this is time consuming and, given the cost structures in place, expensive. For quick prototypes it isn't worth the hassle. While waiting for your own short code, only hope would keep you together. However, we've seen the tremendous power and reach of SMS - especially for applications around a social theme at ThoughtWorks' Social Impact Program.

EzSMS is our attempt at providing a SMS gateway that can be setup in minutes. Of course it runs on Ruby! All you need is an Android powered phone, a sim-card and data access. Thus it is very easy to prototype your apps. Gone are the days when we, Android owners, would feel alone. With Android activations outpacing births it seems that a hundred billion phones have found homes.

In this talk we'll explore Ruboto and JRuby and quickly explain how to create a simple Android application. We'll explore the internals of our application and then compare Ruboto and other Ruby flavoured mobile app development frameworks. We'll also apologize to Sting for mishearing his song "Message in a bottle" .

Published in: Technology

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. EzSMSA simple SMS gateway for Android in Ruby Chandan Jog Habibullah Pagarkar Anand Agrawal
  • 2. Chandan Jog
  • 3. Habibullah Pagarkar @mhabibp
  • 4. Intended Take-Aways Why SMS?Your options for building an SMS based app Quick introduction to Android A taste of Ruby on Android
  • 5. SMS is omnipresentLogical choice and not a “hot new” technologyCaters to the technically un-savvy
  • 6. SMS is powerfulMOTECH and mHealth Suite of services Basic mobile phonesAntenatal and neonatal care
  • 7. SMS is useful
  • 8. In the cloud
  • 9. Or, deal with them
  • 10. DIY
  • 11. your grandma get it up?
  • 12. We <3
  • 13. We <3
  • 14. of an Android app
  • 15. Linux, but not quite Linux kernel + Dalvik VMNo X. No GNU libraries. No JVM.
  • 16. ActivitiesVisual components
  • 17. ActivitiesAn application consists of multiple loosely coupled Activities
  • 18. ActivitiesAn Activity is notified of change in state through application life-cycle callbacks
  • 19. Views and Layouts Views and Widgets Layout
  • 20. 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 }}
  • 21. IntentRoughly analogous to a message
  • 22. Intent Use Intents to communicatewithin components of an application or between applications
  • 23. IntentI nt ent intent = new Intent(I nt ent .ACTION_SEND); t t w ;intent.putExtra(I nt ent .EXTRA_EMAIL, recipientArray); , ;startActivity(intent); ;
  • 24. Intent Filters Explicit IntentsDesignate a target component by its name Implicit Intents Do not name a target
  • 25. Manifest AndroidManifest.xml Declaratively specify applicationcomponents, services, permissions, minimum Android API version etc.
  • 26. <manifest xmlns:android="" package=""> <application android:icon="@drawable/app_notes" android:label="@string/app_name" > <provider android:name="NotePadProvider" android:authorities="" /> <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="" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.GET_CONTENT" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="" /> </intent-filter> </activity> </application></manifest>
  • 27. ServiceBroadcastReceiverContentProvider …
  • 28.
  • 29.’s like, too much code, dude! Whoa!
  • 30. options_from_collection_for_select
  • 31. Konnichiwa, Ruboto-sanAims to make JRuby a first class Android citizen Lends to easy scripting Maps underlying Android layer
  • 32. Flavour 1 ruboto-irbInteractive environment on the phone
  • 33. Flavour 2 ruboto-corePackages Ruby scripts as an APK
  • 34. Pre-reqs JRubyAndroid SDK Ruboto
  • 35. 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
  • 36. Class Generator$ ruboto gen classBroadcastReceiver --nameAwesomenessReceiver
  • 37. Packaging Tasks$ rake install$ rake update_scripts$ rake install:cleanAnd many more with rake -T
  • 38. Poll BoxA simple feedback gathering application
  • 39. are we doing?
  • 40. SMS 08800493714 code Y/N commentezsms Y The talk is awesome!
  • 41.
  • 42. is cheap the code We’ll show you
  • 43. Fork
  • 44. Good news everyone! Use your existing Ruby knowledge Type less ;) Best of both worlds Android APIs RubyGems
  • 45. Bad NewsJRuby 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