14 articles Android Page 2 / 2

Android Database Storage (SQLite)

Membuat Database dan Table Contract Class (table, and column name) [code lang=”java”] public final class SPBGContract { // To prevent someone from accidentally instantiating the contract class, // give it an empty constructor. public SPBGContract() {} /* Inner class that defines the table contents */ public static abstract class SPBG implements BaseColumns { public static…

Android ListView Layout with Custom Data

activity_main.xml [code lang=”xml”] <RelativeLayout 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" tools:context="com.rekadia.simpleapps.HttpExampleActivity" > <!–<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="wrap_content"–> <!–tools:context="com.rekadia.simpleapps.HttpExampleActivity"–> <!–android:orientation="horizontal" >–> <!–<EditText android:id="@+id/myUrl"–> <!–android:layout_weight="1"–> <!–android:layout_width="0dp"–> <!–android:layout_height="wrap_content"–> <!–android:hint="@string/myUrl" />–> <!–<Button–> <!–android:layout_width="wrap_content"–> <!–android:layout_height="wrap_content"–> <!–android:text="@string/button_fetch"–> <!–android:onClick="myClickHandler" />–> <!–</LinearLayout>–> <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/swipe_container" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@+id/list" android:fadingEdge="vertical" android:fadingEdgeLength="10dp" android:longClickable="true" android:layout_width="match_parent" android:layout_height="match_parent" > </ListView> </android.support.v4.widget.SwipeRefreshLayout> <TextView android:id="@+id/empty" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:text="Loading feed…