Android 将邮件发送到朋友的收件箱
我让我的facebook朋友使用这个代码。谷歌搜索和做一些研究,这个代码在我的项目中起作用Android 将邮件发送到朋友的收件箱,android,facebook,facebook-messages,Android,Facebook,Facebook Messages,我让我的facebook朋友使用这个代码。谷歌搜索和做一些研究,这个代码在我的项目中起作用 public void harhar(){ HttpClient httpclient = new DefaultHttpClient(); String url = "https://graph.facebook.com/me/friends?access_token=" + URLEncoder.encode(access_token);
public void harhar(){
HttpClient httpclient = new DefaultHttpClient();
String url = "https://graph.facebook.com/me/friends?access_token=" + URLEncoder.encode(access_token);
HttpGet httppost = new HttpGet(url);
try {
HttpResponse response = httpclient.execute(httppost);
// to get the response string
BufferedReader reader = new BufferedReader(
new InputStreamReader(
response.getEntity().getContent(), "UTF-8"));
// used to construct the string
String res = "";
for (String line = null; (line = reader.readLine()) != null;) {
res += line + "\n";
}
JSONObject obj = new JSONObject(new JSONTokener(res));
JSONArray data = obj.getJSONArray("data");
Log.i("DATA",data+"");
int len = data.length();
for (int i = 0; i < len; i++) {
JSONObject currentResult = data.getJSONObject(i);
String name = currentResult.getString("name");
String id=currentResult.getString("id");
Log.i("Name harharhar",name);
Log.i("ID harharhar",id);
namelist.add(name);
IDList.add(id);
}
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
我有我朋友的身份证和名字。我创建listview并存储名称。现在我想知道的是如何将messenge发送到朋友的facebook收件箱。请提供帮助。您需要使用“发送”或“消息”对话框感谢您的评论!!!你想给我样本还是编码?你可以在网站上阅读,需要Facebook留言。我不能使用facebook留言器。还有别的办法吗?不,那是唯一的办法