[英]Best way to send and receive data(POST and GET) from Android to web server using Java?
In my Android Studio project I am using Java and I have Room database combined with LiveData and ViewModel.在我的 Android Studio 项目中,我使用 Java,并且将 Room 数据库与 LiveData 和 ViewModel 结合使用。
I want to upload some of the tables from Room database(make post requests to a PHP script) and also be able to download( GET request from web server ).我想从 Room 数据库上传一些表(向 PHP 脚本发出发布请求)并且还能够下载(来自 Web 服务器的 GET 请求)。
My question is what is the best approach for this?我的问题是最好的方法是什么? Is a good idea to use Android Studio AsyncTask or should I use RxJava for network calls in order to prevent blocking UI?使用 Android Studio AsyncTask 是个好主意还是应该使用 RxJava 进行网络调用以防止阻塞 UI? I think about using okHttp for send and receiving data.我考虑使用 okHttp 来发送和接收数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.