SlideShare a Scribd company logo
K-9 Mail for
 Android
         Jesse Vincent
      jesse@fsck.com
Hi!
I'm Jesse
I'm a Perl
  Hacker
Also, I like to
break things
What is “K-9”?
K-9 Mail for Android
What is “K-9”?
Email client
For Android
Why “K-9”?
My favorite mail
     client
mutt
K-9 Mail for Android
K-9
K-9 Mail for Android
+   =
Didn't it come
 with a mail
   client?
No Search
No “stars”
No Self-Signed
  Certificate
   Support
No BCC-Self
No IMAP IDLE
No multi-select
No keybindings
No IMAP
Deletes
I almost
returned my
 new phone
It's Open
 Source
I could fix it
“How hard
could it be?”
It's all Java
..the last time I
  used Java...
I used Mosaic
Applets
were new
Internet
 Explorer 1.0
was brand new
K-9 Mail for Android
Java is
supposed to be
  “easy” for
   newbies
How hard
could it be?
So I got
the code
git clone git://android.git.kernel.org/platform/packages/apps/Email.git
Only one
change
REALLY
mattered
Delete from
IMAP Servers
--- a/src/com/android/email/MessagingController.java
+++ b/src/com/android/email/MessagingController.java
                                                    h
@@ -455,13 +458,28 @@ public class MessagingController implements Runnable {
            for (Message message : remoteMessages) {
                Message localMessage = localUidMap.get(message.getUid());
                if (localMessage == null ||
                      (!localMessage.isSet(Flag.X_DOWNLOADED_FULL) &&
+                     !localMessage.isSet(Flag.DELETED) &&
                      !localMessage.isSet(Flag.X_DOWNLOADED_PARTIAL))) {
                    unsyncedMessages.add(message);
                }
            }
       }


+       for (Message message : localMessages) {
+           Message remoteMessage = remoteUidMap.get(message.getUid());
+           // skip things deleted on the server side
+           if (remoteMessage != null && message.isSet(Flag.DELETED)) {
+               remoteMessage.setFlag(Flag.DELETED, true);
+           }
+       }
8 loc
I'm done!
Building K-9
(First time)
No Makefile
It's Java
No build.xml
“Just build the
  whole OS”
No
10 Hours
Worked great in
  emulator
...but not on a
   real phone
For “security”
What now?
Submit the
change to
 Android?
I tried
They hadn't yet
 figured out the
whole community
      thing
(It's gotten
   better)
I like to share
How to share?
Fork!
Fork the OS?!?!
What did it take
   to fork?
Google Code
  Project
K-9 Mail for Android
What's next?
Android
Developer
 Account
K-9 Mail for Android
Pay $20 to
 become an
Android Market
  Publisher
Submit a web
   form
Wait <10s
Profit!
Oh, wait
(It's free)
Jesse,


[...]


Please inform Motorola tech of this as they have recommended
your program but disavow any knowledge of how to fix it, as you
are 3rd party. They did though, suggest I contact godaddy, and
they did give me your email, so they weren't completely useless.


ALSO, IT WOULD BE HELPFUL IF YOU SOMEHOW HAD A
PHONE NUMBER ON YOUR SITE, and an easier way to contact
your tech people.


M. A.
Writing
  end-user
software is...
  different
What did
Google think?
Some:
But why
couldn't you
  submit
 patches?
Most:
Awesome...
...So, there's
this feature I
    want...
K-9 Today
I have co-
conspirators!
Authors (by commit count)
●   505 jessev
●   256 danapple0
●   143 baolongnt
●   45 cketti
●   31 ismarc31
●   17 young.bradley
●   16 brock.tice
●    5 dumbfile
●    4 tibbetts
●    2 sparrowhawk
●    1 yostinso++
They write
 features
They fix bugs
They help users
They make K-9
  awesome
Over 150,000
 Downloads
1500 “Bug”
 Reports
App Ecosystem
K-9 Mail
Locale Plugin
K-9 Data Killer
Email Popup
K-9 features
Updated UI
K-9 Mail for Android
IMAP Push
Configurable
  polling
Multi-folder
  sync
“Stars”
K-9 Mail for Android
Multi-select
K-9 Mail for Android
Message
Previews
K-9 Mail for Android
BCC-Self
Signatures
Multiple
Identities
CRAM-MD5
  Auth
Self-Signed
SSL Certificates
K-9 Mail for Android
Keyboard
shortcuts
Full-text search
Lots more!
Getting started
hacking on K-9
Get the SDK
(It's free)
Linux, OSX or
   Windows
http://developer.android.com/sdk
Create an
 “AVD”
android create avd --name Fone --target android-
7
Start the
emulator
emulator -avd Fone
Checking out
 the code
svn co http://k9mail.googlecode.com/svn/k9mail/trunk/ k9
Create a
local.properties
       file
sdk.dir=/home/jesse/android-sdk-linux
Building K-9
ant debug
Getting K-9 to
 your device
adb install bin/K9-debug.apk
Send patches!
googlecode.com/k9mail
Time to get
 hacking!
Come hack on
K9 at Frog Cafe
   tomorrow!
Thanks!
Questions?
        Jesse Vincent
     jesse@fsck.com

More Related Content

K-9 Mail for Android