title: how to show tweets in list view in android?
body: <p>i want to show tweets in a list view in android application.i have used following code but the tweets are not showing.. could anybody please tell how to show 5 latest tweets in list view which are reloaded after every 15 minutes? i have tried many codes but did not reached at any result!</p>
  
  <pre><code> public class TweetsListActivity extends Activity {
  
          TextView tv;
          ListView lv;
          Twitter twitter;
          TextView username;
          TweetsListAdapter adapter;
          ArrayList&lt;Tweet&gt; tweetsDataList;
          String tweetsData;
  
          static ConfigurationBuilder cb;
          private static SharedPreferences mSharedPreferences;
          AlertDialogManager alert = new AlertDialogManager();
          private static final String CONSUMER_KEY = "";
          private static final String CONSUMER_SECRET = "";
  
          @Override
          protected void onCreate(Bundle savedInstanceState) {
              setContentView(R.layout.tweets_list);
              super.onCreate(savedInstanceState);
              if (android.os.Build.VERSION.SDK_INT &gt; 9) {
                  StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
                  StrictMode.setThreadPolicy(policy);
              }
              tv = (TextView) findViewById(R.id.textView1);
              username =(TextView)findViewById(R.id.username);
              lv = (ListView) findViewById(R.id.listView);
              tweetsDataList = new ArrayList&lt;Tweet&gt;();
            String responseBody = null;
  </code></pre>
  
  <p>try {</p>
  
  <pre><code>  ConfigurationBuilder builder = new ConfigurationBuilder();            builder.setOAuthConsumerKey(CONSUMER_KEY);              builder.setOAuthConsumerSecret(CONSUMER_SECRET);
  URI website = new URI("https://api.twitter.com/1/statuses/user_timeline/.json");
   HttpClient hc =new DefaultHttpClient();
    HttpGet get = new HttpGet();
  get.setURI(website);
  HttpResponse rp =  hc.execute(get);
  HttpEntity entity = rp.getEntity();
   responseBody = EntityUtils.toString(entity);
  
  if(((org.apache.http.HttpResponse)rp).getStatusLine().getStatusCode() == HttpStatus.SC_OK){
       String returned = null;
       JSONObject json = new JSONObject(returned);
      JSONArray ja = null;
       ja = json.getJSONArray("results");
      for (int i1 = 0; i1 &lt; ja.length(5); i1++) {
      JSONObject tweet_obj = ja.getJSONObject(i1);
      Tweet tweetsData = new Tweet();
      String username = tweet_obj.getString("from_user");
      String message = tweet_obj.getString("text");                                                               tweetsDataList.add(tweetsData);
                      }
                  }
              }
              catch (Exception e) {
   Log.e("TwitterFeedActivity", "Error loading JSON", e);
              }
   adapter = new TweetsListAdapter(TweetsListActivity.this, tweetsDataList);
  lv.setAdapter(adapter);
    mSharedPreferences=getApplicationContext().getSharedPreferences("MyPref",0);
          }
      } 
     }          
        but no list is showing .. neither the logcat shows any error..
      i have used adapter classes. here is the link http://pastebin.com/XBErcu9c 
  </code></pre>