'Error retreiving data from phpmyadmin server using retrofit
I have an application where i fetched data from phpmyadmin server hosted on 000webhost , basically it keeps throwing an error and i could not understand what the error is about , because the export json shows that it returns a list of data and i have used json plugin to generate the model class and i feel like everything is alright but i don't know if someone could help , i would deeply appreciate it , Thank you
- This is the error line
End of input at line 1 column 1 path $
- AuthService class
@GET("index.php")
fun getInfo() : Flowable<DataModel>
- MainActivity Code
private fun getInfo(){
AuthService.getAuthInstance().getInfo()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.toObservable()
.subscribe(object : Observer<DataModel>{
override fun onSubscribe(d: Disposable) {
}
override fun onNext(t: DataModel) {
Log.d("TAG","Value is ${t[0].data[0].name}")
}
override fun onError(e: Throwable) {
Log.d("TAG","Error is " + e.localizedMessage)
}
override fun onComplete() {
}
})
- I have exported the json file from phpmyadmin and this is how it looks like
[
{
"type":"header",
"version":"4.9.5",
"comment":"Export to JSON plugin for PHPMyAdmin"
},
{
"type":"database",
"name":"idxxxxxx_info"
},
{
"type":"table",
"name":"info",
"database":"idxxxxxx_info",
"data":[
{
"id":"53",
"name":"xxxx",
"userName":"xxxx",
"address":"xxxx",
"age":"100"
}
]
}
]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
