How to load webpage in Android webview via AWS API Gateway
<p>I would like to know how to load an webpage that is accessed via AWS API Gateway to an Android WebView. The API is protected by IAM user role/policy, so just simply calling below isn't enough</p>

<pre><code>WebView.loadUrl("https:ewfwfbuet234.execute-api.us-west-2.amazonaws.com/STAGE/mypage"); 
</code></pre>

<p>The obvious answer that would be suggested is to implement my own AWS Signature 4 header, something like</p>

<pre><code>String awsSig4Header = myHeaderConstructor(credentials, otherParams);
myWebView.loadUrl("https:ewfwfbuet234.execute-api.us-west-2.amazonaws.com/STAGE/mypage", awsSig4Header);
</code></pre>

<p>However, I'd like to avoid implementing my own signature constructor on the off-chance that Amazon update their Sig4 method (maybe implement Sig5 or something)
The app I'm building must be simple to update (e.g. just update the libraries, no need for code mods, then re-build the APK)</p>

<p>I also generated the lib via the SDK exporter of the API Gateway console.
I used the following settings described in the link below for the method and integration response. 
But the generated function returns void.</p>

<p><a href="https://kennbrodhagen.net/2016/01/31/how-to-return-html-from-aws-api-gateway-lambda/" rel="nofollow noreferrer">https://kennbrodhagen.net/2016/01/31/how-to-return-html-from-aws-api-gateway-lambda/</a></p>

<p>I checked the github page for Amazon's Android SDK, and someone already requested for this specific feature. No updates since July 2016.</p>

<p><a href="https://github.com/aws/aws-sdk-android/issues/29" rel="nofollow noreferrer">https://github.com/aws/aws-sdk-android/issues/29</a></p>

<p>Finally, the web page I'm loading is using javascript, so the webview also has javascript enabled by using setJavaScriptEnabled(true)</p>

<p>The solution I'm looking for is either </p>

<p>o How to configure API Gateway's method and integration response so that the result can be loaded to a WebView, maybe catch the response body somehow?</p>

<p>o Alternative to WebView, if WebView cannot handle it</p>

<p>o A Java library that can generate the header and is also active (so that if Amazon does change Sig4, updating the app is still easy)</p>

<p>o Generate a "pre-signed URL" (for API Gateway, if it is even possible) so that I do not have to include the Sig4 header when calling WebView.loadUrl</p>

<p>Other info:</p>

<p>o The webpage uses javascript</p>

<p>o The webpage I'm trying to access is something like</p>

<pre><code>https:ewfwfbuet234.execute-api.us-west-2.amazonaws.com/STAGE/mypage
</code></pre>

<p>Thank you</p>