Questions tagged [android-connectivitymanager]

159 questions
1
vote
1 answer

Is there a listener for when a user gets connected to a WiFi network (with internet access)?

I'm struggling to get to know when a user gets connected to a WiFi network with Internet access. So far, I've tried two ways to achieve that: using a BroadcastReceiver (action: android.net.conn.CONNECTIVITY_CHANGE), and; registering a…
Augusto Carmo
  • 4,386
  • 2
  • 28
  • 61
1
vote
1 answer

Binding to cellular network with bindProcessToNetwork does not work

I am trying to bind to a cellular network on demand (wifi is still running). I have the following code: override fun onAvailable(network: Network) { super.onAvailable(network) …
dazza5000
  • 7,075
  • 9
  • 44
  • 89
1
vote
0 answers

Why does API Level 29 WiFi connection require a password?

I'm trying to connect to an IoT device which communicates via access point it's hosting (there can be multiple IoT devices in the same room). On API older than 29 I used WifiManager methods to connect to the device. Now those are deprecated and…
1
vote
1 answer

ConnectivityManager.NetworkCallback is not workig as required

I used ConnectivityManager.NetworkCallback to take the connected wifi network SSID for the android devices. I need to implement this application for Android 9.0 and above. Hence I not used the Broadcast Receivers (because they are deprecated to the…
Hilton
  • 337
  • 6
  • 19
1
vote
2 answers

Android:Listen to Internet connectivity change and load URL in webView On connected

I am very new to android development so sorry in advance for very basic question. At start of my app I want to check if network is available and connected, If yes then load webView and load URL. This was an easy part and I did it. Now if at start of…
Zeni
  • 947
  • 1
  • 12
  • 24
1
vote
3 answers

How to know the internet connection type that my mobile uses

I want to know the type of internet connection my mobile uses (Cellular or wifi). Network network; manager = (ConnectivityManager) this.getSystemService(this.CONNECTIVITY_SERVICE); manager.getActiveNetworkInfo(); if (manager != null){ if…
1
vote
0 answers

Internet Connection Change Job Service need to schedule everytime in activity?

I was reading android documentation for register a listner on network change for android pie and below versions. I found out , for version above lolipop i can run a job service which monitor network changes. So my question is If it monitor network…
1
vote
6 answers

How to achieve dialogue box get disappeared when internet or WiFi get connected. and vice versa?

I build the dialogue box for my android app. Its working well, but i encountered some issues related to the dialogue box. (1) I want when internet connection or WiFi get connected. automatically dialogue box get disappeared. (2) In middle of the app…
1
vote
0 answers

BindProcessToNetwork not working on a specific device

I have an app that's custom built for a client and not available in the Play Store that basically makes some network calls when it detects that the device is connected to their WiFi. This should happen even if it has no internet connection, every…
1
vote
1 answer

Networkcallback called multiple times even after unregistering

In my android-app I need to call an API via my Wi-Fi connection which doesn't have an internet connection, even though cellular data is enabled. I manage to handle this with underneath code: NetworkRequest.Builder builder; builder = new…
Dieter27
  • 134
  • 2
  • 8
1
vote
1 answer

"Connected" even when wifi is off

Mission is to check if the mobile is connected on internet or not. I have problem. It shows "Connected" even when wifi is off. Here is my class. public class InterneProvjera { Context context; @SuppressLint("MissingPermission") public…
1
vote
1 answer

Network State Finding Issue with ConnectivityManager in android

I want to find is this mobile connected with internet or not(wifi and mobile data) iam using below code its working fine in all device except one mi note 4 i find an issue its not showing false when its not coonected with internet please help me. …
1
vote
2 answers

How to set ContentView to Another Fragment if No internet is available and Resume Fragment if Connection is Available

After my App Login, I need to check Internet Connection before every onClick event and after every Fragment is added or replaced.If Internet Connection is not Available the setContentView should set another Fragment and as soon as the Internet get…
1
vote
2 answers

How to access Muliple network interface in android (WiFi and mobile data)

Ok, so my question is may be off topic but i really did not found any useful content to use both network interface simulnasily in my application is simple image uplaod to server using both open network for better speed.here can we use both network…
Subhash Pandey
  • 111
  • 1
  • 6
1
vote
0 answers

Is there a way to check if Ethernet specifically is connected (even when WIFI is also connected)?

Using the connection manager it's easy enough to see if there is a connection, however if both Ethernet and WIFI are connected at the same time it always seems to report that WIFI is connected. I want to know if I have a connection, but also what…
Michael Vescovo
  • 3,741
  • 4
  • 32
  • 45