RoboGuice - Android development made simple and fun



"Simple and Fun!" Now, they make quite a promise!

read up:

https://github.com/roboguice/roboguice/blob/master/README.md

https://github.com/roboguice/roboguice/wiki

Maven repo:


org.roboguice
roboguice
3.0.1


OK, so most of all RoboGuice is about DEPENDENCY INJECTION



Examples:


@InjectView(R.id.label)
TextView label;

@InjectResource(R.string.app_name) // strings, drawables
String applicationName;

@Inject // system service
LayoutInflater layoutInflater;

@Inject
LocationManager locationManager;

@Inject // POJO
Book book;


Creating Activities



public class FightForcesOfEvilActivity extends RoboActivity {

@InjectView(R.id.expletive) 
TextView expletiveText;

Creating Android Modules


public class MyModule extends AbstractModule {
@Override
protected void configure() { }



AsynchTask 


public static class AsyncPunch extends RoboAsyncTask {

// Astroboy is a @Singleton public class Astroboy {
@Inject Astroboy astroboy;

// new instance of java.util.Random, since we haven't specified any binding instructions
@Inject Random random;


If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins



As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles