3

i'm trying to determine if the device i'm running on has the capability to send/receive phone calls, email, and SMS.

i found that i can use the TelephonyManager to get the devices phone number and on devices without the capability of making calls the phone number is null. that's one problem down. i still haven't found a way to detect email and SMS capability.

iHorse
  • 31
  • 2

1 Answers1

1

SMS is probably futile without a cell signal, so you can use your same trick for that.

As for email (=networking), you can probably iterate through your devices in NetworkInterface.getNetworkInterfaces() and see if the device is connected. If you can connect to the internet, you can send emails.

EboMike
  • 76,846
  • 14
  • 164
  • 167
  • sorry if im not being clear but your not quite getting my meaning. the device i am working on does not actually have the ability to send email or SMS. but it does have WiFi so my solution will have nothing to do with cell signal or network connectivity. – iHorse Mar 07 '11 at 18:04
  • If you have WiFi, how can you not send email? Even without any mail apps (that you could easily install), you can connect to any SMTP server and send the mail out. As for SMS, if you don't have a cell signal, you can't send SMS, so that test should work too. – EboMike Mar 07 '11 at 19:12
  • 2
    @EboMike but the inverse isn't true - just because you have a signal doesn't mean you CAN send an SMS. What if no SMS provider settings are configured? – Basic Oct 01 '11 at 02:56