Spring系列之Spring for Android

文增
2023-12-01

1 概述:

Spring for Android 是一个框架,提供Spring组件供安卓APP开发使用,和其他Spring项目一样,Spring for Android 能很容易的被使用和被扩展。
特性1
提供restful风格的客户端。
特性2
提供访问安全权限的API。
下面提供一个例子,谷歌搜索。
// 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”);

2 学习:

目前有以下3个版本,
2.0.0 M3 CURRENT,这个是最新版,开发版。
2.0.0 SNAPSHOT, 这个是开发版。
1.0.1 CURRENT GA 这个是正式版。

 类似资料: