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 w w . j a va2 s . c o m*/ * 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.assertion.Assertions; import com.twofortyfouram.memento.R; import com.twofortyfouram.memento.provider.sqlite.AbstractSqliteContentProvider; import com.twofortyfouram.memento.provider.sqlite.SqliteUriMatcher; import net.jcip.annotations.ThreadSafe; import android.content.Context; import android.database.sqlite.SQLiteOpenHelper; import android.support.annotation.NonNull; import android.support.annotation.Nullable; /** * Simple concrete implementation of {@link AbstractSqliteContentProvider} for testing. */ @ThreadSafe public final class SqliteContentProviderImpl extends AbstractSqliteContentProvider { @NonNull private static final String DB_FILE_NAME = "com.twofortyfouram.memento.debug.sqlite3"; //$NON-NLS-1$ /** * * @param context Application context. * @return Retrieves the content authority of this provider. */ /* * Note: We strongly suggest always reading the content authority from a string resource. * Because the ContentProvider authority namespace is global on Android, each application must * have a different ContentProvider authority. If your application has multiple flavors on the * app store, then using a string resource makes it easy to replace the content authority * via resource overlays. */ @NonNull public static String getContentAuthority(@NonNull final Context context) { Assertions.assertNotNull(context, "context"); //$NON-NLS-1$ return context.getString(R.string.com_twofortyfouram_memento_debug_provider_authority); } @NonNull @Override public SqliteUriMatcher newSqliteUriMatcher() { return new SqliteUriMatcherImpl(getContext()); } @NonNull @Override public SQLiteOpenHelper newSqliteOpenHelper() { return new SqliteOpenHelperImpl(getContext(), DB_FILE_NAME, 1); } }