Instant Spring for Android Starter [Instant]

This title is available as an eBook only
Instant Spring for Android Starter [Instant]
eBook: $14.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print & eBook also available on:
Learn in an Instant - Short, Fast, Focused
Table of Contents
Sample Chapters


  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results.
  • Learn what Spring for Android adds to the Android developer toolkit
  • Learn how to debug your Android communication layer observing HTTP requests and responses
  • Use OAuth to authenticate your users and your app against popular service providers (Google, Facebook, Twitter, and so on)


Book Details

Language : English
eBook : 72 pages
Release Date : January 2013
ISBN : 1782161902
ISBN 13 : 9781782161905
Author(s) : Anthony Dahanne
Topics and Technologies : All Books, Instant, Mobile Application Development, Mobile, Open Source

Table of Contents

Instant Spring for Android Starter
  • Instant Spring for Android Starter
    • So, what is Spring for Android?
      • RestTemplate
      • Auth/Spring Social
      • What Spring for Android is not
    • Integrating it in an Android app
      • Minimal dependencies to add or use RestTemplate
      • Getting started with Eclipse and Spring for Android
        • Installing the ADT plugin
        • First example app
      • Using Maven to build a Spring for Android app
    • Quick start – RestTemplate
      • Different message converters
        • MappingJacksonHttpMessageConverter
        • SimpleXmlHttpMessageConverter
        • RssChannelHttpMessageConverter
      • Gzip encryption
      • HTTP Basic authentication
      • The RESTful recipe app
        • RecipeList activity: listing all recipes stored on the server
        • RecipeEditor activity
      • Android annotations
    • Quick start – OAuth
      • Developing a website or an app relying on a service provider
      • The OAuth dance
      • Spring for Android Auth module
      • An OAuth example using Google
    • People and places you should get to know
      • Official sites
      • Articles and tutorials
      • Community
      • Blogs
      • Twitter

Anthony Dahanne

Anthony Dahanne is a Java software developer since 2005. His favorite topics include Android, Continuous Integration, Web Services, and of course, core Java development. During his spare time, he enjoys hacking on some open source Android app (G2Android, ReGalAndroid, and so on). He also contributes from time to time to build/IDE plugins usually involving Maven and Eclipse. You can meet him at one of the many Java-related user group gatherings at Montréal (Android Montréal, Montréal JUG, Big Data Montréal, and so on). Working at Terracotta, he's currently implementing the REST management tools for EhCache.
Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.

Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

Sorry, there are currently no downloads available for this title.

Frequently bought together

Instant Spring for Android Starter [Instant] +    WordPress 3 Complete =
50% Off
the second eBook
Price for both: ₨240.20

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book


  • Set up your Eclipse workspace to include third party libraries (such as Spring for Android)
  • Deal with dependencies using the Android Maven Plugin
  • Use m2e and its m2e-android connector to work with Maven based Android projects in Eclipse
  • Create an app connecting to a RESTful web service: using JSON, XML, and Atom messages
  • Create an app connecting to a RESTful web service: creating, deleting, updating, and retrieving data to and from this service
  • Enable HTTP BasicAuth and Gzip compression in your RESTful client app
  • Use the third party library Android Annotations to simplify your RESTful app code
  • Create an app authenticating the Google OAuth service provider and allowing access to the user basic and Google+ profiles


In Detail

The possibility to connect to remote web services is a key feature for most Android apps. REST (Representational State Transfer) is the most popular architecture to provide web services to mobile devices and others. OAuth has recently become the web’s favorite way to authenticate and authorize users and apps, thanks to its capability to re-use popular web platforms accounts (Google, Facebook, Twitter). Spring for Android is an extension of the Spring Framework that aims to simplify the development of native Android applications.

"Instant Spring for Android Starterr" is a practical, hands-on guide that provides you with a number of clear step-by-step exercises, which will help you take advantage of the abstractions offered by Spring for Android with regard to REST (RestTemplate) and OAuth (OAuthTemplate). It will also introduce you to the bases of those architectures and the associated tooling.

This book gets you started using Spring for Android, first letting you know how to set up your workspace to include those libraries in your projects (with the Eclipse IDE and also with the popular building tool Maven) and then providing some clear and real life examples of RESTful and OAUth backed Android applications.

After introducing the technology, we’ll discover the different Message Converters provided (to consume JSON, XML, and Atom web services) and the main HTTP verbs to interact with RESTful webservices: GET, POST, DELETE, and UPDATE. We’ll also mention how to support HTTP Basic Auth, Gzip compression, and finally put in practice the OAuth workflow with a concrete example relying on the Google OAuth service provider to authenticate and authorize an app and users.

You will learn everything you need to consume RESTful web services, authenticate your users, and interact with their social platforms profiles from your Android app.


Get to grips with a new technology, understand what it is and what it can do for you, and then get to work with the most important features and tasks.

This is a Starter which gives you an introduction to Spring for Android with plenty of well-explained practical code examples.

Who this book is for

If you are an Android developer who wants to learn about RESTful web services and OAuth authentication and authorization, and you also want to know how to speed up your development involving those architectures using Spring for Android abstractions, then this book is for you.

But core Java developers are not forgotten, thanks to the explanations on how to set up Eclipse and Maven for Android development (very basic knowledge regarding Android UI design is required to understand the examples; the right pointers to ramp up on this topic are provided though).

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software