Instant Spring for Android Starter

Anthony Dahanne

  • 出版商: Packt Publishing
  • 出版日期: 2013-01-25
  • 售價: $1,220
  • 貴賓價: 9.5$1,159
  • 語言: 英文
  • 頁數: 72
  • 裝訂: Paperback
  • ISBN: 1782161902
  • ISBN-13: 9781782161905
  • 相關分類: AndroidJava 相關技術
  • 海外代購書籍(需單獨結帳)

相關主題

商品描述

Leverage Spring for Android to create RESTful and OAuth Android apps

Overview

  • 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).

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 Starter" 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.

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.

Approach

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.

商品描述(中文翻譯)

利用Spring for Android創建RESTful和OAuth Android應用程式

概述
- 在瞬間學到新知識!一本短小、快速、專注的指南,能立即帶來成果。
- 了解Spring for Android在Android開發工具包中的功能。
- 學習如何調試Android通訊層,觀察HTTP請求和響應。
- 使用OAuth對用戶和應用程式進行身份驗證,支援流行的服務提供商(如Google、Facebook、Twitter)。

詳細內容
- 連接遠程網絡服務對於大多數Android應用程式來說是一個關鍵功能。REST(表徵狀態轉移)是提供給移動設備和其他設備的最流行的網絡服務架構。OAuth最近成為網絡上最受歡迎的用戶身份驗證和授權方式,因為它可以重複使用流行的網絡平台帳戶(如Google、Facebook、Twitter)。Spring for Android是Spring Framework的擴展,旨在簡化原生Android應用程式的開發。

《Instant Spring for Android Starter》是一本實用的、實戰指南,提供了一系列清晰的逐步練習,幫助您充分利用Spring for Android在REST(RestTemplate)和OAuth(OAuthTemplate)方面提供的抽象。它還將介紹這些架構的基礎知識和相關工具。

本書將帶您開始使用Spring for Android,首先讓您了解如何在項目中包含這些庫(使用Eclipse IDE和流行的構建工具Maven),然後提供一些清晰的實例,展示RESTful和OAuth支持的Android應用程式。

在介紹技術之後,我們將介紹不同的消息轉換器(用於消耗JSON、XML和Atom網絡服務)以及與RESTful網絡服務交互的主要HTTP動詞:GET、POST、DELETE和UPDATE。我們還將提及如何支援HTTP基本身份驗證、Gzip壓縮,並通過一個具體的示例實踐OAuth工作流程,依賴Google OAuth服務提供商對應用程式和用戶進行身份驗證和授權。

您將學到如何使用Android應用程式消耗RESTful網絡服務、對用戶進行身份驗證,以及與其社交平台資料進行交互。

本書將教您:
- 設置Eclipse工作空間以包含第三方庫(如Spring for Android)。
- 使用Android Maven插件處理依賴關係。
- 使用m2e及其m2e-android連接器在Eclipse中處理基於Maven的Android項目。
- 創建連接到RESTful網絡服務的應用程式:使用JSON、XML和Atom消息。
- 創建連接到RESTful網絡服務的應用程式:創建、刪除、更新和檢索數據。
- 在RESTful客戶端應用程式中啟用HTTP基本身份驗證和Gzip壓縮。
- 使用第三方庫Android Annotations簡化RESTful應用程式代碼。
- 創建一個應用程式,對Google OAuth服務提供商進行身份驗證,並允許訪問用戶的基本資料和Google+資料。

方法
- 瞭解一項新技術,了解其功能和對您的幫助,然後開始使用最重要的功能和任務。這是一本入門書,通過豐富的實用代碼示例,為您介紹Spring for Android。