Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java and android doc update #1

Merged
merged 4 commits into from
Jul 13, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
android doc update
  • Loading branch information
ConfigCat authored Jul 13, 2019
commit 99787c8b4af3e4365801d6144247c1402300138e
12 changes: 6 additions & 6 deletions docs/sdk-reference/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ android {
implementation 'com.configcat:configcat-android-client:1.+'
```
### 2. Import the ConfigCat SDK:
```java
import com.configcat.*;
```kotlin
import com.configcat.*
```
### 3. Create the *ConfigCat* client with your *API Key*
```java
```kotlin
val client = ConfigCatClient("<PLACE-YOUR-API-KEY-HERE>")
```
### 4. Get your setting value
```java
val isMyAwesomeFeatureEnabled = client.getValue(Boolean::class.javaObjectType, "<key-of-my-awesome-feature>", false);
```kotlin
val isMyAwesomeFeatureEnabled = client.getValue(Boolean::class.javaObjectType, "<key-of-my-awesome-feature>", false)
if(isMyAwesomeFeatureEnabled) {
doTheNewThing()
} else {
doTheOldThing()
}
```
Or use the async APIs:
```java
```kotlin
client.getValueAsync(Boolean::class.javaObjectType, "<key-of-my-awesome-feature>", false)
.thenAccept({ isMyAwesomeFeatureEnabled ->
if(isMyAwesomeFeatureEnabled) {
Expand Down