I am building one android app for shipment tracking.
Can anyone provide sample code for API handling using volley or retrofit library?
I am able to login using frappe rest api, but as frappe doesn’t return any access token, I am unable to hit second request to fetch data.
We’ve used a library called android-async-http. The way to add it to an Android Studio project is adding compile ‘com.loopj.android:android-async-http:1.4.9’ under the dependencies section under build.gradle (app). That will query the Maven directory and download it correctly.
The important part is doing the initial login via /api/method/login and storing the cookie received into the app. Before the login is attempted, I use the setCookieStore() method to add a persistent cookie store which will automatically store the received cookie that Frappe sends back and send it with each upcoming request.
EDIT: I should add that the above is just a note from a developer. Hope it helps. I don’t have knowledge myself to help further if you have any questions!
Get your developer on the forum!