This document provides an overview of EzSMS, a simple SMS gateway application for Android built using Ruby. It discusses why SMS is a useful communication method, introduces some key aspects of building Android applications like activities and intents, and provides a high-level look at how Ruboto allows Ruby scripts to be packaged and run as Android applications by mapping the underlying Android APIs. It also shares some limitations of using JRuby and Ruboto on Android.
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
}
}
22. Intent
Use Intents to communicate
within components of an application
or between applications
23. 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);
;
24. Intent Filters
Explicit Intents
Designate a target component by its name
Implicit Intents
Do not name a target
25. Manifest
AndroidManifest.xml
Declaratively specify application
components, services, permissions,
minimum Android API version etc.
45. 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
46. 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