<BlockSwitcher>
<Block name="Java">

```java
import android.util.Log;
import com.amplifyframework.core.Amplify;
import com.amplifyframework.datastore.generated.model.Post;
```

```java
Post post = Post.builder()
    .title("Create an Amplify DataStore app")
    .status(PostStatus.ACTIVE)
    .build();

Amplify.DataStore.save(post,
    result -> Log.i("MyAmplifyApp", "Created a new post successfully"),
    error -> Log.e("MyAmplifyApp",  "Error creating post", error)
);
```

</Block>
<Block name="Kotlin - Callbacks">

```kotlin
import android.util.Log
import com.amplifyframework.core.Amplify
import com.amplifyframework.datastore.generated.model.Post
```

```kotlin
val post = Post.builder()
    .title("Create an Amplify DataStore app")
    .status(PostStatus.ACTIVE)
    .build()

Amplify.DataStore.save(post,
    { Log.i("MyAmplifyApp", "Created a new post successfully") },
    { Log.e("MyAmplifyApp", "Error creating post", it) }
)
```

</Block>
<Block name="Kotlin - Coroutines">

```kotlin
import android.util.Log
import com.amplifyframework.datastore.generated.model.Post
import com.amplifyframework.kotlin.core.Amplify
```

```kotlin
val post = Post.builder()
    .title("Create an Amplify DataStore app")
    .status(PostStatus.ACTIVE)
    .build()

try {
    Amplify.DataStore.save(post)
    Log.i("MyAmplifyApp", "Saved a new post successfully") 
} catch (error: DataStoreException) {
    Log.e("MyAmplifyApp", "Error saving post", error) 
}
```

</Block>
<Block name="RxJava">

 ```java
import android.util.Log;
import com.amplifyframework.datastore.generated.model.Post;
import com.amplifyframework.rx.RxAmplify;
```   

```java
Post post = Post.builder()
    .title("Create an Amplify DataStore app")
    .status(PostStatus.ACTIVE)
    .build();

RxAmplify.DataStore.save(post).subscribe(
    () -> Log.i("MyAmplifyApp", "Created a new post successfully"),
    error -> Log.e("MyAmplifyApp",  "Error creating post", error)
);
```

</Block>
</BlockSwitcher>
