Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 android 中,如何以编程方式检查我有足够数量发送 SMS 的条件?以及在 android 代码中使用 smsManager 发送 sms 时会考虑哪些极端情况,例如网络可用性、SIM 卡状态等。
如果您询问是否有足够的积分/余额来发送 SMS,那么不,除了尝试发送 SMS 并查看它是否发送或失败之外,没有其他办法。
有一些运营商(例如在菲律宾)拥有此网络 api 来为客户检索余额,但它要么不向公众开放,要么通过 Rest 服务器访问(需要手机具有数据连接)。
没有办法你想做的事..更好地处理错误。那可能是更合适的方式。