Back to project page android-memento.
The source code is released under:
Apache License
If you think the Android project android-memento listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * android-memento-lib https://github.com/twofortyfouram/android-memento * Copyright 2014 two forty four a.m. LLC */* w ww . ja va2s.c om*/ * 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.twofortyfouram.memento.debug.provider; import com.twofortyfouram.memento.provider.sqlite.SqliteColumnBuilder; import com.twofortyfouram.memento.provider.sqlite.SqliteOpenHelperCompat; import com.twofortyfouram.memento.provider.sqlite.SqliteStorageClass; import com.twofortyfouram.memento.provider.sqlite.SqliteTableBuilder; import net.jcip.annotations.ThreadSafe; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.support.annotation.NonNull; @ThreadSafe public final class SqliteOpenHelperImpl extends SqliteOpenHelperCompat { public SqliteOpenHelperImpl(final Context context, final String name, final int version) { super(context, name, null, version); } @Override public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) { /* * Do nothing. This test database should never be upgraded. */ } @Override public void onCreate(final SQLiteDatabase db) { createTableOne(db); } private static void createTableOne(@NonNull final SQLiteDatabase db) { final SqliteTableBuilder tableBuilder = new SqliteTableBuilder() .setName(TableOneContract.TABLE_NAME); tableBuilder.addColumn(new SqliteColumnBuilder().setName(TableOneContract._ID) .setType(SqliteStorageClass.INTEGER) .setAutoincrementPrimaryKey()); tableBuilder.addColumn(new SqliteColumnBuilder() .setName(TableOneContract.COLUMN_STRING_COLUMN_ONE) .setType(SqliteStorageClass.TEXT).setConstraintNotNull()); db.execSQL(tableBuilder.build()); } @Override protected boolean isForeignKeyConstraintsEnabled() { return true; } }