How to determine if phone has SMS capability?

Hi. I am using VS2005/VB.Net and CF2 to write applications for Windows Mobile 5 Smartphones.

I'm developing an application that relies on the phone having the ability to send and receive SMS message. I believe (but I could be wrong) that in some countries, and/or with some network providers, that the ability to use SMS is something that must be "turned on" by the network provider and/or setup within the phone.

Therefore, I would like my application to be able to confirm that SMS is enabled and working on the phone, and if not, inform the user appropriately, rather than the user thinking that my application isn't working as intended.

So, is there a way to programmatically determine if the Smartphone has the ability to send and receive SMS message

I'm writing in VB.Net, but I'm comfortable with C#, P/Invoking, etc., so methods/suggestions in any language are appreciated.

Thanks,

Tony



Answer this question

How to determine if phone has SMS capability?

  • Wai Hon

    Hi Tony,

    I hope you can definitely help me.
    I want to show the SMS notificaiton through my applicaiton when my application is running. That means I want to stop SMS notification ballon from OS and want to put notification through my application. I am presently working with VS2005. I got samples but there are some problems like "Cant find P/Invoke DLL mapirule.dll". Even though I give complete path it gives same. When I try to register this COM component by using regsvr32, it gives another error.

    If you can give me sample which works with VS2005 it will be very helpful.

    I hope you can guide me.

    Thanks in Advance,


  • Bob Palank

    Hi Ali,

    What happened you dint give reply for my question. Can u send code to me. I posted above. I think u dint observe it.



  • AMEgo

    Dear all,

    My WM5 PocketPC server application can successfully intercept SMS messages with say 'SMART_CAR' tag but only send OS notification ): not full message :( back to the client PocketPC with say "SMART_GUY" tag.

    I configured each machine to have its own MapiRule.dll looking for their corresponding tags to avoid the SMSListener on the server side intercepting and changing the response but still I keep getting notifications not messages!

    All help is appreciated and I am willing to give my code to whomever asks for it. It works fine if you don't want to show the current car status on a nice GUI and only read the text notification.

    Desired Scenario
    ==============

    ClientPDA sends SMS message with SMART_CAR tag to ServerPDA.

    ServerPDA captures it, decodes it, builds a response and sends it with SMART_GUY tag back to ClientPDA.

    ClientPDA captures it, decodes it and refreshes the user interface with received car status.

    PS: I tried to dispose of the listener or unload the MapiRule.dll before the SMS.SendMessage and new the listener or load the library after but still no success.

    Any other suggestions please

    Ali
    <help yourself by helping others>



  • Kostadin

    Thanks for all those who helped.

    I solved the problem of SMS notiifcation and now it sends real SMS messages.

    All was needed is changing the message CLASS from 0 to 1 in Phone.cs as follows:

    original code:

    Byte[] ProvData = new Byte[12];

    current code

    Byte[] ProvData = new Byte[12];
    ProvData[0] = 0; // IntPtr.Zero;
    ProvData[4] = 1; // PROVIDER_SPECIFIC_MESSAGE_CLASS.PS_MESSAGE_CLASS1;
    ProvDataMusic = 0; // PROVIDER_SPECIFIC_REPLACE_OPTION.PSRO_NONE;

    still if someone can tell me how to convert a struct to byte[] in C# the code would become much prettier :-)

    Download SMSResponder, a fully sender receiver, from here http://www.savefile.com/files/410336

    Ali
    God > infinity



  • Greg Allen

    I suspect this DLL would be in place even if SIMM card is removed from PPC Phone (GSM). Which means you do have DLL but don't have SMS capabilities. I would say it's generally impossible to determine if provider allows to send SMS or not.



  • Andrea Pagliano

    Hi,

    what about checking if \windows\sms.dll exists - that SHOULD tell you if the capability is there

    Pete


  • Jamie Plenderleith

    Thanks for all those who helped.

    I solved the problem of SMS notiifcation and now it sends real SMS messages.

    All was needed is changing the message CLASS from 0 to 1 in Phone.cs as follows:

    original code:

    Byte[] ProvData = new Byte[12];

    current code

    Byte[] ProvData = new Byte[12];
    ProvData[0] = 0; // IntPtr.Zero;
    ProvData[4] = 1; // PROVIDER_SPECIFIC_MESSAGE_CLASS.PS_MESSAGE_CLASS1;
    ProvDataMusic = 0; // PROVIDER_SPECIFIC_REPLACE_OPTION.PSRO_NONE;

    still if someone can tell me how to convert a struct to byte[] in C# the code would become much prettier :-)

    Download SMSResponder, a fully sender receiver, from here http://www.savefile.com/files/410336

    Ali
    God > infinity



  • Nitin Sharma22

    Here is the code for all to see and hopefully help.

    http://www.savefile.com/files/404189

    My problem is with the SendSMS sample which only sends out a notification rather than real SMS message.

    I read somewhere that I need to pass the Service Provide info along with the message.

    Can someone shows me how please

    Many thanks.

    Ali



  • Jassim Rahma

    Hi,

    I agree.

    Testing for sms.dll will tell you if the device has the capability to send an SMS.

    I think maybe the only way to tell, would be to try and send an SMS, and test the return. If it fails, you could assume it is not capable.

    Having said all that, it would fail if the phone was turned off anway, so poss,

    1) Check for sms.dll

    2) If present, check if phone turned on

    3) If phone on try to send an sms to your own number. If that works, you PROBABLY have sms

     

    Pete


  • Ian Jorgensen

    Dear all,

    My WM5 PocketPC server application can successfully intercept SMS messages with say 'SMART_CAR' tag but only send OS notification ): not full message :( back to the client PocketPC with say "SMART_GUY" tag.

    I configured each machine to have its own MapiRule.dll looking for their corresponding tags to avoid the SMSListener on the server side intercepting and changing the response but still I keep getting notifications not messages!

    All help is appreciated and I am willing to give my code to whomever asks for it. It works fine if you don't want to show the current car status on a nice GUI and only read the text notification.

    Desired Scenario
    ==============

    ClientPDA sends SMS message with SMART_CAR tag to ServerPDA.

    ServerPDA captures it, decodes it, builds a response and sends it with SMART_GUY tag back to ClientPDA.

    ClientPDA captures it, decodes it and refreshes the user interface with received car status.

    PS: I tried to dispose of the listener or unload the MapiRule.dll before the SMS.SendMessage and new the listener or load the library after but still no success.

    Any other suggestions please

    Ali
    <help yourself by helping others>



  • Lars E.Nes

    Hi Ali Adams,

    Can you please give me your code my mail is malliwebdeveloper@gmail.com. Actually I am unable to work with MapiRule.dll on VS20005. I hope your code will solve my problem. I have used MessageIntercept class with VS2005. but it is working only for WM5. but not with pocket pc 2003. I hope you will help me with your code.

    Thanks in Advance,

  • paso

    Hi,

    Sorry to bother you but were you abel to figure out how to check for SMS capabilities, would you mind sharing how ! I'm not sure about some smartphones having SMS turned off, but I have a simmilar problem when trying to run some SMS sending capable code on a regular WM5.0 (non Phone edition) PDA... Even though it starts and it even works fine it breaks when I try to send an SMS, sayingit could not load "sms.dll" file...

    I'm a n00b pretty much when it comes to SmartDevice programming and even C# to be quite honest. Wish there was a way to try{}catch [dllimport] statements but that won't work cause you have to specify all [dllimport] statements before you can write any code (or that's my understanding for now, I could be wrong)...

    Don't know if Assembly.Load() could help! Any sugestions, anyone! And please don't suggest me making a separate Phone and non-Phone edition codebases, please! THNX


  • dark_majician

    Hi,

    I want to use your code. but you hve used GeoFramework. Is it neccessary to intercept the messages. Actually I want to work on PocketPC2003, WindowsMobile 5.0. Previously I tried Mapirule.dll but got problem with that. If you can help me I will be really thank ful to you.

    May I know more about ur application. You have used Satelite Viewer, Satelite Time, SpeedoMeter. I am really confused. Can you please explain about your application.

    Thanks in advance.

  • How to determine if phone has SMS capability?