Adam Bandel


InstaNote

Nov 2026
Type: android
Code: 0k lines
Files: 31
Stack:
KotlinAndroid SDKJetpack ComposeGmail APIGoogle Sign-In
Tags:
mobileproductivityandroid

Overview

InstaNote is an Android app for getting a note down fast. A slim home screen widget opens a text box with the keyboard already up, and one more tap sends the note to your own Gmail inbox. Other apps can share to it as well, so a link, a photo or any other file goes straight to your email without opening a screen.

It signs in with Google and sends through the Gmail API, attachments included, to your own address, so the inbox is where the notes end up.

Screenshots

Notes List

Note Entry

Home Screen Widget

Problem

A normal notes app takes several steps before you can type: unlock the phone, find the app, wait for it to load, tap new note. A passing thought is often gone by then.

Quick notes also often need to end up somewhere more permanent, like an email inbox, where they get dealt with alongside everything else. The standard Android share flow adds steps of its own when all you want is to email yourself.

Approach

Two things keep capture short: the widget opens straight into note entry, and the app sends the email itself instead of handing off to a mail app.

Stack

Challenges

Outcomes

Fast note entry was what I wanted from this, and that’s what it gives me. I use it every day to send myself notes.

Building it meant working out the Gmail API sign-in flow on Android with GoogleAccountCredential, MIME message construction with javax.mail, a RecyclerView with its own delete confirmation, and an app widget that launches an activity through a PendingIntent.

Implementation Notes

Email with Attachments

The core email sending logic handles both plain text and multipart messages:

private fun createEmailWithAttachments(
    to: String, from: String, subject: String,
    uris: List<Uri>, bodyText: String
): MimeMessage {
    val email = MimeMessage(session)
    email.setFrom(InternetAddress(from))
    email.addRecipient(Message.RecipientType.TO, InternetAddress(to))
    email.subject = subject

    val multipart = MimeMultipart()

    // Text body
    val textPart = MimeBodyPart()
    textPart.setText(bodyText)
    multipart.addBodyPart(textPart)

    // Attachments
    for (uri in uris) {
        val attachmentPart = MimeBodyPart()
        val inputStream = contentResolver.openInputStream(uri)
        val dataSource = ByteArrayDataSource(inputStream, contentResolver.getType(uri))
        attachmentPart.dataHandler = DataHandler(dataSource)
        attachmentPart.fileName = getFileName(uri)
        multipart.addBodyPart(attachmentPart)
    }

    email.setContent(multipart)
    return email
}

Delete Confirmation Pattern

The adapter implements a timed confirmation without dialogs:

holder.binding.deleteButton.setOnClickListener {
    if (isPendingDeletion) {
        onDelete(adapterPos)
        pendingDeletionPosition = null
    } else {
        pendingDeletionPosition = adapterPos
        notifyDataSetChanged()

        handler.postDelayed({
            if (pendingDeletionPosition == adapterPos) {
                pendingDeletionPosition = null
                notifyDataSetChanged()
            }
        }, 2000)
    }
}

Project Structure

InstaNote/
├── app/src/main/
│   ├── java/com/instanote/
│   │   ├── MainActivity.kt        # Note list management
│   │   ├── NoteEntryActivity.kt   # Note creation/editing + Gmail
│   │   ├── NoteAdapter.kt         # RecyclerView with delete confirm
│   │   ├── SettingsActivity.kt    # Google auth management
│   │   └── NoteWidgetProvider.kt  # Home screen widget
│   └── res/
│       ├── layout/                # 5 layout files
│       └── xml/note_widget_info.xml
└── build.gradle.kts               # Dependencies + SDK config

Related Posts