How to use AWS API Gateway generated SDK with Android Volley

489 views Asked by At

I am using IAM secured API gateway with access key, secret key and an api key. I have previously used the sdk as follows:

BasicAWSCredentials cred = new BasicAWSCredentials("ERQWFSDGFDSTGFDAGVFSD", 
"FADSVXXCGDFHBXVDSFDDGFBFSD");
StaticCredentialsProvider credentialsProvider = new 
                          StaticCredentialsProvider(cred);
ApiClientFactory factory = new 
ApiClientFactory().credentialsProvider(credentialsProvider)
.apiKey("GFDSATRFGEDHFGHBDFTY6ERTYGHJKJHDFGTRTUJJH");
final MyTestApiGetwayClient client = 
factory.build(MyTestApiGetwayClient.class);
ApiResponse apiResponse = client.execute(request);

This works fine.

My question is how to use the SDK with Android volley library (StringRequest/JSONObjectRequest). I don't want to manually calculate the aws authorization signature and add it to the header, but instead I want to use the sdk.

Note: I don't want to use the output model as recommended by AWS as I am not mapping the responses.

Thanks in advance.

Dawit

1

There are 1 answers

0
Bob Kinney On BEST ANSWER

API Gateway SDK generate requires Modeling your request/response.

If you just want to access the signature version 4 components, you may want to just extract that source from the Android SDK or use an alternative SDK for generating the signature.