EzSMSA simple SMS gateway for Android            in Ruby                            Chandan Jog                     Habibu...
Chandan Jog    @jog_chandancjog@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  ...
SMS is omnipresentLogical choice and not a “hot new”            technologyCaters to the technically un-savvy
SMS is powerfulMOTECH and mHealth     Suite of services   Basic mobile phonesAntenatal 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.jpgCan 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 VMNo X. No GNU libraries. No JVM.
ActivitiesVisual components
ActivitiesAn application consists of multiple    loosely coupled Activities
ActivitiesAn 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   ...
IntentRoughly analogous to a message
Intent    Use Intents to communicatewithin components of an application      or between applications
IntentI nt ent intent = new Intent(I nt ent .ACTION_SEND);       t      t     w                              ;intent.putEx...
Intent Filters              Explicit IntentsDesignate a target component by its name            Implicit Intents          ...
Manifest      AndroidManifest.xml Declaratively specify applicationcomponents, services, permissions, minimum Android API ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android"          package="com.example.android.notepad">      ...
ServiceBroadcastReceiverContentProvider       …
OpenDBAdapter.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-sanAims to make JRuby a first class Android                citizen        Lends to easy scripting    Ma...
Flavour 1             ruboto-irbInteractive environment on the phone
Flavour 2         ruboto-corePackages Ruby scripts as an APK
Pre-reqs   JRubyAndroid SDK  Ruboto
Application Generator$ ruboto gen app--package com.yourdomain.whatever--path path/to/app--name AppName--target android-ver...
Class Generator$ ruboto gen classBroadcastReceiver --nameAwesomenessReceiver
Packaging Tasks$ rake install$ rake update_scripts$ rake install:cleanAnd many more with rake -T
Poll BoxA 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 commentezsms Y The talk is awesome!
poll-box.com/response/102/ezsms
http://en.wikipedia.org/wiki/Linus_TorvaldsTalk is cheap                       the code                We’ll show you
Fork itgithub.com/chandanjog/ez_sms
Good news everyone!                                       http://hollywoodhatesme.files.wordpress.com/2011/09/prof-farnswo...
Bad NewsJRuby isn’t designed for constrained devices  Stack space limitations on the Dalvik VM Ruboto doesn’t completely a...
Ruby conf2012
Ruby conf2012
Ruby conf2012
Ruby conf2012
Ruby conf2012
Upcoming SlideShare
Loading in...5
×

Ruby conf2012

665

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, 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
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
665
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Ruby conf2012

  1. 1. EzSMSA simple SMS gateway for Android in Ruby Chandan Jog Habibullah Pagarkar Anand Agrawal
  2. 2. Chandan Jog @jog_chandancjog@thoughtworks.com
  3. 3. Habibullah Pagarkar @mhabibp hulk@thoughtworks.com
  4. 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. 5. SMS is omnipresentLogical choice and not a “hot new” technologyCaters to the technically un-savvy
  6. 6. SMS is powerfulMOTECH and mHealth Suite of services Basic mobile phonesAntenatal and neonatal care
  7. 7. SMS is useful
  8. 8. In the cloud
  9. 9. Or, deal with them
  10. 10. DIY
  11. 11. http://socialwebdaily.com/wp-content/uploads/2011/12/grandma_meme_large1.jpgCan your grandma get it up?
  12. 12. We <3
  13. 13. We <3
  14. 14. http://walyou.com/android-exploded-shirt/Anatomy of an Android app
  15. 15. Linux, but not quite Linux kernel + Dalvik VMNo X. No GNU libraries. No JVM.
  16. 16. ActivitiesVisual components
  17. 17. ActivitiesAn application consists of multiple loosely coupled Activities
  18. 18. ActivitiesAn Activity is notified of change in state through application life-cycle callbacks
  19. 19. Views and Layouts Views and Widgets Layout
  20. 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. 21. IntentRoughly analogous to a message
  22. 22. Intent Use Intents to communicatewithin components of an application or between applications
  23. 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. 24. Intent Filters Explicit IntentsDesignate a target component by its name Implicit Intents Do not name a target
  25. 25. Manifest AndroidManifest.xml Declaratively specify applicationcomponents, services, permissions, minimum Android API version etc.
  26. 26. <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>
  27. 27. ServiceBroadcastReceiverContentProvider …
  28. 28. OpenDBAdapter.java
  29. 29. http://awesomebmovies.com/2011/04/bill-and-teds-back-in-action/It’s like, too much code, dude! Whoa!
  30. 30. options_from_collection_for_select
  31. 31. Konnichiwa, Ruboto-sanAims to make JRuby a first class Android citizen Lends to easy scripting Maps underlying Android layer
  32. 32. Flavour 1 ruboto-irbInteractive environment on the phone
  33. 33. Flavour 2 ruboto-corePackages Ruby scripts as an APK
  34. 34. Pre-reqs JRubyAndroid SDK Ruboto
  35. 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. 36. Class Generator$ ruboto gen classBroadcastReceiver --nameAwesomenessReceiver
  37. 37. Packaging Tasks$ rake install$ rake update_scripts$ rake install:cleanAnd many more with rake -T
  38. 38. Poll BoxA simple feedback gathering application http://Poll-Box.com
  39. 39. http://www.caribdirect.com/2012/01/31/hows-my-driving-too-fast-too-bad/How are we doing?
  40. 40. SMS 08800493714 code Y/N commentezsms Y The talk is awesome!
  41. 41. poll-box.com/response/102/ezsms
  42. 42. http://en.wikipedia.org/wiki/Linus_TorvaldsTalk is cheap the code We’ll show you
  43. 43. Fork itgithub.com/chandanjog/ez_sms
  44. 44. 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
  45. 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

×