Fix “Multiple dex files define L…” Errors

Today I got an error when building the APK: Multiple dex files define L/… My scenario is that of a project with 2 modules: a core and an app. Both modules use a plugin named androiddevmetrics, which generate some code, including a class which has the same signature in both modules. The linking (APK generation) […]

Material Drawer and Toolbar Options

The latest couple of days I’ve spent in adding the Excellent Material Drawer to one of my applications. In my case, the drawer is shown on the second activity in the workflow. Below, I’ll outline my experiments. Preamble First, the requirements are: An android application with one (or more activities) (d’oh!) and Material Drawer Code […]

Intercept OkHttpClient Response for Debug

I wanted to log the data retrieved by OkHttpClient for debugging purposes. After digging for a while, the process seems quite straight-forward now. First, we create the OkHttpClient:

Then, we add an interceptor:

The interceptor code is:

The main thing to remember is that one the response has been processed, you need […]

Access Data Files for Local Tests in Android

TL;DR: Put your data files in test/resources and access it with:

I’ve got an android application with a module performing data processing (HTML scraping in fact). This part is pure java and all its tests are in the src/test path. My particular problem is that I have a set of (large-ish) files to be […]

GoogleApiClient .connect() Interface or Class

TL;DR: If it’s your code, check the version play services ( com.google.android.gms:play-services-*). If you’re using a library, check if the library has a version using play services >= 8.1.0. If not, you’ll need to clone and upgrade it yourself. The other day I got an interesting error coming out when running an app: ‘GoogleApiClient.connect()‘ was expected […]

Hide Apps in Nova Launcher Drawer

TL;DR: Select Nova Settings -> App and widget drawers -> Hide apps (scroll down bit) -> select the apps you want to hide. I’ve noticed that my app drawer started to get cluttered with stuff I’m not really using (like the Audio FX stuff). since some of the things I can’t remove (system apps and […]

Add Wear Notifications to Android App

TL;DR: Use android.support.v4.app notification mechanism. Steps are: Create a WearableExtender:

Extend the notification mechanism:

Trigger the notification:

After reading various sources, I got my application to send notification to my watch using the code above. At the beginning, I thought the notifications weren’t sent. I thought I needed to enable wear in […]

Load Glyphs with LibGDX

TL;DR: Remember to give the font loader the list of characters to render from the font! I’m trying to get a more resolution-independent mechanism to load simple shapes in place. After investigating SVG loading for several days I got nowhere. Then, I found out that libGDX actually supports vector fonts (TTF). Woo-hoo! Internally, it’ll convert […]

Generate Amazon Underground Launcher Icons

TL;DR: Use (adapt) the script below to automatically generate the Amazon Underground application launcher icons. I was toying with the idea to build an Amazon Underground version of one of my applications. According to their rules, you need to: Repackage your app Name custom permissions (Lollipop) Apply Amazon Underground branding Migrate API (if necessary) Initially […]

Picking Colours for Your Application

While working to get a theme for my new app Epso View (Play and Amazon), I’ve identified two types of websites: Inspiration (like dribbble or materialup) Combinations (like colourlovers or materialui) You can use the inspiration sites to get inspired; what colours work together, would your app look light or dark… Then, you can use […]

Scroll to top