Вот код, большое спасибоpackage synctc.me.rssfeed;
import android.nfc.Tag;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import butterknife.ButterKnife;
import butterknife.InjectView;
public class MainActivity extends ActionBarActivity {
public static final String TAG = MainActivity.class.getSimpleName();
private Current mCurrent ;
@InjectView(R.id.title)TextView mTitle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.inject(this);
getUrl();
Log.d(TAG,"Main UI is Running");
}
private void getUrl(){
String url ="https://www.facebook.com/feeds/page.php ... 2925545909";
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url(url)
.build();
Call call=client.newCall(request);
call.enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
runOnUiThread(new Runnable() {
@Override
public void run() {
}
});
}
@Override
public void onResponse(Response response) throws IOException {
runOnUiThread(new Runnable() {
@Override
public void run() {
}
});
try {
String jsonData = response.body().string();
Log.v(TAG, jsonData);
if(response.isSuccessful()){
mCurrent = getCurrentDetails(jsonData);
runOnUiThread(new Runnable() {
@Override
public void run() {
updateDisplay();
}
});
}else{
}
} catch (IOException e) {
Log.e(TAG, "Exception Caught : ",e);
}
catch (JSONException e){
Log.e(TAG, "Exception Caught : ",e);
}
}
});}
private void updateDisplay (){
mTitle.setText(mCurrent.getTitle()+"");
}
private Current getCurrentDetails(String jsonData) throws JSONException{
JSONObject channel = new JSONObject (jsonData);
String channelVal = channel.getString("channel");
JSONObject currently = new JSONObject(channel.get("channel").toString());
Current current = new Current();
current.setTitle(currently.getString("title"));
Log.i(TAG,"From JSON To:"+channelVal);
return current;
}
}
< /code>
current.java
public class Current {
private String mChannel;
private String mTitle;
private String mDescription;
private String mImg;
public String getDescription() {
return mDescription;
}
public void setDescription(String description) {
mDescription = description;
}
public String getImg() {
return mImg;
}
public void setImg(String img) {
mImg = img;
}
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
mTitle = title;
}
public String getChannel() {
return mChannel;
}
public void setChannel(String channel) {
mChannel = channel;
}
}
< /code>
Вот logcat < /p>
حائط Professional Hackers على فيسبوك
https://www.facebook.com/
حائط Professional Hackers على فيسبوك
en-us
PageSyndicationFeed
Facebook Syndicationhttp://www.rssboard.org/rss-specification
Mon, 08 Sep 2014 10:48:32 +0000
webmaster@facebook.com
www.facebook.com/notification/847a02dda ... 712cc478b4
http://www.facebook.com/ProfessionalHac ... 99/?type=1
Mon, 08 Sep 2014 11:48:32 +0100
http://example.com/VL0Hb9

Top methods to open / access blocked sites without PROXY | Cool Tips and Tricks
www.gotipsandtrick.info]]>
Mon, 08 Sep 2014 11:47:17 +0100
Professional Hackers
Professional Hackers
www.facebook.com/notification/d5aa50993c46015a9af
04-08 07:29:00.338 1875-1893/synctc.me.rssfeed E/MainActivity﹕ Exception Caught :
org.json.JSONException: Value
Подробнее здесь: https://stackoverflow.com/questions/295 ... ebook-page
Мобильная версия