Reputation: 71
I have some rest requests in my app, executing on an async task. The small ones works everywhere (emulator and USB connected device), but when I have to read bigger input streams (like a base64 image), it only works on emulators (api 29, and api 23 tested ok), but not on my phone (which is also api 23). It simply stops reading in the middle of the stream, without error.
Are there any limitations or developer options to configure for being able to handle larger REST responses on a USB connected device?
I also tried Volley lib, but gives me a Timeout error, i suppose that internally is happening the same that using the java.net classes.
I have defined internet permission and android:usesCleartextTraffic="true" in manifest.
I hope someone can help me with this.
Upvotes: 0
Views: 88
Reputation: 11
Add "org.apache.http.legacy" in the manifest file. Hope it will work.
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
</application>
Upvotes: 1