windows phone 8 - Detect network roaming when there is no Internet connection -


i detect network roaming, while there not internet connection on windows phone 8 , 8.1. used code determine if user in roaming:

connectionprofile profile = windows.networking.connectivity.networkinformation.getinternetconnectionprofile();         if (profile == null)             return false;         else             return profile.getconnectioncost().roaming; 

with code easy find if phone in roaming when there internet access. problem occurs when there not connection , connectionprofile returns null. searched internet , stack overflow detecting network roaming, without results. suggested use mnc , mcc, windows phone doesn't provide such information or more detailed network info. didn't find either function android telephonymanager.isnetworkroaming().

is there function, api or method detect user in roaming, when internet connection down?

you try this,

using microsoft.phone.net.networkinformation; private void button1_click(object sender, routedeventargs e) {     system.text.stringbuilder sb = new system.text.stringbuilder();     sb.append("network available:  ");     sb.appendline(devicenetworkinformation.isnetworkavailable.tostring());     sb.append("cellular enabled:  ");     sb.appendline(devicenetworkinformation.iscellulardataenabled.tostring());     sb.append("roaming enabled:  ");     sb.appendline(devicenetworkinformation.iscellulardataroamingenabled.tostring());     sb.append("wi-fi enabled:  ");     sb.appendline(devicenetworkinformation.iswifienabled.tostring());     messagebox.show(sb.tostring()); } 

you may find useful http://msdn.microsoft.com/library/windows/apps/jj207005%28v=vs.105%29.aspx


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -