When building a custom app using the SDK, I've noticed that the SaveNetworkResp does not contain a getStatus() method the same way as the ListNetworkResp does. It is possible to use contains() method on the response.toString() to capture the status required:
@Override
public void onSaveNetworkResponse(final SaveNetworkResp response) {
if (response.toString().contains("status: 0")) {
Log.i(TAG, "Network saved successfully");
} else {
Log.i(TAG, "Network not saved");
}
}
However it feels more like a workaround, rather than an optimal solution. After investigating, I've noticed that the SaveNetworkResp class is missing a @Getter annotation. Same for DeleteNetworkResp and EditNetworkResp. After adding @Getter to the classes, getStatus() can be used:
@Override
public void onSaveNetworkResponse(final SaveNetworkResp response) {
if (response.getStatus() == 0) {
Log.i(TAG, "Network saved successfully");
} else {
Log.i(TAG, "Network not saved");
}
}
When building a custom app using the SDK, I've noticed that the
SaveNetworkResp
does not contain agetStatus()
method the same way as theListNetworkResp
does. It is possible to usecontains()
method on theresponse.toString()
to capture the status required:However it feels more like a workaround, rather than an optimal solution. After investigating, I've noticed that the
SaveNetworkResp
class is missing a@Getter
annotation. Same forDeleteNetworkResp
andEditNetworkResp
. After adding@Getter
to the classes,getStatus()
can be used:I've made a commit https://github.com/ignasbol/amazon-freertos-ble-android-sdk/commit/025a8c1c0100d2364004115c8ea1d754659bcbab to solve this.