Android Studio - Complete Android Apps Tutorial – Content Provider - Day 18 - 8.41
Content Provider
2
Content Provider One of the Application Components Used to share data usually SQLite database across applications
3
Content Provider Provides an abstraction from the underlying data source e.g. a SQLite database. Provide mechanisms for defining data security e.g. by enforcing read/write permissions Provide an interface for publishing and consuming data, based around a simple URI addressing model using the content:// schema. Used in Search suggestions with Quick Search Box Data transfers with SyncAdapter
4
Create a Content Provider New → Other → Content Provider
5
Create a Content Provider URI authority string of a Content Provider is usually package_name.provider Unique, only one provider tied to a authority string
6
ContentProvider Override onCreate to initialize the data source, usually for SQLite database, create an instance of SQLiteOpenHelper subclass
@Override public boolean onCreate dbHelper = new DbHelpergetContext; return true;
7
ContentProvider Override insert to insert a row in a SQLite database table and return a Uri
@Override public Uri insertUri uri, ContentValues values dbHelper.getWritableDatabase. insert"data", null, values; return Uri. parse "content://my.wenjiun.iotsensor.provider";
8
ContentProvider Override delete to delect one or more rows in a SQLite database table and return the number of rows deleted
@Override public int deleteUri uri, String selection, String[] selectionArgs int count = dbHelper.getWritableDatabase. delete"data", selection, selectionArgs; return count;
9
ContentProvider Override query to return a Cursor by querying a SQLite database table passing over the corresponding parameters @Override public Cursor queryUri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder Cursor cursor = dbHelper.getReadableDatabase. query"data", projection, selection, SelectionArgs, null, null, sortOrder; return cursor;
10
ContentResolver Call getContentResolver to obtain an instance of Content Resolver Provides access to content providers where it accepts requests, and resolves these requests by directing these requests to the content provider with a distinct authority. Includes the CRUD create, read, update, delete methods corresponding to the abstract methods insert, delete, query, update in the Content Provider
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Android Studio - Complete Android Apps Tutorial – Content Provider - Day 18 - 8.41», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.