Reputation: 157
I am trying to hit a JSON api in webview and then store the results in local sqlite Database of my app.
I also wanted to ask this is webview able to read local app data and can we put local data into a webview's settings, such as a header, cookie etc
Is this possible?
Any help is appreciated.
Upvotes: 1
Views: 2290
Reputation: 15774
Yes, it is possible. Take a look at Binding JavaScript code to Android code section in the Building Web Apps in WebView developer guide for an explanation and example of JavaScript <-> Android Java code interaction.
Upvotes: 1
Reputation: 164
Yes , Parse the json to the class object using GSON (or any other parser). class data you can use for sqlite. GSON is for parsing the json to directly class object.
Upvotes: 0