Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/start/getting-started/fragments/android/integrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Next you'll use the generated model to read and write data. In this section you'
## Configure Amplify and DataStore

First, we'll add the DataStore plugin and configure Amplify by creating an Application class and overriding the `onCreate()` method.
1. Navigate to the **example.todo** folder located at **ToDo** > **app** > **src** > **main** > **java/kotlin** > **com** > **example.todo**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The . in example.todo:

This probably is a valid instruction, if the user is navigating a UI pane in Android Studio. Android Studio will break from listing directory structure, and instead list Java packages in some cases. In Android projects, directory structure and java package identifiers match, except for / being written as ., instead.

Not sure if this is worth clarifying, or how best to do it (without getting into trivialities.)

TLDR: example.todo is actually a directory path itself, **example** > **todo**.


1. Go to **File** > **New** and select either **Java Class** or **Kotlin File/Class**.

Expand Down Expand Up @@ -58,6 +59,8 @@ First, we'll add the DataStore plugin and configure Amplify by creating an Appli

1. Open **AndroidManifest.xml** to configure your application.

1. Add `xmlns:tools="http://schemas.android.com/tools"` to the `manifest` node.

1. Add the `android:name` and `tools:replace` attributes to the `application` node:

```xml
Expand Down Expand Up @@ -95,7 +98,7 @@ First, we'll add the DataStore plugin and configure Amplify by creating an Appli
</manifest>
```

1. Run the application. In logcat, you'll see a log line indicating success:
1. In the Gradle Task dropdown menu in the toolbar, select **app**, and run the application. In logcat, you'll see a log line indicating success:

```console
com.example.todo I/Tutorial: Initialized Amplify
Expand Down Expand Up @@ -303,7 +306,7 @@ Now that you have some data in DataStore, you can run queries to retrieve those

`contains` `notContains`

To use a predicate, pass an additional argument into your query. For example, to see all high priority items:
To use a predicate, pass an additional argument into your query. For example, the following code queries for all high priority items:

<amplify-block-switcher>
<amplify-block name="Java">
Expand Down Expand Up @@ -370,7 +373,7 @@ Now that you have some data in DataStore, you can run queries to retrieve those
</amplify-block>
</amplify-block-switcher>

In the above, notice addition of the predicate parameter as the second argument.
In the above code, notice the addition of the predicate parameter as the second argument.

1. Run the application. In logcat, you'll see only the high priority item returned:

Expand All @@ -380,4 +383,4 @@ Now that you have some data in DataStore, you can run queries to retrieve those
com.example.todo I/Tutorial: Name: Finish quarterly taxes
com.example.todo I/Tutorial: Description: Taxes are due for the quarter next week
com.example.todo I/Tutorial: Priority: HIGH
```
```