Questions tagged [android-connectivitymanager]
159 questions
0
votes
1 answer
Connection Change Receiver doesn't work?
First of all I'm using api 23 and not android N so android.net.conn.CONNECTIVITY_CHANGE should still work for me but it doesn't.
Manifest:

future engineer
- 109
- 1
- 8
0
votes
1 answer
Sending traffic in android app via particular connection
I am developing an android app in which I specifically need to make a HTTP connection over WiFi only. It seems there were a lot of connectivity related changes in Android L and above.
This is the piece of code I'm using:
ConnectivityManager manager…

Nilesh
- 624
- 1
- 7
- 23
0
votes
2 answers
How to call onReceive from onReceive of another BroadcastReceiver in Android?
I am developing one android application, In which i need to call onReceive method of Alarmmanager from onReceive of another BroadcastReceiver i.e. Internet connectivity. Is it possible ? Or should i duplicate all my stuff in another…

Mayura Devani
- 440
- 3
- 17
0
votes
1 answer
It is possible to get network type (wifi/mobile) without requiring permissions?
I need to know network type, but it requires permissions.
I'm trying this way:
public String getConnectionTypeNew(Context context){
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
…

NullPointerException
- 36,107
- 79
- 222
- 382
0
votes
1 answer
Application crashing on HttpsURLConnection openConnection() The application may be doing too much work on its main thread
I am trying to make a JSON AsynTack service call to login in my user. Unfortunately it is crashing on the openConnection with error message: an error occurred while executing doInBackground(). I am an iOS developer who is trying to learn Android so…

user1079052
- 3,803
- 4
- 30
- 55
-1
votes
2 answers
(Java) Check if Android app is connected to WIFI with Android 13 and API 33
I have an Android app built with Java, running on Android 13 and API version 33.
The app serves a webView, though I want to be able to serve up a local asset if WIFI is not connected (I do not need to worry about Cellular connections - only WIFI) as…

odd_duck
- 3,941
- 7
- 43
- 85
-1
votes
2 answers
Detect VPN running in Android Phone
I am trying to detect if VPN is running on the phone. I have implemented the below code, but it reports crashes on Firebase Crashlytics.
ConnectivityManager connectivityManager = (ConnectivityManager)…

Wasif
- 61
- 10
-1
votes
2 answers
Get notified only when data or wifi is disconnected
Hello guys i am building an application in which i want to notify the user only when the device looses connection whether its mobile data or wifi.
So far i have used this method:
private void setupReceiver() {
CheckNetworkStatusReceiver…
user7157256
-2
votes
2 answers
How to call outer activity method from adaptor?
I am trying to call the outer class method from adaptor as
new MainActivity().openPainRecordDialog(context,dbHelper);
it is working fine.
But when I do like this
Boolean status=new…

Ankur Khandelwal
- 1,042
- 3
- 19
- 40