Profile

Cover photo
Matthias Käppler
Works at SoundCloud
Attended Technical University of Kaiserslautern
Lives in Berlin, Germany
2,412 followers|481,200 views
AboutPosts

Stream

Matthias Käppler

Shared publicly  - 
 
 
From monolith to microservices: The importance of Backends for Frontends (BFF) at SoundCloud: https://www.thoughtworks.com/insights/blog/bff-soundcloud #microservices #dev
Our friends at SoundCloud embarked on a journey a few years ago that changed their system and moved it from a monolithic Rails application towards an ecosystem of microservices.
View original post
5
Add a comment...

Matthias Käppler

Shared publicly  - 
 
In case you missed it: we published part 2 of our story combating Android's method limit. This one covers MultiDex and monitoring build health. Leave us feedback! 
In part one we described how running into Android's method limit may leave you unable to build, and offered strategies you can employ to make your app fit into a single DEX file. In this part we share an alternative option: using multiple DEX files.
16
11
Sebastiano Poggi's profile photoSudeep Jha's profile photo
Add a comment...

Matthias Käppler

Shared publicly  - 
 
 
New post on Android's method limit by +Matthias Käppler over at the SoundCloud developer blog.

#AndroidDev  
At SoundCloud we have been building for the Android platform since 2010. Much has changed since then: the team has grown, the list of features has grown, and our audience has grown. Today, eight engineers are working full time on the official SoundCloud app, across various areas, ...
View original post
2
2
Russell Wheeler's profile photoMarius Greve Hagen's profile photo
Add a comment...

Matthias Käppler

Shared publicly  - 
 
Matthias Käppler originally shared:
 
My verdict for unit testing on Android: it's 2015, and it's still somewhat broken.

Perhaps not as broken as it used to be, but still broken in some really fundamental ways.

We've been using Robolectric 1 for a very long time in the SoundCloud app and built up a substantial test suite (cloc counts about 73K lines of test code), but building something that mission critical on legacy software is of course a ticking time bomb.

After all the recent fuss about improvements in Android unit testing, I spent quite some time evaluating the different approaches to select the one that would offer us the greatest benefit with the least amount of friction (side note: it's 2015--why does unit testing require time to make it work? It should be as straight forward as drinking a cup of coffee.) I have to say I left disappointed; some things are broken by design, others are just broken. Brief summary:

Variation 1: Running unit tests on a connected device
The obvious benefit here is one of confidence: you are instrumenting your code against an actual system image, with the same VM that will actually run your code in production. It's the real deal. In the past, this approach wasn't exactly a great solution for numerous reasons (poor emulator performance, impossible to use mocking libraries, no JUnit 4 support to name the biggest ones.)
This has gotten better: we have a JUnit 4 runner now [0], we have DexMaker (a bytecode backend for Dalvik) [1], and we have Genymotion, but one of the major problems still exists: the platform JAR is full of final classes and methods, so you either have to write your tests to take that into account, or move your code as far away from the platform as possible; which is likely a good idea anyway [2], but induces the cost of introducing abstractions that might purely exist for testability.

Variation 2a: Running unit tests on the JVM (not using Robolectric)
With the arrival of "experimental unit testing support" (now not experimental anymore), we can now run tests from src/test/java using ordinary test runners. Since it's an ordinary Java unit test, you can use ordinary test setups and libraries, too. Rejoice! However, this approach still has several drawbacks.
Although a Gradle task has been introduced that strips the platform JAR of all finals and method bodies, as soon as your test subject is somehow entangled with the platform, like when using Intents or Bundles, your test will likely fail, since all these classes are stubbed out. Since Intent or Bundle are foundational platform types, they typically don't appear as collaborators in constructors, so you either have to come up with awkward indirections ("intent providers") or, again, move your code as far away from the platform as possible (again, see [2]) You will also likely end up wiring a lot of mocks in your tests, making your tests hard to read and understand (after all, that's one reason why Robolectric was initially created)
A final annoyance: why on Earth am I not able to see both unit tests and acceptance tests at the same time? Due to some idiosyncratic behavior in either AS or Gradle's Android plugin, only one Gradle source set containing tests can be active at once, as chosen by the "test artifact" setting in your build flavors. So unit tests are piggy backed on a system that it wasn't really built for, and it means that any refactorings you apply to one source set will not apply to the other source set, which is just asking for trouble. I hope this is only temporary and will get addressed with future versions of the AS (I assume it's a shortcoming of AS.)

Variation 2b: Running unit tests on the JVM (using Robolectric)
After we tried so hard to move away from Robolectric 1, we closed the circle by opting for... Robolectric 3. At SoundCloud we decided it was the most preferable solution of the three. It comes with all the benefits of running a normal JUnit test, but doesn't penalize you for writing tests for classes that use things like Bundles directly. Unfortunately (--or fortunately?), the higher you go up in the layers, the more difficult it is (still) to unit test something, which is probably a signal that even with a powerful tool like Robolectric, you should test code that is close to the UI sparingly (if at all), and focus on testing presentation /logic/, business rules, and anything beneath. For instance, Robolectric hasn't quite figured out timing yet, so things like animations steered by a presenter might fail. [3] Overall it's a huge step forward from the initial release though, and comes nicely modularized. By combining test rules and base classes for your tests, you can also keep much of the setup boiler plate out of your actual test cases, so that you don't couple yourself too much to any RL specifics.

[0] http://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html
[1] https://github.com/crittercism/dexmaker
[2] https://blog.8thlight.com/uncle-bob/2014/05/11/FrameworkBound.html
[3] https://github.com/robolectric/robolectric/issues/1879
77
23
Stephane Schittly's profile photoGiorgos Kylafas's profile photoPaweł Marchewka's profile photo沈凯's profile photo
8 comments
 
+Matthias Käppler +Stephan Linzner could you please share on how we can mock Environment class and its methods? Because if we use Robolectric then test cases will run on JVM and hence it will not have any storage directory.
Add a comment...

Matthias Käppler

Shared publicly  - 
 
 
Gradle Plugin 0.11.1 was just pushed. It should be available shortly depending on mirror replication.

release notes:

- Fix issue with artifact depending on android.jar artifact on MavenCentral. (this is the ApiVersion to Integer casting error)
- Fix issue with missing custom namespace declaration in generated manifest.
- Fix issue with validation of permission group in manifest merger.
2
1
Jesús Manzano Camino's profile photo
Add a comment...

Matthias Käppler

Shared publicly  - 
 
 
AboutLibraries
Just forget about the hard work to give credits. AboutLibraries does everything for you. Including the Activity or Fragment!

More information here:
http://mikepenz.github.io/AboutLibraries/

To the background:
Everyone (or at least many of us) always try to give credits to those people who create awesome libraries for us (so we don't have to get crazy, just to implement an easy function :D). But it was always very time consuming to copy and paste the required information, create a layout, manage the information, create an activity / fragment and include in your app.
With the time many of us stop to include those information in their apps because they just don't want to invest any time in it.
So i've created this lib. You can use it to just get the information (if you still want to build a custom activty) or you can just call the included activity and let the lib do all the hard work for you.
Right now just a few libs include the information file, and the lib itself also just includes a few information.

You can help and contribute by creating the information file for the libs you use and love. Create a pull-request and let the dev itself include it in his library (so it's even easier for you and everyone else to use) or if the lib isn't maintained anymore create a pull-request at the AboutLibraries repository so i can include it.

Enough words. Just check out the repository and have a nice evening and weekend! :D 
7
3
Marcos Trujillo's profile photoRalph H.M.'s profile photo
Add a comment...
Have him in circles
2,412 people
JONNYthaWEIRDO 96's profile photo
Harry George's profile photo
Levente Kurti's profile photo
Aaron Sanchez's profile photo
sh asad's profile photo
Arthy Phungma's profile photo
Kevin CHEN's profile photo
Marco Pöhler (mpolo)'s profile photo
Keyan X (Khaoszr)'s profile photo

Matthias Käppler

Shared publicly  - 
 
The recording of my GOTO talk is now available 
32
13
teo ramone's profile photoSpencer Riddering's profile photoThomas Keller's profile photoSoubhratra Das's profile photo
Add a comment...

Matthias Käppler

Shared publicly  - 
 
 
I was home with a cold all weekend, so I wrote up the Android threading talk I presented earlier this year. (It's a trap. It's actually about RxJava.)

#AndroidDev
RxJava is increasingly popular in the Android developer community. I was thinking back to the “ah ha!” moment when it's usefulness really struck me. Even before getting to grips with RxJava's functional aspects, it looked like a neat alternative to AsyncTask and Loader .
View original post
2
1
Dmitry Suzdalev's profile photo
 
Hahaha :)
Add a comment...

Matthias Käppler

Shared publicly  - 
 
 
Some of the best ideas are also the simplest. And there are few things more simple than SoundCloud, which in its seven year existence has sneakily become one of the best things online. How'd it get there? Slowly, surely, and with a cadre of artists as diverse as the internet itself.
6
Add a comment...

Matthias Käppler

Shared publicly  - 
 
T-6 days!

More photos from Kelly, our amazing office manager who made it all happen:
http://kellyarobinson.com/portfolio/soundcloud/

Disclaimer: ping-pong table is still in the box, an obvious omission on the pictures ;-)
SoundCloud has released some sneak preview pics of its new office in the Factory ahead of the startup hub's official opening.
7
Federico Paolinelli's profile photoWalmyr Carvalho's profile photo
2 comments
 
Looks a great place to work! 
Add a comment...

Matthias Käppler

Shared publicly  - 
 
 
We’re thrilled to share that we've planted roots in the concrete jungle where dreams are made: our New York City office is officially open! Read all about it: http://blog.soundcloud.com/2014/06/03/soundcloud-new-york-city-office/
12
2
Stefan Hoth's profile photoLukasz Konieczny's profile photo
 
looks cool!
Add a comment...

Matthias Käppler

Shared publicly  - 
 
"RubyMotion 3.0 will support Android" http://feedly.com/e/W94siszS
reddit: the front page of the internet
3
Add a comment...
People
Have him in circles
2,412 people
JONNYthaWEIRDO 96's profile photo
Harry George's profile photo
Levente Kurti's profile photo
Aaron Sanchez's profile photo
sh asad's profile photo
Arthy Phungma's profile photo
Kevin CHEN's profile photo
Marco Pöhler (mpolo)'s profile photo
Keyan X (Khaoszr)'s profile photo
Work
Occupation
Software Engineer
Employment
  • SoundCloud
    Software Engineer, 2013 - present
  • Qype
    Head Developer Mobile, 2009 - 2012
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Berlin, Germany
Previously
Hamburg, Germany - Roetgen, Germany - Kaiserslautern, Germany - Tokyo, Japan
Links
Contributor to
Story
Tagline
I, code.
Bragging rights
Survived a Bosnian wedding.
Education
  • Technical University of Kaiserslautern
    Computer Science, 2003 - 2008
Basic Information
Gender
Male
Other names
Mattes