广场的改造目前支持GSON和XML内容格式类型这样
GSON:
Gson gson = new GsonBuilder()
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.registerTypeAdapter(Date.class, new DateTypeAdapter())
.create();
RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint("https://api.github.com")
.setConverter(new GsonConverter(gson))
.build();
GitHubService服务= restAdapter.create(GitHubService.class);
XML:
RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint("https://api.soundcloud.com")
.setConverter(new SimpleXMLConverter())
.build();
SoundCloudService service = restAdapter.create(SoundCloudService.class);
您正在处理的文件I/O类型,无论是你需要,你需要建立自己的SimpleBitmapConverter()或者干脆用其他图像载入库像Koush ION
加载的图像成的ImageView /位图与Koush ION:
//这是“长”的方式来做到建立一个ImageView的请求..它允许你设置标题等。
Ion.with(context)
.load("http://example.com/image.png")
.withBitmap()
.placeholder(R.drawable.placeholder_image)
.error(R.drawable.error_image)
.animateLoad(spinAnimation)
.animateIn(fadeInAnimation)
.intoImageView(imageView);
// but for brevity, use the ImageView specific builder...
Ion.with(imageView)
.placeholder(R.drawable.placeholder_image)
.error(R.drawable.error_image)
.animateLoad(spinAnimation)
.animateIn(fadeInAnimation)
.load("http://example.com/image.png");
欢迎来到SO!在发布问题前请阅读http://stackoverflow.com/help/how-to-ask。 – 2014-10-01 11:19:20