SlideShare a Scribd company logo
building


More With Less
           with android bootstrap
tweet tweet @donnfelker
Android Bootstrap
Building More With Less
agenda



         open source
         libraries
         examples
         bootstrap
Android Bootstrap
Pay with Square   GitHub   Gaug.es
tons of open source


tons of integration work
open source

              roboguice
              action bar sherlock
              http-request
              gson
              view pager indicator
              robotium
              maven
              android maven plugin
              fragments
roboguice.org




roboguice
dependency injection
for android
roboguice.org




class RoboWay extends RoboActivity {
    @InjectView(R.id.name)             TextView name;
    @InjectView(R.id.thumbnail)        ImageView thumbnail;
    @InjectResource(R.drawable.icon)   Drawable icon;
    @InjectResource(R.string.app_name) String myName;
    @Inject                            LocationManager loc;

        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            name.setText( "Hello, " + myName );
        }
}
roboguice.org




        User Interface


        Service Layer
                                                         ed a string
                                           wha t if I ne          e?
                                                       d  own her
                                            r esource

     Persistence Layer




service layer: goo.gl/7NQVZ   persistence layer: goo.gl/j5u74
roboguice.org




public class UserRepository {

    @InjectResource(R.string.public_key) String publicKey;

    public void saveProfile(UserProfile profile) {
        // user publicKey to do some encryption
        // Now, save the encrypted profile to db/api/etc
    }
}
roboguice.org




public class UserRepository {

    @InjectResource(R.string.public_key) String publicKey;
    @Inject protected AuthService authService;

    public   void saveProfile(UserProfile profile) {
        //   Get auth token from auth service then save
        //   user publicKey to do some encryption
        //   Now, save the encrypted profile to api
    }
}
roboguice.org




must extend



              RoboActivity
              RoboListActivity
              RoboFragmentActivity
              RoboListFragmentActivity
              ...
roboguice.org
actionbarsherlock.com




action bar sherlock
action bar support for pre 3.x
actionbarsherlock.com



Pay with Square   GitHub                 Gaug.es
actionbarsherlock.com
actionbarsherlock.com




usage


        getSupportActionBar()

        native calls

        supports theming

        must use Sherlock themes
        as parent
actionbarsherlock.com




must extend



              SherlockActivity
              SherlockListActivity
              SherlockFragmentActivity
              SherlockListFragmentActivity
              ...
actionbarsherlock.com




                 ruh roh.
roboguice and actionbarsherlock must both extend activity
github.com/rtyley/roboguice-sherlock




roboguice-sherlock
 combines roboguice and sherlock
github.com/rtyley/roboguice-sherlock




public class CarouselActivity extends RoboSherlockFragmentActivity {

    @InjectView(id.tpi_header) private TitlePageIndicator indicator;
    @InjectView(id.vp_pages) private ViewPager pager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.carousel_view);

        pager.setAdapter(new BootstrapPagerAdapter(getResources(), getSupportFragmentManager()));

        indicator.setViewPager(pager);
        pager.setCurrentItem(1);
    }


}
github.com/rtyley/roboguice-sherlock
kevinsawicki.github.com/http-request/




      http-request
A simple convenience library for using a HttpURLConnection to
          make requests and access the response.
kevinsawicki.github.com/http-request/
kevinsawicki.github.com/http-request/
Android Bootstrap
kevinsawicki.github.com/http-request/
code.google.com/p/google-gson/




       gson
a library for working with json
code.google.com/p/google-gson/
a pojo
  class BagOfPrimitives {
    private int value1 = 1;
    private String value2 = "abc";
    private transient int value3 = 3;
    BagOfPrimitives() {
      // no-args constructor
   }
  }




serialization
  BagOfPrimitives obj = new BagOfPrimitives();
  Gson gson = new Gson();
  String json = gson.toJson(obj); 



deserialization
   BagOfPrimitives obj2 = gson.fromJson(json, BagOfPrimitives.class);
code.google.com/p/google-gson/
a pojo
  class BagOfPrimitives {
    private int value1 = 1;
    private String value2 = "abc";
    private transient int value3 = 3;
    BagOfPrimitives() {
      // no-args constructor
   }
  }




serialization
  BagOfPrimitives obj = new BagOfPrimitives();
  Gson gson = new Gson();
  String json = gson.toJson(obj); 



deserialization
   BagOfPrimitives obj2 = gson.fromJson(json, BagOfPrimitives.class);
code.google.com/p/google-gson/




woohoo! no more manual json parsing
code.google.com/p/google-gson/
viewpagerindicator.com




view pager indicator
viewpagerindicator.com
viewpagerindicator.com
viewpagerindicator.com
code.google.com/p/maven-android-plugin/




 android-maven-plugin
an easy to use maven plugin for android
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>android-bootstrap</artifactId>
    <packaging>apk</packaging>
    <name>Android Bootstrap app</name>
    <url>https://github.com/donnfelker/android-bootstrap</url>

    <parent>
        <version>1.0</version>
        <groupId>com.donnfelker.android.bootstrap</groupId>
        <artifactId>android-bootstrap-parent</artifactId>
    </parent>

    <properties>
        <abs.version>4.1.0</abs.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.google.android</groupId>
            <artifactId>android</artifactId>
            <scope>provided</scope>
            <version>${android.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>com.github.rtyley</groupId>
            <artifactId>roboguice-sherlock</artifactId>
            <version>1.4</version>
        </dependency>
code.google.com/p/maven-android-plugin/




build process easier to manage
code.google.com/p/maven-android-plugin/




resources




            google group

            ch14 of sonatype book
            goo.gl/3Waf5
Android Bootstrap
code.google.com/p/maven-android-plugin/
fragments android support library
download from android sdk
code.google.com/p/robotium




“its like selenium, but for android”
code.google.com/p/robotium
public class EditorTest extends
                ActivityInstrumentationTestCase2<EditorActivity> {

  private Solo solo;

    public EditorTest() {
                  super("com.test.editor",
                                  EditorActivity.class);
    }

    public void setUp() throws Exception {
          solo = new Solo(getInstrumentation(), getActivity());
    }
 
    public void testPreferenceIsSaved() throws Exception {
 
                                solo.sendKey(Solo.MENU);
                                solo.clickOnText("More");
                                solo.clickOnText("Preferences");
                                solo.clickOnText("Edit File Extensions");
                                Assert.assertTrue(solo.searchText("rtf"));
                             
                                solo.clickOnText("txt");
                                solo.clearEditText(2);
                                solo.enterText(2, "robotium");
                                solo.clickOnButton("Save");
                                solo.goBack();
                                solo.clickOnText("Edit File Extensions");
                                Assert.assertTrue(solo.searchText("application/robotium"));
                             
    }

     @Override
     public void tearDown() throws Exception {
          solo.finishOpenedActivities();
    }
}
code.google.com/p/robotium
androidbootstrap.com
Android Bootstrap
androidbootstrap.com



influences github and github gauges

           GitHub          Gaug.es
androidbootstrap.com
includes
           roboguice
           action bar sherlock
           http-request
           gson
           view pager indicator
           robotium
           maven
           android maven plugin
           fragments
           api consumption
           image downloading
           image caching
           cache mechanism
           pojo support
                                        ahhhhhh yeah
           and more...
androidbootstrap.com




uses



       template for your next project
       use as a reference
       a how to tutorial
       project MVP bootstrap
androidbootstrap.com




code
Thank You.
questions? tweet @donnfelker

More Related Content

PDF
Reverse Engineering 안드로이드 학습
KEY
Jggug ws 15th LT 20110224
PDF
Puppet at GitHub - PuppetConf 2013
PPTX
Expression Language 3.0
PPTX
Java Libraries You Can’t Afford to Miss
PPTX
Android & Kotlin - The code awakens #01
PPTX
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)
PDF
Migrating existing Projects to Wonder
Reverse Engineering 안드로이드 학습
Jggug ws 15th LT 20110224
Puppet at GitHub - PuppetConf 2013
Expression Language 3.0
Java Libraries You Can’t Afford to Miss
Android & Kotlin - The code awakens #01
15 tips to improve your unit tests (Droidcon Berlin 2016 Barcamp)
Migrating existing Projects to Wonder

What's hot (20)

PDF
iOS Behavior-Driven Development
PDF
Apple Templates Considered Harmful
PPTX
Android & Kotlin - The code awakens #02
PDF
Python GTK (Hacking Camp)
PDF
Notes2StudyGST-160511
PPTX
Android & Kotlin - The code awakens #03
PDF
History & Practices for UniRx(EN)
PDF
Annotation Processing
PPTX
Kotlin - lo Swift di Android
PDF
Continous delivery with sbt
PDF
How Does Kubernetes Build OpenAPI Specifications?
PDF
The JavaFX Ecosystem
PDF
devday2012
PDF
Dependency Injection with CDI in 15 minutes
PDF
Grailsx@ロンドンへ行ってきた報告。
PDF
CDI: How do I ?
PDF
Server1
PPTX
Introduction to CDI and DI in Java EE 6
PDF
Software Testing - Invited Lecture at UNSW Sydney
KEY
groovy & grails - lecture 7
iOS Behavior-Driven Development
Apple Templates Considered Harmful
Android & Kotlin - The code awakens #02
Python GTK (Hacking Camp)
Notes2StudyGST-160511
Android & Kotlin - The code awakens #03
History & Practices for UniRx(EN)
Annotation Processing
Kotlin - lo Swift di Android
Continous delivery with sbt
How Does Kubernetes Build OpenAPI Specifications?
The JavaFX Ecosystem
devday2012
Dependency Injection with CDI in 15 minutes
Grailsx@ロンドンへ行ってきた報告。
CDI: How do I ?
Server1
Introduction to CDI and DI in Java EE 6
Software Testing - Invited Lecture at UNSW Sydney
groovy & grails - lecture 7
Ad

Viewers also liked (6)

KEY
Android Bootstrap
PPTX
Making your ui look good on android
PDF
How to become an Eclipse committer in 20 minutes and fork the IDE
PDF
Building beautiful User Interface in Android
PDF
Eclipse platform news and how to contribute to the Eclipse Open Source project
PDF
Belajar Android Studio CRUD Data Mahasiswa
Android Bootstrap
Making your ui look good on android
How to become an Eclipse committer in 20 minutes and fork the IDE
Building beautiful User Interface in Android
Eclipse platform news and how to contribute to the Eclipse Open Source project
Belajar Android Studio CRUD Data Mahasiswa
Ad

Similar to Android Bootstrap (20)

PPT
Groovy & Grails: Scripting for Modern Web Applications
PDF
Overview of Android Infrastructure
PDF
Overview of Android Infrastructure
PPT
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
PDF
Enterprise Guice 20090217 Bejug
PDF
Developing Useful APIs
KEY
JavaScript Growing Up
PDF
droidparts
PDF
Xitrum @ Scala Matsuri Tokyo 2014
PDF
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
KEY
CouchDB on Android
PDF
Grooscript gr8conf
PDF
Android Best Practices
PDF
Java Libraries You Can’t Afford to Miss
PPTX
Groovy Grails Gr8Ladies Women Techmakers: Minneapolis
PDF
Workshop 26: React Native - The Native Side
PDF
Scripting GeoServer
PDF
PPT
What's New in Groovy 1.6?
PDF
Embedding Groovy in a Java Application
Groovy & Grails: Scripting for Modern Web Applications
Overview of Android Infrastructure
Overview of Android Infrastructure
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
Enterprise Guice 20090217 Bejug
Developing Useful APIs
JavaScript Growing Up
droidparts
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
CouchDB on Android
Grooscript gr8conf
Android Best Practices
Java Libraries You Can’t Afford to Miss
Groovy Grails Gr8Ladies Women Techmakers: Minneapolis
Workshop 26: React Native - The Native Side
Scripting GeoServer
What's New in Groovy 1.6?
Embedding Groovy in a Java Application

More from donnfelker (8)

PDF
Understanding Android Build Variants
PDF
Building More with Less
KEY
Building HTTP API's with NodeJS and MongoDB
KEY
Whats New in Android
KEY
Outsourcing Do's and Don'ts
PDF
Advanced android
PPTX
Introduction to Android Development
PPT
20080531 Intro To Dependency Injection & Inversion Of Control
Understanding Android Build Variants
Building More with Less
Building HTTP API's with NodeJS and MongoDB
Whats New in Android
Outsourcing Do's and Don'ts
Advanced android
Introduction to Android Development
20080531 Intro To Dependency Injection & Inversion Of Control

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Modernizing your data center with Dell and AMD
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
KodekX | Application Modernization Development
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Electronic commerce courselecture one. Pdf
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
cuic standard and advanced reporting.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Modernizing your data center with Dell and AMD
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
The AUB Centre for AI in Media Proposal.docx
Dropbox Q2 2025 Financial Results & Investor Presentation
Reach Out and Touch Someone: Haptics and Empathic Computing
KodekX | Application Modernization Development
Building Integrated photovoltaic BIPV_UPV.pdf
Spectral efficient network and resource selection model in 5G networks
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Android Bootstrap

Editor's Notes