You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 31, 2022. It is now read-only.
// This will automatically update to the latest v3 release when you build your project.
71
+
// This will automatically update to the latest v3 release when you build your project
72
72
}
73
73
```
74
74
@@ -90,22 +90,26 @@ Index index = client.getIndex("your_index_name");
90
90
You should instead consider [fetching the key from your servers](https://www.algolia.com/doc/guides/security/best-security-practices/#api-keys-in-mobile-applications)
91
91
during the app's startup.
92
92
93
+
### Kotlin support
94
+
95
+
Even though the Android client is written in Java, you can still use it in a Kotlin project, as long as you don't mix Java and Kotlin code in the same file.
96
+
93
97
## Push data
94
98
95
99
Without any prior configuration, you can start indexing contacts in the ```contacts``` index using the following code:
96
100
97
101
```java
98
102
Index index = client.initIndex("contacts");
99
103
index.addObjectAsync(newJSONObject()
100
-
.put("firstname", "Jimmie")
101
-
.put("lastname", "Barninger")
102
-
.put("followers", 93)
103
-
.put("company", "California Paint"), null);
104
+
.put("firstname", "Jimmie")
105
+
.put("lastname", "Barninger")
106
+
.put("followers", 93)
107
+
.put("company", "California Paint"), null);
104
108
index.addObjectAsync(newJSONObject()
105
-
.put("firstname", "Warren")
106
-
.put("lastname", "Speach")
107
-
.put("followers", 42)
108
-
.put("company", "Norwalk Crmc"), null);
109
+
.put("firstname", "Warren")
110
+
.put("lastname", "Speach")
111
+
.put("followers", 42)
112
+
.put("company", "Norwalk Crmc"), null);
109
113
```
110
114
111
115
## Configure
@@ -124,9 +128,9 @@ In this case, the order of attributes is very important to decide which hit is t
124
128
125
129
```java
126
130
JSONObject settings =newJSONObject()
127
-
.append("searchableAttributes", "lastname")
128
-
.append("searchableAttributes", "firstname")
129
-
.append("searchableAttributes", "company");
131
+
.append("searchableAttributes", "lastname")
132
+
.append("searchableAttributes", "firstname")
133
+
.append("searchableAttributes", "company");
130
134
index.setSettingsAsync(settings, null);
131
135
```
132
136
@@ -141,13 +145,13 @@ CompletionHandler completionHandler = new CompletionHandler() {
0 commit comments