Why RingyDingyDingy Can’t Support Gmail

The two biggest feature requests for RingyDingyDingy pre-0.5 were Gmail and Google Voice integration. My goal was to implement them both for RDD 0.5… but, unfortunately, I could only implement Google Voice integration. It seems like this is going to be a long-term/permanent problem, as well, because Google intentionally caused this. Read on for why RDD can’t support Gmail.

Hopefully, if you have an Android phone, you’ve seen permissions in action before. Android uses them to tell you what an app can do (and nothing else). This system is great; it lets you easily tell if a random game you downloaded wants to read your contacts for some reason (hint: it’s probably bad) The Gmail app for Android uses permissions to control which apps can read or write emails through Gmail. This is excellent, as I don’t want some random app reading all my email. However, if I trusted an app with access to my email, apps could access your inbox through the READ_GMAIL permission. (It was shown as “Your messages > read Gmail” in an app’s permission list.)

All was well in the Android world, as apps could freely use Gmail. Then, Google pushed an update to Gmail, which made READ_GMAIL only available to other Google apps. (For developers, the attribute android:protectionLevel="signature" was set in the manifest on the permission, and the ContentProvider requires the permission.) This caused half of the apps that used Gmail to outright crash (force close), and the other half to just fail. Google said that the apps that just failed were “designed properly”, because they do checks to make sure they have clearance to do what they want to do. In my opinion, while I believe that apps should gracefully degrade (some custom ROMs let you enable/disable individual apps, but stock Android makes you either install the app and accept all permissions, or don’t install it and accept none), no one actually does, including Google’s own examples.

As of now, there is no alternative or workaround to the problem. The absolute best an app can do is get notified when there is email, and how many unread messages there are. No more information can be obtained, such as the sender, subject, or body. Since there is no useful information to extract, RDD cannot support Gmail in its present state. There is a seriously hackish workaround for those that are desperate, however. You can pull the account username and password (which requires a few permissions of its own, including a few nasty ones that I wouldn’t give to any app I don’t absolutely trust) and use Gmail’s IMAP servers directly, just like the mail client you use on your computer (if you use one) does and monitor it independently from the Gmail app. Aside from all the extra effort (and permissions) this would require, there are two things that prevent me from doing so in RDD.

First, a big goal of mine is to avoid, at all costs, the INTERNET permission. Part of this is based on my own process for deciding if I’m going to install an app or not. If an app requests the INTERNET permission, the first thing I do is ask “Why does this app need Internet access?” and RingyDingyDingy somewhat fails that test. I’d be willing to give an app that I can trigger remotely INTERNET access, but it’s the next step in my process that RDD would get dropped. I look extra carefully at all of the permissions, and evaluate if I want that exposed to the Internet. RDD has four permissions right now: reading text messages (used to know when to ring or lock), the counterpart for Google Voice, sending text messages (used to respond to text messages giving confirmation or a reason why the command wasn’t completed), and reading contacts (used to look up someone’s name when a remote ring is triggered). An app that has those four permissions as well as INTERNET gets dropped immediately unless I completely trust the author.

Second, this would massively inflate the size of RDD. Because there’s built-in apps for e-mail, there is no IMAP/POP3 library in Android. All of the code to access Gmail’s servers would either need to be written by hand (a huge pain), or to be pulled from a library (most of which are huge). Right now, RDD manages to squeeze by in less than 64k, which it should. Pulling an IMAP library would make it in the megabyte range, so that won’t be happening unless absolutely critical.

Because Google Voice lets apps read incoming text messages (which it should, especially considering Android lets you do the same with plain text messages), there is now a working solution for triggering RDD on devices that aren’t a cellphone. Unless Gmail lets other apps access the mailbox, Gmail integration will not be coming to RDD.

Google’s own support forum is filled with developers having the same problem in this thread [google.com].

Leave a Reply

Your email address will not be published. Required fields are marked *

Unable to load the Are You a Human PlayThru™. Please contact the site owner to report the problem.