Android Open Source - android-wear-tutorial Book D B






From Project

Back to project page android-wear-tutorial.

License

The source code is released under:

Apache License

If you think the Android project android-wear-tutorial 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

/*
 * Copyright 2015 Simone Casagranda.// ww  w.j a v a 2  s . com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.alchemiasoft.common.content;

import android.content.ContentResolver;
import android.net.Uri;
import android.provider.BaseColumns;

/**
 * Definition for the Book's Database and Provider.
 * <p/>
 * Created by Simone Casagranda on 20/12/14.
 */
public final class BookDB {

    public static final String NAME = "book.db";
    public static final int VERSION = 4;

    public static final String AUTHORITY = "com.alchemiasoft.book.provider";

    public static final String VND = "/vnd.book.";

    public static final String CONTENT_SCHEME = ContentResolver.SCHEME_CONTENT + "://" + AUTHORITY + "/";

    /**
     * Book's table in the Database.
     */
    public static final class Book implements BaseColumns {

        public static final String TABLE = "Book";

        public static final String SERVER_ID = "server_id";
        public static final String TITLE = "title";
        public static final String AUTHOR = "author";
        public static final String PAGES = "pages";
        public static final String SOURCE = "source";
        public static final String DESCRIPTION = "description";
        public static final String OWNED = "owned";
        public static final String NOTES = "notes";
        public static final String UPDATED_AT = "updated_at";

        public static final String CREATE_TABLE = "CREATE TABLE " + TABLE + " (_id INTEGER PRIMARY KEY AUTOINCREMENT, "
                + SERVER_ID + " TEXT NOT NULL, " + TITLE + " TEXT NOT NULL, " + AUTHOR + " TEXT, " + SOURCE + " TEXT, "
                + DESCRIPTION + " TEXT, " + PAGES + " INTEGER, " + NOTES + " TEXT, " + UPDATED_AT + " INTEGER, " + OWNED + " BOOLEAN);";
        public static final String DELETE_TABLE = "DROP TABLE IF EXISTS " + TABLE + ";";


        public static final String PATH = "book";
        public static final Uri CONTENT_URI = Uri.parse(CONTENT_SCHEME + PATH);
        public static final String CURSOR_ITEM_MIME_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE + VND + PATH;
        public static final String CURSOR_DIR_MIME_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE + VND + PATH;
        public static final String ITEM_PATH = PATH + "/#";
        public static final String DIR_PATH = PATH;

        public static Uri create() {
            return CONTENT_URI;
        }

        public static Uri create(long id) {
            return Uri.withAppendedPath(CONTENT_URI, String.valueOf(id));
        }
    }
}




Java Source Code List

com.alchemiasoft.book.ApplicationTest.java
com.alchemiasoft.book.activity.HomeActivity.java
com.alchemiasoft.book.fragment.BookDetailFragment.java
com.alchemiasoft.book.fragment.BooksFragment.java
com.alchemiasoft.book.fragment.base.RecyclerViewFragment.java
com.alchemiasoft.book.receiver.BootCompletedReceiver.java
com.alchemiasoft.book.receiver.SuggestionReceiver.java
com.alchemiasoft.book.service.BookActionService.java
com.alchemiasoft.book.service.SuggestionService.java
com.alchemiasoft.book.user.UserData.java
com.alchemiasoft.book.widget.SmartSwipeRefreshLayout.java
com.alchemiasoft.books.activity.BooksActivity.java
com.alchemiasoft.common.ApplicationTest.java
com.alchemiasoft.common.content.BookContentProvider.java
com.alchemiasoft.common.content.BookDBOpenHelper.java
com.alchemiasoft.common.content.BookDB.java
com.alchemiasoft.common.lib.Constants.java
com.alchemiasoft.common.model.Book.java
com.alchemiasoft.common.util.AlarmUtil.java
com.alchemiasoft.common.util.IOUtils.java
com.alchemiasoft.common.util.ResUtil.java
com.alchemiasoft.common.util.ViewUtil.java