Whether SIM card is available or not in windows phone universal project -


i'm creating winrt universal project mobile , tablet.

i want check:

in mobile application, sending sms text sms application this.

var message = new chatmessage(); message.recipients.add("9999"); message.body = "r*" + voucherno + "*" + accountno + "*" + pin; await chatmessagemanager.showcomposesmsmessageasync(message); 

i want place check above whether user has inserted sim card or using mobile out sim card. app not crashing due not big issue if couldn't place check here (as have searched alot got nothing i'm assuming not possible right not in winrt check sim card availability), link of documentation/blog/so question regarding mentioned can't check sim card availability helpful.

thanks.

bool simavailable = false; var device = await chatmessagemanager.gettransportsasync(); if (device != null && device.count > 0) {     foreach (var item in device)     {         if (item.transportfriendlyname != "no sim")         {             simavailable = true;             break;         }     } } 

just enter code , simavailable true if phone hase sim card.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -