Android Open Source - yellowpages-android-tdd Listing Table






From Project

Back to project page yellowpages-android-tdd.

License

The source code is released under:

MIT License

If you think the Android project yellowpages-android-tdd listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.tddrampup.contentprovider;
//from ww w . j  a  va  2s  .co  m
import android.database.sqlite.SQLiteDatabase;
        import android.util.Log;

public class ListingTable {

    // Database table
    public static final String TABLE_LISTING = "listing";
    public static final String COLUMN_ID = "_id";
    public static final String COLUMN_NAME = "name";
    public static final String COLUMN_STREET = "street";
    public static final String COLUMN_CITY = "city";
    public static final String COLUMN_PROV= "prov";
    public static final String COLUMN_PCODE = "pcode";
    public static final String COLUMN_PHONE = "phone";
    public static final String COLUMN_LONGITUDE = "longitude";
    public static final String COLUMN_LATITUDE = "latitude";
    public static final String COLUMN_URL = "url";
    public static final String COLUMN_HOURS = "hours";


    // Database creation SQL statement
    private static final String DATABASE_CREATE = "create table "
            + TABLE_LISTING
            + "("
            + COLUMN_ID + " integer primary key autoincrement, "
            + COLUMN_NAME + " text not null, "
            + COLUMN_STREET + " text not null, "
            + COLUMN_CITY + " text not null, "
            + COLUMN_PROV + " text not null, "
            + COLUMN_PCODE + " text not null, "
            + COLUMN_LONGITUDE + " text not null, "
            + COLUMN_LATITUDE + " text not null, "
            + COLUMN_PHONE + " text,"
            + COLUMN_URL + " text,"
            + COLUMN_HOURS + " text"
            + ");";

    public static void onCreate(SQLiteDatabase database) {
        database.execSQL(DATABASE_CREATE);
    }

    public static void onUpgrade(SQLiteDatabase database, int oldVersion,
                                 int newVersion) {
        Log.w(ListingTable.class.getName(), "Upgrading database from version "
                + oldVersion + " to " + newVersion
                + ", which will destroy all old data");
        database.execSQL("DROP TABLE IF EXISTS " + TABLE_LISTING);
        onCreate(database);
    }
}




Java Source Code List

android.UnusedStub.java
com.tddrampup.YellowApplication.java
com.tddrampup.activities.DetailActivity.java
com.tddrampup.activities.MainActivity.java
com.tddrampup.activities.SearchResultsActivity.java
com.tddrampup.adapters.ListingAdapter.java
com.tddrampup.contentprovider.ListingContentProvider.java
com.tddrampup.contentprovider.ListingDatabaseHelper.java
com.tddrampup.contentprovider.ListingTable.java
com.tddrampup.fragments.DetailFragment.java
com.tddrampup.fragments.GoogleMapFragment.java
com.tddrampup.fragments.ListingsFragment.java
com.tddrampup.fragments.MainFragment.java
com.tddrampup.models.Listing.java
com.tddrampup.services.VolleyCallback.java
com.tddrampup.services.VolleyHelper.java
com.tddrampup.singletons.Listings.java