Android Question strange issue with ConnectivityChanged event not triggering

giggetto71

Active Member
Licensed User
Longtime User
Hi,
I am facing a very strange issue on some phones. apparently when I disable the wifi and phone switches from wifi -> mobile data the event fires, but when I re-enable the wifi the connectivityChanged does not fire (it's almost like the switch between mobile data->wifi, that happens "so fast" (or so smooth..) that the even does not detect a change in connectivity...again what puzzles me is that this seems to happen only on some phones (maybe android version? maybe some network settings..).
thanks for any tips.
 

giggetto71

Active Member
Licensed User
Longtime User
Hi,
I have just noticed that I was using:

B4X:
PhoneEvent1.Initialize("PhoneEvent")

and not

B4X:
Public PhoneId As PhoneId
'................'
PhoneEvent1.InitializeWithPhoneState("PhoneEvent",PhoneId)

what is the difference between the two intialization methods?
thanks
 
Upvote 0

giggetto71

Active Member
Licensed User
Longtime User
Thanks. I am not sure i understand the meaning of "no longer relevant". Is there another way to be notified in the application about connection state change?
 
Upvote 0

giggetto71

Active Member
Licensed User
Longtime User
I would prefer an event to a timer as the app is a foregroud service and I want to save battery as much as possible.
My only problem is that on some phones the event seems to fire only wifi ->4g while it seems to just skip in case of 4g->wifi. Unfortunately one of those phones is my company phone where most settings are administered by my company and i cannot install apps from unkown sources..only from google play..so on that phone i cannot make tests..only when the app is released...:-(..
 
Upvote 0
Top