I have an app where I have to use websockets to update markers on google map in real time. I successfully did the connection with web sockets and in the response I'm getting the json string. I parsed to JSONObject and when I debug I see that all the data in the json are coming but the problem is when I have to add markers. The error is:
After connection to websocket I did the following code to get the data:
and I run the websocket in the runonuithread() on onCreate as in the following:
I'm using okHttp library to perform communications with websockets. What I'm doing wrong here. Does anyone have any suggestion what I need to improve. Any help will be appreciated. Thanks in advance.