Android OkHttp and Retrofit breakpoint resume

Earlier we already know how to download files using OkHttp and Retrofit .When downloading files, you may encounter some unexpected situations, such as a network error or the user has suspended the download. Start the download again, if you want to start from the beginning, it will waste the previously downloaded content. The breakpoint resume function can … Read more

How to use Bluetooth 2.0 on Android?

This article will talke about how to use Bluetooth 2.0 on Android? The source code is based on Android L. Get the BluetoothAdapter, search for a Bluetooth device, initiate a socket connection, and get data from a peripheral Bluetooth device. SPP is rarely used now, and the mainstream is BLE. The common class BluetoothAdapter First … Read more

Android OkHttp + Retrofit download file and progress monitor

Downloading files is a relatively common requirement. Given a url, we can use URLConnection to download the file . Files can also be downloaded via the stream using Android OkHttp. Add an interceptor to OkHttp to implement the monitoring of the download progress. Add an interceptor to OkHttp to implement the monitoring of the download progress. Use streams … Read more