• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.google/23-Mar-2024-1913

app/23-Mar-2024-645369

gradle/wrapper/23-Mar-2024-65

resources/23-Mar-2024-286138

screenshots/23-Mar-2024-

CONTRIBUTING.mdD23-Mar-20241.5 KiB3627

LICENSED23-Mar-202431.5 KiB648514

NOTICED23-Mar-2024614 1711

README.mdD23-Mar-20242.8 KiB7553

build.gradleD23-Mar-2024448 2118

common.gradleD23-Mar-2024467 2318

gradlewD23-Mar-20244.9 KiB161120

gradlew.batD23-Mar-20242.3 KiB9166

settings.gradleD23-Mar-202429 21

README.md

1Android ContentProviderPaging Sample (Kotlin)
2===================================
3
4This sample demonstrates how to use the ContentProvider with paging support introduced
5in Android O. The ContentProvider now accepts additional arguments for the offset and
6the limit in the query method to support paging instead of fetching all the data in
7a single query method call.
8
9Introduction
10------------
11
12[ContentProvider][1] and [DocumentsProvider][2] now supports paging instead of fetching the all
13data at once.
14
15Starting from Android O, ContentProvider#query(Uri, String[], Bundle, CancellationSignal) and
16DocumentsProvider#query(Uri, String[], Bundle, CancellationSignal) methods are introduced.
17The Bundle accepts the keys for ContentResolver.QUERY_ARG_OFFSET as an starting offset and
18ContentResolver.QUERY_ARG_LIMIT as the number of items included in the returned Cursor object.
19
20Similarly, the returned Cursor object now has a Bundle object obtained by Cursor#getExtras().
21The Bundle is able to include data such as the  total size of the underlying data set.
22
23[1]: https://developer.android.com/reference/android/content/ContentProvider.html
24[2]: https://developer.android.com/reference/android/provider/DocumentsProvider.html
25
26Pre-requisites
27--------------
28
29- Android SDK 25
30- Android Build Tools v25.0.3
31- Android Support Repository
32
33Screenshots
34-------------
35
36<img src="screenshots/screenshot-1.png" height="400" alt="Screenshot"/>
37
38Getting Started
39---------------
40
41This sample uses the Gradle build system. To build this project, use the
42"gradlew build" command or use "Import Project" in Android Studio.
43
44Support
45-------
46
47- Google+ Community: https://plus.google.com/communities/105153134372062985968
48- Stack Overflow: http://stackoverflow.com/questions/tagged/android
49
50If you've found an error in this sample, please file an issue:
51https://github.com/googlesamples/android-ContentProviderPaging
52
53Patches are encouraged, and may be submitted by forking this project and
54submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
55
56License
57-------
58
59Copyright 2017 The Android Open Source Project, Inc.
60
61Licensed to the Apache Software Foundation (ASF) under one or more contributor
62license agreements.  See the NOTICE file distributed with this work for
63additional information regarding copyright ownership.  The ASF licenses this
64file to you under the Apache License, Version 2.0 (the "License"); you may not
65use this file except in compliance with the License.  You may obtain a copy of
66the License at
67
68http://www.apache.org/licenses/LICENSE-2.0
69
70Unless required by applicable law or agreed to in writing, software
71distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
72WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
73License for the specific language governing permissions and limitations under
74the License.
75