Skip to content

Commit

Permalink
Updates from #209
Browse files Browse the repository at this point in the history
  • Loading branch information
vestrel00 committed May 19, 2022
1 parent 13fdc3b commit 0010313
Show file tree
Hide file tree
Showing 63 changed files with 901 additions and 631 deletions.
Expand Up @@ -1983,8 +1983,8 @@ <h1 id="associate-a-local-rawcontact-to-an-account">Associate a local RawContact
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kd">val</span> <span class="nv">accountsLocalRawContactsUpdate</span> <span class="o">=</span> <span class="n">Contacts</span><span class="p">(</span><span class="n">context</span><span class="p">).</span><span class="na">accounts</span><span class="p">().</span><span class="na">updateLocalRawContactsAccount</span><span class="p">()</span>
</code></pre></div>
<blockquote>
<p>For more info on local RawContacts, read about <a href="../../entities/about-local-contacts/">Local (device-only) contacts</a>.</p>
<p>For more info on syncing, read <a href="../../entities/sync-contact-data/">Sync contact data across devices</a>.</p>
<p>ℹ️ For more info on local RawContacts, read about <a href="../../entities/about-local-contacts/">Local (device-only) contacts</a>.</p>
<p>ℹ️ For more info on syncing, read <a href="../../entities/sync-contact-data/">Sync contact data across devices</a>.</p>
</blockquote>
<h2 id="basic-usage">Basic usage<a class="headerlink" href="#basic-usage" title="Permanent link">&para;</a></h2>
<p>To associate/add the given local RawContacts to the given account,</p>
Expand Down Expand Up @@ -2037,7 +2037,7 @@ <h2 id="performing-the-update-and-result-processing-asynchronously">Performing t
read <a href="../../async/async-execution-coroutines/">Execute work outside of the UI thread using coroutines</a>.</p>
<p>You may, of course, use other multi-threading libraries or just do it yourself =)</p>
<blockquote>
<p>Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
<p>ℹ️ Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
</blockquote>
<h2 id="performing-the-update-with-permission">Performing the update with permission<a class="headerlink" href="#performing-the-update-with-permission" title="Permanent link">&para;</a></h2>
<p>These updates require the <code>android.permission.GET_ACCOUNTS</code> and <code>android.permission.WRITE_CONTACTS</code>.
Expand All @@ -2053,11 +2053,6 @@ <h2 id="profile-data">Profile data<a class="headerlink" href="#profile-data" tit
<p>All updates will be limited to the Profile RawContacts, whether it exists or not.</p>
<hr />
<h2 id="developer-notes-or-for-advanced-users">Developer notes (or for advanced users)<a class="headerlink" href="#developer-notes-or-for-advanced-users" title="Permanent link">&para;</a></h2>
<blockquote>
<p>The following section are note from developers of this library for other developers. It is copied
from the <a href="../../dev-notes/">DEV_NOTES</a>. You may still read the following as a consumer of the library
in case you need deeper insight.</p>
</blockquote>
<p>Due to certain limitations and behaviors imposed by the Contacts Provider, this library only
provides an API to support;</p>
<ul>
Expand Down
6 changes: 3 additions & 3 deletions accounts/query-accounts/index.html
Expand Up @@ -1924,8 +1924,8 @@ <h2 id="a-basic-query">A basic query<a class="headerlink" href="#a-basic-query"
<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a> <span class="p">.</span><span class="na">find</span><span class="p">()</span>
</code></pre></div>
<blockquote>
<p>RawContacts that are not associated with an Account are local to the device. For more info, read
about <a href="../../entities/about-local-contacts/">Local (device-only) contacts</a>.</p>
<p>ℹ️ RawContacts that are not associated with an Account are local to the device. For more info,
read about <a href="../../entities/about-local-contacts/">Local (device-only) contacts</a>.</p>
</blockquote>
<h2 id="account-for-each-specified-rawcontact">Account for each specified RawContact<a class="headerlink" href="#account-for-each-specified-rawcontact" title="Permanent link">&para;</a></h2>
<p>When you perform a query that uses <code>associatedWith</code> without using <code>withTypes</code>, you are able to get
Expand Down Expand Up @@ -1959,7 +1959,7 @@ <h2 id="performing-the-query-asynchronously">Performing the query asynchronously
read <a href="../../async/async-execution-coroutines/">Execute work outside of the UI thread using coroutines</a>.</p>
<p>You may, of course, use other multi-threading libraries or just do it yourself =)</p>
<blockquote>
<p>Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
<p>ℹ️ Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
</blockquote>
<h2 id="performing-the-query-with-permission">Performing the query with permission<a class="headerlink" href="#performing-the-query-with-permission" title="Permanent link">&para;</a></h2>
<p>Queries require the <code>android.permission.READ_CONTACTS</code> and <code>android.permission.GET_ACCOUNTS</code>
Expand Down
18 changes: 9 additions & 9 deletions accounts/query-raw-contacts/index.html
Expand Up @@ -2012,7 +2012,7 @@ <h1 id="query-rawcontacts">Query RawContacts<a class="headerlink" href="#query-r
data (e.g. email, phone). It only contains critical information required for performing RawContact
operations such as associating local RawContacts to an Account.</p>
<blockquote>
<p>For more info, read <a href="../associate-device-local-raw-contacts-to-an-account/">Associate local RawContacts to an Account</a>.</p>
<p>ℹ️ For more info, read <a href="../associate-device-local-raw-contacts-to-an-account/">Associate local RawContacts to an Account</a>.</p>
</blockquote>
<p>An instance of the <code>AccountsRawContactsQuery</code> API is obtained by,</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kd">val</span> <span class="nv">query</span> <span class="o">=</span> <span class="n">Contacts</span><span class="p">(</span><span class="n">context</span><span class="p">).</span><span class="na">accounts</span><span class="p">().</span><span class="na">queryRawContacts</span><span class="p">()</span>
Expand All @@ -2029,7 +2029,7 @@ <h2 id="specifying-accounts">Specifying Accounts<a class="headerlink" href="#spe
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="p">.</span><span class="na">accounts</span><span class="p">(</span><span class="n">Account</span><span class="p">(</span><span class="s">&quot;john.doe@gmail.com&quot;</span><span class="p">,</span> <span class="s">&quot;com.google&quot;</span><span class="p">))</span>
</code></pre></div>
<blockquote>
<p>For more info, read <a href="../query-accounts/">Query for Accounts</a>.</p>
<p>ℹ️ For more info, read <a href="../query-accounts/">Query for Accounts</a>.</p>
</blockquote>
<p>If no accounts are specified (this function is not called or called with no Accounts), then all
RawContacts of Contacts are included in the search.</p>
Expand All @@ -2038,8 +2038,8 @@ <h2 id="specifying-accounts">Specifying Accounts<a class="headerlink" href="#spe
device-only contacts, which are not synced.</p>
<p>For more info, read about <a href="../../entities/about-local-contacts/">Local (device-only) contacts</a>.</p>
<blockquote>
<p>Note that this may affect performance. This may require one or more additional queries, internally
performed in this function, which increases the time required for the search. Therefore, you
<p>ℹ️ This may affect performance. This may require one or more additional queries, internally
performed in this function, which increases the time required for the search. Therefore, you
should only specify this if you actually need it.</p>
</blockquote>
<h2 id="ordering">Ordering<a class="headerlink" href="#ordering" title="Permanent link">&para;</a></h2>
Expand All @@ -2063,7 +2063,7 @@ <h2 id="limiting-and-offsetting">Limiting and offsetting<a class="headerlink" hr
</code></pre></div>
<p>This is useful for pagination =)</p>
<blockquote>
<p>Note that it is recommended to limit the number of RawContacts when querying to increase performance
<p>ℹ️ It is recommended to limit the number of RawContacts when querying to increase performance
and decrease memory cost.</p>
</blockquote>
<h2 id="executing-the-query">Executing the query<a class="headerlink" href="#executing-the-query" title="Permanent link">&para;</a></h2>
Expand Down Expand Up @@ -2094,7 +2094,7 @@ <h2 id="performing-the-query-asynchronously">Performing the query asynchronously
For more info, read <a href="../../async/async-execution-coroutines/">Execute work outside of the UI thread using coroutines</a>.</p>
<p>You may, of course, use other multi-threading libraries or just do it yourself =)</p>
<blockquote>
<p>Extensions for Kotlin Flow and RxJava are also in the v1 roadmap, which includes APIs for
<p>ℹ️ Extensions for Kotlin Flow and RxJava are also in the v1 roadmap, which includes APIs for
listening to Contacts database changes.</p>
</blockquote>
<h2 id="performing-the-query-with-permission">Performing the query with permission<a class="headerlink" href="#performing-the-query-with-permission" title="Permanent link">&para;</a></h2>
Expand All @@ -2118,7 +2118,7 @@ <h2 id="getting-contacts-and-rawcontacts-from-blankrawcontacts">Getting Contacts
<a id="__codelineno-12-4" name="__codelineno-12-4" href="#__codelineno-12-4"></a> <span class="p">.</span><span class="na">find</span><span class="p">()</span>
</code></pre></div>
<blockquote>
<p>For more info, read <a href="../../basics/query-contacts-advanced/">Query contacts (advanced)</a>.</p>
<p>ℹ️ For more info, read <a href="../../basics/query-contacts-advanced/">Query contacts (advanced)</a>.</p>
</blockquote>
<p>If you need a more convenient way to convert the <code>BlankRawContact</code>s to <code>RawContacts</code>, use
<code>BlankRawContactToRawContact</code> extensions. For more info, read <a href="../../other/convenience-functions/">Convenience functions</a>.</p>
Expand All @@ -2132,8 +2132,8 @@ <h2 id="using-the-where-function-to-specify-matching-criteria">Using the <code>w
<p>Use the <code>contacts.core.RawContactsField</code> combined with the extensions from <code>contacts.core.Where</code> to
form WHERE clauses. </p>
<blockquote>
<p>This docs page will not provide a tutorial on database where clauses. It assumes that you know the basics.
If you don't know the basics, then search for <a href="https://www.google.com/search?q=sqlite+where+clause">sqlite where clause</a>. </p>
<p>ℹ️ This docs page will not provide a tutorial on database where clauses. It assumes that you know
the basics. If you don't know the basics, then search for <a href="https://www.google.com/search?q=sqlite+where+clause">sqlite where clause</a>. </p>
</blockquote>
<p>For example, to get a list of RawContacts with the given IDs,</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a><span class="kd">val</span> <span class="nv">favoriteRawContacts</span> <span class="o">=</span> <span class="n">Contacts</span><span class="p">(</span><span class="n">context</span><span class="p">)</span>
Expand Down
2 changes: 1 addition & 1 deletion async/async-execution-coroutines/index.html
Expand Up @@ -1953,7 +1953,7 @@ <h2 id="cancellations-are-supported">Cancellations are supported<a class="header
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="p">}</span>
</code></pre></div>
<blockquote>
<p>Most core API functions support cancellations, not just queries!</p>
<p>ℹ️ Most core API functions support cancellations, not just queries!</p>
</blockquote>
<h2 id="not-compatible-with-java">Not compatible with Java<a class="headerlink" href="#not-compatible-with-java" title="Permanent link">&para;</a></h2>
<p>Unlike the <code>core</code> module, the <code>async</code> module is not compatible with Java because it requires Kotlin
Expand Down
6 changes: 3 additions & 3 deletions basics/delete-contacts/index.html
Expand Up @@ -1942,8 +1942,8 @@ <h1 id="delete-contacts">Delete Contacts<a class="headerlink" href="#delete-cont
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kd">val</span> <span class="nv">delete</span> <span class="o">=</span> <span class="n">Contacts</span><span class="p">(</span><span class="n">context</span><span class="p">).</span><span class="na">delete</span><span class="p">()</span>
</code></pre></div>
<blockquote>
<p>If you want to delete the device owner Contact Profile, read <a href="../../profile/delete-profile/">Delete device owner Contact profile</a>.</p>
<p>If you want to delete a set of Data, read <a href="../../data/delete-data-sets/">Delete existing sets of data</a>.</p>
<p>ℹ️ If you want to delete the device owner Contact Profile, read <a href="../../profile/delete-profile/">Delete device owner Contact profile</a>.</p>
<p>ℹ️ If you want to delete a set of Data, read <a href="../../data/delete-data-sets/">Delete existing sets of data</a>.</p>
</blockquote>
<h2 id="a-basic-delete">A basic delete<a class="headerlink" href="#a-basic-delete" title="Permanent link">&para;</a></h2>
<p>To delete a set of Contact and all of its RawContacts,</p>
Expand Down Expand Up @@ -1984,7 +1984,7 @@ <h2 id="performing-the-delete-and-result-processing-asynchronously">Performing t
For more info, read <a href="../../async/async-execution-coroutines/">Execute work outside of the UI thread using coroutines</a>.</p>
<p>You may, of course, use other multi-threading libraries or just do it yourself =)</p>
<blockquote>
<p>Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
<p>ℹ️ Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
</blockquote>
<h2 id="performing-the-delete-with-permission">Performing the delete with permission<a class="headerlink" href="#performing-the-delete-with-permission" title="Permanent link">&para;</a></h2>
<p>Deletes require the <code>android.permission.WRITE_CONTACTS</code> permissions. If not granted, the delete
Expand Down
14 changes: 7 additions & 7 deletions basics/insert-contacts/index.html
Expand Up @@ -2051,8 +2051,8 @@ <h1 id="insert-contacts">Insert contacts<a class="headerlink" href="#insert-cont
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kd">val</span> <span class="nv">insert</span> <span class="o">=</span> <span class="n">Contacts</span><span class="p">(</span><span class="n">context</span><span class="p">).</span><span class="na">insert</span><span class="p">()</span>
</code></pre></div>
<blockquote>
<p>If you want to create/insert the device owner Contact Profile, read <a href="../../profile/insert-profile/">Insert device owner Contact profile</a>.</p>
<p>If you want to insert Data into a new or existing contact, read <a href="../../data/insert-data-sets/">Insert data into new or existing contacts</a>.</p>
<p>ℹ️ If you want to create/insert the device owner Contact Profile, read <a href="../../profile/insert-profile/">Insert device owner Contact profile</a>.</p>
<p>ℹ️ If you want to insert Data into a new or existing contact, read <a href="../../data/insert-data-sets/">Insert data into new or existing contacts</a>.</p>
</blockquote>
<h2 id="a-basic-insert">A basic insert<a class="headerlink" href="#a-basic-insert" title="Permanent link">&para;</a></h2>
<p>To create/insert a contact with a name of "John Doe" who works at Amazon with a work email of
Expand Down Expand Up @@ -2130,18 +2130,18 @@ <h2 id="associating-an-account">Associating an Account<a class="headerlink" href
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a><span class="p">.</span><span class="na">forAccount</span><span class="p">(</span><span class="n">Account</span><span class="p">(</span><span class="s">&quot;john.doe@gmail.com&quot;</span><span class="p">,</span> <span class="s">&quot;com.google&quot;</span><span class="p">))</span>
</code></pre></div>
<blockquote>
<p>For more info, read <a href="../../accounts/query-accounts/">Query for Accounts</a>.</p>
<p>ℹ️ For more info, read <a href="../../accounts/query-accounts/">Query for Accounts</a>.</p>
</blockquote>
<h3 id="local-rawcontacts">Local RawContacts<a class="headerlink" href="#local-rawcontacts" title="Permanent link">&para;</a></h3>
<p>If no Account is provided, or null is provided, or if an incorrect account is provided, the
RawContacts inserted will not be associated with an Account. RawContacts inserted without an
associated account are considered local or device-only contacts, which are not synced.</p>
<blockquote>
<p>For more info, read <a href="../../entities/sync-contact-data/">Sync contact data across devices</a>.</p>
<p>ℹ️ For more info, read <a href="../../entities/sync-contact-data/">Sync contact data across devices</a>.</p>
</blockquote>
<p>There are also certain data kinds that are ignored on insert or update if the RawContact is local.</p>
<blockquote>
<p>For more info, read about <a href="../../entities/about-local-contacts/">Local (device-only) contacts</a>.</p>
<p>ℹ️ For more info, read about <a href="../../entities/about-local-contacts/">Local (device-only) contacts</a>.</p>
</blockquote>
<h2 id="including-only-specific-data">Including only specific data<a class="headerlink" href="#including-only-specific-data" title="Permanent link">&para;</a></h2>
<p>To include only the given set of fields (data) in each of the insert operation,</p>
Expand Down Expand Up @@ -2185,7 +2185,7 @@ <h3 id="handling-the-insert-result">Handling the insert result<a class="headerli
<a id="__codelineno-15-4" name="__codelineno-15-4" href="#__codelineno-15-4"></a> <span class="p">.</span><span class="na">find</span><span class="p">()</span>
</code></pre></div>
<blockquote>
<p>For more info, read <a href="../query-contacts-advanced/">Query contacts (advanced)</a>.</p>
<p>ℹ️ For more info, read <a href="../query-contacts-advanced/">Query contacts (advanced)</a>.</p>
</blockquote>
<p>Alternatively, you may use the extensions provided in <code>InsertResult</code>. To get all newly created
Contacts,</p>
Expand Down Expand Up @@ -2223,7 +2223,7 @@ <h2 id="performing-the-insert-and-result-processing-asynchronously">Performing t
read <a href="../../async/async-execution-coroutines/">Execute work outside of the UI thread using coroutines</a>.</p>
<p>You may, of course, use other multi-threading libraries or just do it yourself =)</p>
<blockquote>
<p>Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
<p>ℹ️ Extensions for Kotlin Flow and RxJava are also in the v1 roadmap.</p>
</blockquote>
<h2 id="performing-the-insert-with-permission">Performing the insert with permission<a class="headerlink" href="#performing-the-insert-with-permission" title="Permanent link">&para;</a></h2>
<p>Inserts require the <code>android.permission.WRITE_CONTACTS</code> and <code>android.permission.GET_ACCOUNTS</code>
Expand Down

0 comments on commit 0010313

Please sign in to comment.