Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile Dev NJ Meetup - Top 5 Android Libraries ...

Erik Kamp
September 09, 2015

Mobile Dev NJ Meetup - Top 5 Android Libraries You Should Use

Presentation given at the June 2015 Mobile Dev NJ Meetup Group describing what I consider to be the top 5 most useful Android libraries.

Erik Kamp

September 09, 2015
Tweet

More Decks by Erik Kamp

Other Decks in Technology

Transcript

  1. OKHTTP What its used for : REST Network requests and

    management. Why should I use it : Provides a simple, clean, efficient way to manage and request data from a server in Java and Android . Automatically puts the request on a separate thread.
  2. OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder()

    .url(url) .build(); Response response = client.newCall(request).enqueue(); How to Use it
  3. try { HttpClient httpclient = new DefaultHttpClient(); HttpResponse response =

    httpclient.execute(new HttpGet(URL)); StatusLine statusLine = response.getStatusLine(); if(statusLine.getStatusCode() == HttpStatus.SC_OK){ ByteArrayOutputStream out = new ByteArrayOutputStream(); response.getEntity().writeTo(out); String responseString = out.toString(); //Handle exception … Without It
  4. OTTO What its used for : An event bus used

    to allow decoupled parts of your application to communicate Why should I use it : Significantly cuts down on boilerplate code and allows for elegant MVC or MVVC architecture to be used.
  5. How to Use it Bus applicationBus = new Bus(ThreadEnforcer.ANY); applicationBus.register(this);

    applicationBus.post(new OttoEvent()); @Subscribe public void onEventReceived(OttoEvent ottoEvent) { //Do something with your event }
  6. Picasso What its used for : Hassle free image loading

    and resizing. Why should I use it : Cuts down on image loading and resizing code, eliminates the need for complex memory and image sizing calculations.
  7. ViewPagerIndicator What its used for : Displays an indicator below

    a ViewPager showing the user the current view within a ViewPager they are on. Why should I use it : Provides a clear indication to the user that there are additional views within a ViewPager
  8. GSON What its used for : Converting native Java objects

    into their String JSON representation and vice versa Why should I use it : Optimal for quick server response to Java object conversion and vice versa
  9. How to Use it Gson gson = new GsonBuilder().create(); Writer

    writer = new OutputStreamWriter(new FileOutputStream("Output.json") , "UTF-8") gson.toJson("Picasso", writer); Reader reader = new InputStreamReader(JsonToJava.class.getResourceAs Stream("/Server1.json"), "UTF-8"); Artist artist = gson.fromJson(reader, Artist.class);