use of com.chrishoekstra.trello.vo.MemberVO in project Trello-Android by chrisHoekstra.
the class DashboardActivity method populateView.
private void populateView() {
mBoardAdapter = new BoardAdapter(this, R.id.name, mModel.getAllBoards());
mBoardsList.setAdapter(mBoardAdapter);
MemberVO user = mModel.getUser();
mFullNameText.setText(user.fullName);
mUsernameText.setText('(' + user.username + ')');
}
use of com.chrishoekstra.trello.vo.MemberVO in project Trello-Android by chrisHoekstra.
the class TrelloService method getUser.
public MemberVO getUser() {
MemberVO result = null;
ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
params.add(new BasicNameValuePair("key", PUBLIC_KEY));
params.add(new BasicNameValuePair("token", mToken));
HttpGet httpGet = new HttpGet(TRELLO_API_URL + "members/" + "me?" + URLEncodedUtils.format(params, "UTF-8"));
HttpClient httpClient = getHttpClient();
try {
httpGet.setHeader("Accept", "application/json, text/javascript, */*; q=0.01");
httpClient.getParams().setParameter(CoreProtocolPNames.USER_AGENT, USER_AGENT_STRING);
HttpResponse response = httpClient.execute(httpGet, mContext);
if (response != null) {
result = mObjectMapper.readValue(mJsonFactory.createJsonParser(new InputStreamReader(response.getEntity().getContent(), "UTF-8")), MemberVO.class);
}
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
Aggregations