Ive been using some endpoint for about a month now and its been working fine for me. All of a sudden my app is really slow on calling the api and android becomes impatient and throws an error message saying my app has crashed since its taking a long time to make the http request (this happens when the ui is unaccessible to the user when the cpu is doing some long computation, which in this case is the request). I suspect its a network issue because of the following but don't quite know much about stuff like that/what could possibly be the reason.
note:
-This problem occurs when I use my home wifi
-I installed it on another android device and confirmed its having issues when directly connected to home wifi
-Using my mobile data works fine
-I used my primary phone as a hotspot (connected to home wifi) and connected my secondary phone to my primary phone and it seems to work (confirmed its using home network... they have same ip addresses)
-I used a vpn on top of the home network and it works fine
-I tested the api through my desktop/mobile testers and api does not seem to be causing any trouble
-I tried restarting my phone, clearing cache, reinstalling app, restarting router, but none of it worked
#Android Studio ANR error waiting for response from okhttp request
1 messages · Page 1 of 1 (latest)
<@&987246623988019200> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Closed the thread due to inactivity.
If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍
Hi, so I tested running the app using a different endpoint with a different http library but the bug still persists... I don't know what's causing this issue; im thinking its some internet config setting im setting on the android app code side but I'm not sure.
The following is the manifiest file I used excluding the activity tags.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="App"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:usesCleartextTraffic="true"
tools:targetApi="31">
Could there be something here thats causing it to slow down on my particular network?
Looking at it some more I dont think any of the above mentioned attributes in the manifest file would be causing this since theyre just configurations. I was thinking dependency versions from the library im using to call the api but when i switched to a different one the problem still persisted. Im back on the network being the primary reason but am very unsure why/what/how to fix that cause?