Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Apr 29, 2024

Delete data

Amplify Android v1 is deprecated as of June 1st, 2024. No new features or bug fixes will be added. Dependencies may become outdated and potentially introduce compatibility issues.

Please use the latest version (v2) of Amplify Library for Android to get started. Refer to the upgrade guide for instructions on upgrading your application to the latest version.

Amplify libraries should be used for all new cloud connected applications. If you are currently using the AWS Mobile SDK for Android, you can access the documentation here.

DELETE requests

RestOptions options = RestOptions.builder()
.addPath("/todo/1")
.build();
Amplify.API.delete(options,
response -> Log.i("MyAmplifyApp", "DELETE succeeded: " + response),
error -> Log.e("MyAmplifyApp", "DELETE failed.", error)
);
val options = RestOptions.builder()
.addPath("/todo/1")
.build()
Amplify.API.delete(options,
{ Log.i("MyAmplifyApp", "DELETE succeeded: $it") },
{ Log.e("MyAmplifyApp", "DELETE failed.", it) }
)
val request = RestOptions.builder()
.addPath("/todo/1")
.build()
try {
val response = Amplify.API.delete(request)
Log.i("MyAmplifyApp", "DELETE succeeded: $response")
} catch (error: ApiException) {
Log.e("MyAmplifyApp", "DELETE failed", error)
}
RestOptions options = RestOptions.builder()
.addPath("/todo/1")
.build();
RxAmplify.API.delete(options)
.subscribe(
response -> Log.i("MyAmplifyApp", "DELETE succeeded: " + response),
error -> Log.e("MyAmplifyApp", "DELETE failed.", error)
);