我可以无意识地做某事吗?或者在某些情况下我必须使用它们?
假设我想发送短信或电子邮件。我是否必须为此使用意图(调用操作系统本机服务)或者我可以发送短信/电子邮件/彩信/等。从应用程序内?是否可以在不打开操作系统本机服务/工具屏幕的情况下执行此操作?
我找到的所有材料都通过使用意图来解释这些任务。我想知道我是否真的必须依赖意图。
附言。我知道它们是处理事情的推荐方式,但不是强制性的。当我开发条形码扫描应用程序时,客户不允许使用外部应用程序(通过意图调用),但他希望在应用程序内完成这一切。那么为什么我不应该对短信/电子邮件/彩信/等做同样的事情呢?!
Let's say I want to send SMS or Email. Do I have to use intent for this (which calls OS native service) or I can send SMs/Email/MMS/etc. from within the app? Is it possible to do this without opening OS native services/tools screen?
All material I found explain these tasks by using intents. I was wondering if I really have to rely on intents.
PS. I know that they are recommended way of dealing with things, but not mandatory. When I develop bar-code-scanning app, a client will not allow using external app (called via intent), but he'd like to do it all within the app. So why shouldn't I do the same with sms/email/mms/etc.?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于短信或电子邮件,您当然可以调用允许您发送消息的本机方法。这些意图只是另一种选择 - 如果您不想自己创建短信/电子邮件发送者活动。
发送短信:
另请检查此 用于在后台发送电子邮件。
For SMS or Email you can of course invoke native methods that allow you send messages. These intents are just another option - if you don't want to create the sms/email sender activity yourself.
Sending sms:
Also check this out for sending email in the background.