It looks like you're new here. If you want to get involved, click one of these buttons!
HTTP FAILED: android.os.NetworkOnMainThreadException
error while requesting access token using kiteConnect.generateSession(var_requestToken, var_apiSecret)
. Anyone has any idea how to fix this? Help is greatly appreciated.
response
for therequests
with url and body. But in the case ofkiteConnect.generateSession(var_requestToken, var_apiSecret)
I don't have access to url and body. Is there anyway to implement an asynchronous task here or do I have to edit KiteRequestHandler? Or is it already implemented?It is not recommended to hardcode api_secret inside your app. You need to generate session in server side.
You can listen to webview events and figure out the final URL with request token. You need to send that request token to the server and that should handle the login and respond to the Android app.
Thanks for the update.
I am creating this app for my own personal use. That's why I thought I will store the API secret inside the app since no one else will have access to the app.
Also, I am not thinking of having a server per se. I thought I will directly use the Kite API to get the data and do the processing inside the android app.
So for achieving it, I will have to handle network request in a background thread. Is there any way other than editing KiteRequestHandler to solve the problem?
Thanks for the help.
I could successfully fetch the data by making API calls from a background thread.
You can close this thread now.