Friday, September 16, 2016

TransactionTooLargeException crashes on Nougat

I was testing my app on Android Nougat, and it crashed when I try to move from one Activity to another. I saw this in the log: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 700848 bytes.

Actually, the platform has been printing warning log about this for a while, but let's be honest, who has time to read all the logs? Nougat (API 24) throws TransactionTooLargeExceptions as RuntimeExceptions, so we cannot ignore that any more.


Turns out I was saving a big list of search results during onSaveInstanceState to persist them over rotation. Time to move that to a Loader!

But what is the limit?

But now I'm curious: What is the limit? I wrote a sample app to find out.

public class MainActivity extends Activity {
  protected void onCreate(Bundle savedInstanceState) {

    Intent intent = new Intent(this, AnotherActivity.class);

  protected void onSaveInstanceState(Bundle outState) {

    int length = 1000;
    Uri uri = getIntent().getData();
    if (uri != null) {
      try {
        length = Integer.parseInt(uri.getLastPathSegment());
      } catch (NumberFormatException e) {

    byte[] data = new byte[length];
    outState.putByteArray("data", data);

To try different sizes, I start the app like this:

adb shell am start \
  -a android.intent.action.View \
  -n com.sqisland.tutorial.transcation_too_large/.MainActivity \
  -d 700000

This launches MainActivity, which immediately goes to AnotherActivity. When that happens, the system calls onSaveInstanceState, which tries to stash away a byte array of the length specified in the adb command, retrieved by getIntent().getData(). This way, I can try different numbers without recompiling and redeploying the app.

I did a binary search on a Nougat emulator and my Nexus 9. The limit is slightly different, but it hovers around 500000. That is not a small number, but not too hard to exceed if you try to store data rather than state.

Thursday, August 25, 2016

Speaking profile

Your speaking profile showcases your speaking experience. Conference organizers can see where you have spoken at, look at the slides, and watch videos of your talk.

Make one now, even if you are just getting started. You can list the topics you would like to speak about, and then add your talks as you schedule and give them.

Here are 3 places you can host your speaking profile.

Blog page

Most blogging platforms e.g. wordpress, blogger allows you to add pages independent of the blog posts. You can add a speaking page there.

Example: Annyce Davis.

GitHub pages

If you don't have a blog, you can use GitHub pages to host your speaking page.

Example: Margaret Maynard-Reid.


If you don't want to deal with formatting your page, you can create a profile on You will need to find the conference you are speaking at (create it if there is no entry), add a session, and mark yourself as the speaker. It is a bit of a hassle to enter all that structured data, but you get cool stats.

Example: Estelle Weyl.

Further reading

Even more examples:

Watch my How to Write a Conference Proposal talk where I mentioned how to use speaking profiles to discover conferences.

Friday, August 12, 2016

360|AnDev: Money

360|AnDev is the first time I run a conference. I was raised to be frugal, never spending money that I don't have, but putting on a conference requires exactly that. We have to book the venue, order badges, buy plane tickets for speakers etc, all without knowing if any one will actually buy tickets to the conference. It was nerve-racking.

50 Shades of No

Our first source of income is sponsorship. As a first year conference, we have no track record to show, and it has been difficult to attract sponsors.

We were so grateful that POSSIBLE Mobile and Tack mobile jumped in as sponsors the moment we announced. But after that, we had a long period of nothing. I was cold emailing a lot of companies, getting various versions of no.

  • The classic: No reply.
  • The cliff: Initial interest, but no follow up.
  • The black hole: Ask me to submit to a ticketing system.
  • The clash: "We are already sponsoring a conference in the same city in the same month."
  • The budgeteer: "We have no more budget for this year / month."
  • The freeloader: "We would rather get presence for free through the CFP." (Okay they didn't say that, but that's what happened)

Surprising Yes Stories

I was quite discouraged, to be honest. Fortunately my co-organizer John has put on many conferences before, and knows that everyone procrastinates until the last moment. So I should not give up hope.

And indeed, we got an influx of sponsors in the last month. Some of which are the same people that we have been pinging, and the reminder of "Hey, conference is really soon" kicked them into action.

One sponsor approached us out of nowhere, pretty late. When I talked to them at the conference, they told me that one of their employees saw me at Write/Speak/Code the month before, and the company decided that really want to be a part of our community-focused conference. Wow, I had no idea!

Another sponsor came from counter-solicitation. From time to time I get recruiter emails, and I have been replying with, "No, I don't need a job, but please sponsor my conference to reach out to other Android developers." Most of the time I get "Oh I am just a recruiter I can't make decisions like that", but one company actually followed through and became our sponsor!

I was genuinely surprised. This really reinforces my belief that you should always ask for what you want. You need to give people a chance to say yes!


Same as sponsors, attendees are major slackers. I had this exchange with so many of my friends:

Friend: I'm so excited about 360|AnDev!
Me: Yay! You bought your ticket already, right?
Friend: hmm... no.

John told me that they always procrastinate, no matter what you do. I was sitting at the edge of my seat until the day of the conference, not knowing if we were going to break even.

I was promoting the conference as hard as I could, but there was still a lot of people who did not hear about the conference, or did not know until it was too late to arrange travel. Perhaps I have been promoting it within my echo chamber? How can I reach out?


The conference has come and gone, and yes, we broke even. I went into this knowing that I am not running a conference for the money, but still, the uncertainty was no fun.

Will I run 360|AnDev again next year? Right now I am leaning towards yes. I was so happy to see so many people connecting with each other and lifting each other up. With a stellar first edition, I hope next year it will be easier to get sponsors and sell tickets.

Do you want to be a part of 360|AnDev next year? Sign up to stay in the know!

Saturday, August 6, 2016

360|AnDev: CFP process

One of the reasons why I decided to run 360|AnDev is that I want a inclusive place for Android developers to learn from each other. Inclusivity has many dimensions: identities, financial status, level of experience, to name a few. We want everyone to feel welcome, and we know that the speakers will set a tone for the whole conference, so we were very careful in our CFP process.

Core track

I know from experience that conferences are great to forge connections that help you in your career, but a lot of beginners fear that they do not have enough background to participate. To address that, we dedicated one room one day to cover fundamental topics, to let beginners know that there is something for them.

The rest of the conference has more advanced topics so that we take of experienced developers as well.

Clear, specific guideline

When I reach out and ask people to speak, they often ask, why would anyone listen to me, and what would I talk about? We address those two questions specifically on the Call For Papers page.

Contrary to popular belief, you do not need to be an expert to teach. In fact, for fundamental classes it is often best to hear from someone who has just learned it. They know the pain points, and highlight details which may seem obvious to experts.

After that, we offer some topics to get people started. It is not an exhaustive list, but it gives a flavor of what we are looking for, which is much more useful than, "Everything is good, just submit!"

Cover travel cost

We want everyone to be able to come and speak, regardless of their financial situation. It costs quite a bit extra to cover 2 nights of hotel plus flight for each speaker, but we care about inclusivity enough to do so. This way, people don't shy away from submitting because they are between jobs, they work for themselves, their companies have murky policies about conference reimbursements etc.

Q&A hangout

Even with a detailed CFP page, we know we cannot anticipate all the questions. We hosted a Q&A hangout for potential speakers to chat with us directly. Yes, we answered questions, but the most powerful part about the hangout is to put a human face behind the conference, to have a chance to tell everyone that, yes, we want you. We have a few talks that resulted directly from the hangout.

Anonymous voting

With all that effort, we hope to have a variety of talk proposals from speakers with different background. Next step is to make sure that the selection process preserves that, rather than just pick out the famous people.

Our talk selection has two rounds. In the first round, we removed all personally identifiable information from titles and abstracts, and send them out to members of the Android community for voting. Here is the voting guideline:

  • 5: OMG I'll drop everything to see this talk (Please do not give this score to more than 20 talks).
  • 4: I'd like to see this talk.
  • 3: Neutral. I'll probably see this talk, but skip if there is another talk at the same time.
  • 2: I'd rather be in the hallway than see this talk.
  • 1: Offensive/Too commercial/Inappropriate.
  • 0: Abstain.

In the second round, Dave and I look at proposals from each track, from the highest-scoring one down. For the most part we just take the ones ranked highest by the voters, but sometimes there are multiple proposals on the same topic, and their scores are too close to use as a differentiator.

In that case, we compare the titles and abstracts to see what will be covered. We also look into the speaker to try to get a sense of how well the material will be delivered. This is why this round is no longer anonymous.

Final program

While there are still many ways to improve, we are very proud of what we managed to achieve for the first year of our conference. Here is our final speaker roster:

Friday, July 1, 2016

One year of sketchnoting

I made my first sketchnote at Write/Speak/Code 2015 on the impostor syndrome talk by Neha Batra.

I started with a single black pen, added a gray marker as I experimented with shading.

My friend saw the little gray hearts and suggested that I get the primary colors, which was perfect since I was about to attend Google I/O.

The overwhelmingly positive reaction I got for my sketchnotes gave me the confidence to try drawing as well, which, mind you, I grew up believing that I cannot draw. It was a pleasant surprise to discover the joy of copying and coloring.

When I first wrote about sketchnoting, I said there is no way I can draw portraits. Guess what, I do that now!

At Write/Speak/Code 2016 I sketchnoted for Neha again, and it is really fun to see how much I have progressed in a year.

You can do it too

I have seen many other engineers start sketchnoting since I posted my first sketchnote last year, and it was been absolutely delightful. Wanna get started? Here are some resources:

Saturday, June 25, 2016

Write/Speak/Code: 10x Myself

I am very active in the Android community, blogging and speaking and sharing code, but I can only do so much as one person. To scale my efforts, I mentor others to do the same, which aligns with the goals of Write/Speak/Code exactly.

During Write day last year I shared my conference report blogging formula, I have seen it being adopted widely. Some examples:

For speaking, last year I met fellow Android developers Yash Prabhu and Danielle Vass at Write/Speak/Code, and I am delighted to see them start their speaking careers shortly afterwards.

This year, I was on the writing panel again, and also moderated the conference organizers panel. I hope to inspire many more women to go forth and share their knowledge. Storify:

Besides mentoring, I took the opportunity of being surrounded by amazing women to level up my own career as well. One of my 2016 speaking goals is to give a keynote, and during Write/Speak/Code I brainstormed and refined a topic that I am super excited about: The State of Android Testing.

I'd love to hear your Write/Speak/Code story. Did you get started on writing, speaking or open source because of it? Let me know!

The State of Android Testing

We all know testing is good for you, but it is very overwhelming. What is a unit test? What is an instrumentation test? Espresso, Robolectric, Mockito… what do all these libraries do? More fundamentally, why should I test?

I'd like to give a keynote talk to answer all these questions. Do you know a conference that would be interested? Perhaps Droidcon NYC?