Extending Android's Default Gmail/Email Applic

2020-07-17 16:11发布

I would like to extend the Android platform's default Gmail/Email applications either by plugging into their ContentProvider or by using intent filters. Essentially, I want to be able to scan incoming emails for special rules that will trigger events in my Android application. If scanning emails automatically isn't possible, then I would at least like to add a menu item to the email viewer screen that would allow the user to flag the email content as needing to be scanned.

  1. Does the Gmail/Email applications allow you to extend them in this way?
  2. For future reference, besides finding sample code or reading documentation provided by the author of an application, is there a standard way of finding out what intents are available for my application to use? Like a tool maybe?

Thanks, Marc

1条回答
家丑人穷心不美
2楼-- · 2020-07-17 16:28

Does the Gmail/Email applications allow you to extend them in this way?

Gmail is closed source, and so it is difficult to know what it does or does not support.

The Email application is not part of the public SDK, so trying to rely upon any ContentProvider it may have (and I don't know that it has one) would be a mistake, as your application is liable to break with subsequent Android updates.

I would at least like to add a menu item to the email viewer screen that would allow the user to flag the email content as needing to be scanned.

The only way to do that assumes Gmail/Email uses Menu#addIntentOptions(), and via Google Code Search, this does not appear to be the case.

You might consider contacting the developers of K9 to see if you could hook into their Android email application.

is there a standard way of finding out what intents are available for my application to use? Like a tool maybe?

Not really. Intent actions are just strings.

查看更多
登录 后发表回答