• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Ruby conf2012
 

Ruby conf2012

on

  • 756 views

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" .

Statistics

Views

Total Views
756
Views on SlideShare
756
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Ruby conf2012 Ruby conf2012 Presentation Transcript

    • EzSMSA simple SMS gateway for Android in Ruby Chandan Jog Habibullah Pagarkar Anand Agrawal
    • 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 A taste of Ruby on 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 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 }}
    • 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.putExtra(I nt ent .EXTRA_EMAIL, recipientArray); , ;startActivity(intent); ;
    • Intent Filters Explicit IntentsDesignate a target component by its name Implicit Intents Do not name a target
    • Manifest AndroidManifest.xml Declaratively specify applicationcomponents, 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>
    • 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 Maps underlying Android layer
    • 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-version--min-sdk another-android-version--activity MainActivityName
    • 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-farnsworth.jpg Use your existing Ruby knowledge Type less ;) Best of both worlds Android APIs RubyGems
    • 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