Pages

Showing posts with label JSON. Show all posts
Showing posts with label JSON. Show all posts

Sunday, March 17, 2013

Retrieve all tweets from twitter using json

Progress dialogue Added 

Don't forget to add Internet Permission. 
XML
Same as previous article

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >


    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

            <TextView
                android:id="@+id/tvJson"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Tweets:" />

        </LinearLayout>
    </ScrollView>

</LinearLayout>


Retrieve last tweet from twitter using JSON

XML
Don't forget to add Internet Permission. 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

   

    <Button
        android:id="@+id/btnShowTweets"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="showTweets"
        android:text="Show Tweets!" />

    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

            <TextView
                android:id="@+id/tvJson"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Tweets:" />

        </LinearLayout>
    </ScrollView>

</LinearLayout>