Приложение работало нормально, но не показывало ошибок подключения к Интернету (ошибка кода состояния 204) (решено) ⇐ Android
-
Anonymous
Приложение работало нормально, но не показывало ошибок подключения к Интернету (ошибка кода состояния 204) (решено)
My Application was deployed over 7 years and now showing the error for no internet connection, it was also that while connected to office network the app was working fine but while connected to private network(mobile data) and was showing the error.
While debugging the code, through app inspector I found out that the api call to check the internet connection was calling www.google.com for internet checker, and in case when app was working the status coded of google was 200 and in case of not working the status code was 204, meaning the server successfully processes the request, but there is no content to return to the client.(meaning google is not giving reply to private network).
So first I changed https://www.google.com to https://www.youtube.com and the app was working fine everywhere. So, to solve this issue properly (as youtube can also do the same as google to not reply to private networks) we can use android libraries to check internet connection.
ref: https://developer.android.com/training/ ... tatus-type
Reason: In old applications used google to check internet connection. So, it can cause this problem in many old apps.
Источник: https://stackoverflow.com/questions/780 ... tatus-code
My Application was deployed over 7 years and now showing the error for no internet connection, it was also that while connected to office network the app was working fine but while connected to private network(mobile data) and was showing the error.
While debugging the code, through app inspector I found out that the api call to check the internet connection was calling www.google.com for internet checker, and in case when app was working the status coded of google was 200 and in case of not working the status code was 204, meaning the server successfully processes the request, but there is no content to return to the client.(meaning google is not giving reply to private network).
So first I changed https://www.google.com to https://www.youtube.com and the app was working fine everywhere. So, to solve this issue properly (as youtube can also do the same as google to not reply to private networks) we can use android libraries to check internet connection.
ref: https://developer.android.com/training/ ... tatus-type
Reason: In old applications used google to check internet connection. So, it can cause this problem in many old apps.
Источник: https://stackoverflow.com/questions/780 ... tatus-code
Мобильная версия