Profile

Cover photo
Jake Wharton
Works at Square, Inc.
Lives in San Francisco, CA
20,768 followers|5,417,302 views
AboutPostsPhotosVideos+1's

Stream

Jake Wharton

Shared publicly  - 
29
2
Dandre Allison's profile photo
 
I'm at my friend's with that game and the Warriors on
Add a comment...

Jake Wharton

Shared publicly  - 
 
The video from my "Simple HTTP with Retrofit 2" talk at Droidcon NYC is now available.

The slides are available separately here: https://speakerdeck.com/jakewharton/simple-http-with-retrofit-2-droidcon-nyc-2015

Some of the APIs around implementing Converters and CallAdapters (the very end of the talk) has already changed on master and a beta2 should be released in a week or two which fixes some bugs found by early users.

#AndroidDev
227
82
Roman Ismagilov's profile photoCehasli de Castro's profile photoRaju SE's profile photoWouter de Vos's profile photo
6 comments
 
Thanks for this talk. I'm very excited for Retrofit 2. I have a single endpoint and I have grouped api calls into different interfaces. Is it recommended to create a singleton Retrofit object that can be used to create each separate api service or can we build the Retrofit objects as needed?
Add a comment...

Jake Wharton

Shared publicly  - 
 
Recently, +Pierre-Yves Ricau and I gave tech talks at our "Streamlining Android Apps" event in Square's San Francisco office. These talks were recorded and are now available on Square Engineering's YouTube channel. Enjoy!

Eliminating Code Overhead (Jake Wharton)
https://www.youtube.com/watch?v=b6zKBZcg5fk

The CPU, RAM, and disk are finite resources that are often taken for granted as unbounded. Not only is this obviously untrue, but the use of these resources directly affects the most important resource on a mobile device: the battery. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in general without overhead.

LeakCanary (Pierre-Yves Ricau)
https://www.youtube.com/watch?v=D_hjK-tEHoQ

In just a few few weeks, we reduced by 94% the OutOfMemoryError crashes in the Square Register Android app. We built squ.re/leakcanary to automatically detect memory leaks and make it very easy to fix them. This talk will cover the principles as well as the underlying implementation details. We'll dig into a few interesting examples and lessons learned.

#AndroidDev
215
86
Jelly Chen's profile photoSachin Rajput's profile photoDaniel Tarlow's profile photoSait Sami Kocataş's profile photo
15 comments
 
great presentation, thanks for that.
will the part you mentioned at the end will be another presentation? I am sure it would help to many developer.
Add a comment...

Jake Wharton

Shared publicly  - 
 
I have posted slides from my talk "Eliminating Code Overhead" which I gave yesterday at Square.

By themselves, these slides are sparse on any explanation or reasoning for what's on them. The event was recorded and a video of me blabbering over them will be made available later.

The CPU, RAM, and disk are finite resources that are often taken for granted as unbounded. Not only is this obviously untrue, but the use of these resources directly affects the most important resource on a mobile device: the battery. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in general without overhead.

#AndroidDev
The CPU, RAM, and disk are finite resources that are often taken for granted as unbounded. Not only is this obviously untrue, but the use of these resources directly affects the most important resource on a mobile device: the battery. This talk will focus on techniques that both libraries and applications can implement to ensure their effect is in general without overhead. Video: Coming soon!
242
134
Marty Glaubitz's profile photoLe Hoang Tu's profile photoChristopher Jenkins's profile photoLindelwe Ncube's profile photo
26 comments
 
Still have no idea when the video will arrive?
Add a comment...

Jake Wharton

Shared publicly  - 
 
I did a thing: part 2! Thanks to +Donn Felker and +Kaushik Gopal for having me.

Please comment on the original.
 
Episode #7 - the final part of our two-part segment with +Jake Wharton  is out! +Donn Felker  and I chat with him on Testing, RxJava, NotRxAndroid, SQLBrite and more: http://fragmentedpodcast.com/episodes/7 #androiddev
8 comments on original post
129
28

Jake Wharton

Shared publicly  - 
 
Please comment on the original.
 
The Droidcon Montréal keynote by +Jake Wharton  and +Jesse Wilson  is now available on  youtube! Go check it out!
1 comment on original post
95
21
Have them in circles
20,768 people
杨超's profile photo
Jing Zhang's profile photo
TechDissected's profile photo
Craig Walker's profile photo
Zachary Pinter's profile photo
Seymour Bruce's profile photo
Petr Šimek's profile photo
Xh Ding's profile photo
Zhang Lijun's profile photo

Jake Wharton

Shared publicly  - 
 
Java Interoperability Policy for Major Version Updates

Major version updates to libraries solve the API warts of old and bring shiny new APIs to address previous shortcomings—often in a breaking fashion. Updating an Android or Java app is usually a day or two affair before you reap the benefits. Problems arise, however, when other libraries you depend on have transitive dependencies on older versions of the updated library.

+Jesse Wilson offers candid insights from user perspective as well: https://publicobject.com/2015/12/12/com-squareup-okhttp3/

Ultimately, we fight for the user!
New major versions of libraries usually bring with it breaking changes in the form of big improvements. This is great for new users, but a hassle for existing clients. This is a new policy to make things suitable for both parties.
49
12
Raju SE's profile photoDevki Patel's profile photoandi ferdi's profile photo
3 comments
 
hello.. i am newbe in java.. can you talk to me about JDK ?? JVM ? and JRE ?? sorry my english is poor...
Add a comment...

Jake Wharton

Shared publicly  - 
 
 
Surprise! Extra #AndroidDialogs this week. +Huyen Tue Dao talks with +Jake Wharton on RxJava, RxAndroid, writing libraries & optimization.

As always, subscription and sharing appreciated :)
View original post
158
41
Jake Wharton's profile photoLinkang Ma's profile photoDonnie Sky's profile photofree sue's profile photo
5 comments
 
big
Add a comment...

Jake Wharton

Shared publicly  - 
 
I have uploaded my slides from "Simple HTTP with Retrofit 2" from Droidcon NYC. The video will follow in a few weeks.

To coincide with the talk, I have also released Retrofit 2.0.0-beta1! While it's not done, it's very usable.

#AndroidDev
Retrofit has been simplifying HTTP calls for years and this new version is no different. In addition to fixing some long-standing annoyances, there are a handful of new features which make it more powerful than ever. This talk will focus on how the new APIs in Retrofit aid in making HTTP calls as simple as possible for your app. The integration with OkHttp and Okio APIs will be covered to ensure a full understanding of the HTTP stack. Common u...
258
103
Karl Heimann's profile photoJake Wharton's profile photoJeremy Kane's profile photoDmitry Suzdalev's profile photo
11 comments
 
+Jake Wharton I am curious how do you keep your libraries simple and focused (including when redesigning some stuff)? Do you keep a list of some common use cases and when trying to come up with a draft of an API you verify that all those use cases are achievable? Or does this happen more like you let the library design itself (by building on some starting API-design foundation)? Retrofit is great example of design, because I started learning it with a very simple scenario which then suddenly changed a few times taking unpredictable twists - and for all of them Retrofit (1.x) not only had something I could do to implement the new requirement, but it also looked quite logical and fitting into place in the end :)
Add a comment...

Jake Wharton

Shared publicly  - 
 
In this video, +Colt McAnlis​​ gives a refreshingly candid take on the enum "problem". Almost everything about this video is fantastic. Almost. Watch it before reading more, because it does a great job of outlining the pros and cons of enum usage: https://youtu.be/Hzs6OBcvNQE

Ok. So what's wrong here?

In the middle of the video an absolutely ridiculous and sensational number is dropped whose sole purpose is to create a shock-statistic which leads to an incorrect perception of an enum's effect: 2556 bytes.

What app, in the entire history of apps written for Android, has ever had a dex size of 2556 bytes? Zero. Not one. Ever.

The video goes on to show that adding an enum bloats this fictitious app to a whopping 4188 bytes. Why that's basically 2x. I added a single enum and my app doubled in size!

Open Android Studio, go to File > New Project, select a minSdk of 16, select a 'Blank Activity' template, and click Finish. On a clean compile, how large is the dex file of this completely empty app? Two million, five-hundred and sixteen thousand, five-hundred and eighty-two bytes. That's 2,512,582 bytes. 1000x times larger than the "base" example used in the video.

Of course, this size stems from the default dependency of the extremely-useful AppCompat which in turn depends on the also useful fat cow support-v4. If you remove these two dependencies, what does our dex size become? The answer may surprise you: who cares? It's an empty app.

Even if this library-free app perfectly matches up to 2556 bytes as mentioned in the video then adding an enum is completely justified as it would be the only thing in the app.

Whatever random SHA of Square Cash I have sitting on my machine currently clocks in at 6.4MB of dex. How much of that is from enums? Maybe it's 0.01MB. Or maybe it's 0.001MB.

Like I said, this video presents the pros and cons of using enums accurately and does show the relative size difference which is what is important. It is a good video. But, the overall dex size comparison is needless and serves only to mislead you to believe the impact is greater than it really is which just destroys all that credibility it built.

As a library developer, I recognize these small optimizations that should be done as we want to have as little impact on the consuming app's size, memory, and performance as possible. But it's important to realize that throwing away an Iterator allocation vs. an indexed loop, using a HashMap vs. a binary-searched collection like SparseArray, and putting an enum in your public API vs. integer values where appropriate is perfectly fine. Knowing the difference to make informed decisions is what's important and the video nearly nails that except for this one stupid stat.
223
56
Pavlos-Petros Tournaris's profile photoSaad Farooq's profile photo
55 comments
 
Great points brought up all around. To +Jake Wharton's  point, while watching the video, I thought +Colt McAnlis was talking about some super secret portion of the app that's loaded into the system's main memory and the rest of the app is in RAM or something. And I think that was mainly because of that number chosen for size. Consequently, I totally bought the enum argument. I might have realized on my own at some point that I was mistaken but that video definitely started me off wrong.
And to +Colt McAnlis's point about 'premature optimization', I feel like it's one of the those overused buzz words. Every pattern we use in our apps was a premature optimization at some point. Premature optimizations are only those you can't include in your workflow, the rest are patterns. Otherwise, we shouldn't be using ViewHolders with our ListViews. Why optimize for recycling until you know that's a problem for your app ?
Add a comment...

Jake Wharton

Shared publicly  - 
 
The video from my talk "A Few 'Ok' Libraries" from +droidcon Montreal is now available for viewing. This covers the behavior of Okio and how the OkHttp, Moshi, and Retrofit libraries interact with it to move and parse data efficiently.

#AndroidDev
156
66
Mike Wallace (MikeWallaceDev)'s profile photoNeal Sanche's profile photoNevin Chen's profile photoLars Vogel's profile photo
4 comments
 
Very interesting, thanks for expanding my point of view onto the details of InputStream.
Add a comment...

Jake Wharton

Shared publicly  - 
 
I did a thing! And this is part 1.

Please comment on the original.
 
Episode #6 of the Fragmented Podcast is out  +Donn Felker  &  I talk to the amazing +Jake Wharton  about open source and much more. http://fragmentedpodcast.com/episodes/6/ #androiddev  
“Episode 6 is now available! @donnfelker & @kaushikgopal talk to @JakeWharton about open source and much more. http://t.co/ggGShsxgMl”
6 comments on original post
141
21
People
Have them in circles
20,768 people
杨超's profile photo
Jing Zhang's profile photo
TechDissected's profile photo
Craig Walker's profile photo
Zachary Pinter's profile photo
Seymour Bruce's profile photo
Petr Šimek's profile photo
Xh Ding's profile photo
Zhang Lijun's profile photo
Work
Employment
  • Square, Inc.
    Android Engineer, 2012 - present
  • Champion International Moving, Ltd.
    Java Developer, 2009 - 2012
Story
Tagline
Craft brewer of Java and Android bytecode at Square.
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
San Francisco, CA
Previously
Pittsburgh, PA
Jake Wharton's +1's are the things they like, agree with, or want to recommend.
Quick Lumos!
market.android.com

A lock screen widget which gives you light as fast as possible!Touch it to turn on the camera flash. Touch it again to switch it off.Magical

Monument Valley
market.android.com

En Monument Valley, debes manipular arquitecturas imposibles y guiar a una princesa silenciosa por un mundo de belleza incomparable.Monument

Multipath TCP - ACM Queue
queue.acm.org

Multipath TCP. Decoupled from IP, TCP is at last able to support multihomed hosts. Christoph Paasch and Olivier Bonaventure, UCL. The Intern

Don't Tap The White Tile
market.android.com

So many new features here, check it out!!! We will keep improving our game, more features are coming soon. Any advice and suggestions will b

Square Cash
market.android.com

Send money to anyone with an email address. It's fast, safe, and free!No account needed. Just securely link your debit card to start sending

Square OctoCash
chrome.google.com

Sponsor a beer to your oss devs.

Ball Maze Lite
market.android.com

Ball Maze is a fun and addicting puzzle game. You have to get the ball on a target field by rolling it through one of the 200 challenging le

Giganticon - Big Icons
market.android.com

Do you crave bigger icons on your home screen? Are your icons too small to see or touch? Giganticon allows you to have big huge gigantic gia

Beautiful Widgets
market.android.com

Beautiful set of widgets including clock+weather, with some toggles Beautiful set of Widgets containing clock widget, clock and weather widg

Google+
market.android.com

Real-life sharing rethought for the web, wherever you are. Google+ for mobile makes sharing the right things with the right people a lot sim

FriendCaster for Facebook
market.android.com

FriendCaster for Facebook - the best Facebook experience on Android devices! FriendCaster for Facebook gives you the best Facebook experienc

Google Voice
market.android.com

Make cheap international calls with your Google number. Send free text messages. Place calls and send text messages showing your Google numb

Do It (Tomorrow)
chrome.google.com

The todo App for procrastinators ;)

Foursquare
market.android.com

foursquare helps you and your friends make the most of where you are. Heading out? foursquare helps you and your friends make the most of wh

Google I/O 2012
market.android.com

The official Google I/O 2012 conference app. The official Google I/O 2012 conference companion app. Supports devices running Android 2.2+, a

Chrome Beta
market.android.com

Welcome to Chrome Beta for Android!- Preview the latest features: Try out the newest features. (Sometimes these may be a little rough around

Chrome Beta - Apps on Android Market
market.android.com

The speed and simplicity of Chrome, now on your Android phone and tablet. Browse fast on your Android smartphone or tablet, and bring your p

Glitch Skills
market.android.com

Learn your Glitch skills on the go! Keep learning until the cows come home. Hey, have you ever thought to yourself: 'Self, wouldn't it be ni

Self Serve for Koodo beta*
market.android.com

View your Koodo Mobile bill and usage securely anytime,anywhere. View your online bill, quota usage and other account information securely i

SeriesGuide
plus.google.com

Android app to manage (re)watching your TV shows