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

Android Spring Rest Template

Dimas Ragil T
November 06, 2015

Android Spring Rest Template

Android with Spring

Dimas Ragil T

November 06, 2015
Tweet

Other Decks in Programming

Transcript

  1. What is? 〉 Spring for Android is an extension of

    the Spring Framework that aims to simplify the development of native Android applications. 〉 http://projects.spring.io/spring-android/
  2. Its Magic? 〉 Spring for Android is a framework that

    is designed to provide components of the Spring family of projects for use in Android apps. Like all Spring projects, the real power of Spring for Android is found in how easily it can be extended.
  3. How use? 〉 // The connection URL 〉 String url

    = "https://ajax.googleapis.com/ajax/" + 〉 "services/search/web?v=1.0&q={query}"; 〉 // Create a new RestTemplate instance 〉 RestTemplate restTemplate = new RestTemplate(); 〉 // Add the String message converter 〉 restTemplate.getMessageConverters().add(new StringHttpMessageConverter()); 〉 // Make the HTTP GET request, marshaling the response to a String 〉 String result = restTemplate.getForObject(url, String.class, "Android");