ing. Andrea Maglie

Android Auto Fit TextView

Android framework provides no support for creating a TextView that can fit its content to its size. There are some libraries out there that try to solve this problem, like: AutoFitTextView android-autofittextview But no one of them seems to work in every situation. Looking into stackoverflow I’ve come to this post which ... Read more

Workshop su Google, Android e IoT

Oggi si è tenuto al FabLab di Padova un Workshop sull’Internet of Things, durante il quale ho avuto il piacere di anticipare l’intervento di Intel con un intervento dal titolo #Google, #Android, #IoT. Durante questo intervento ho fornito agli attendenti una panoramica sui servizi che Google mette a disposizione per l’universo dell’Int... Read more

A test rule for setting device locale

When you run your Android tests (like espresso tests), you may want to be able to force the locale of your device to some specific value at runtime (during test execution). This could be really helpful if you want to test some features of your app against multiple locales. You can do this by using Junit4 rules. The rule implementation looks lik... Read more

Android - Enable app features at compile time

Sometimes some fetaures of your app must behave differently for different flavors o build type. Think about when you need to enable logging for a specific flavor only, or you have to disable crash reporting for your “dev build”. All this behaviours can be configured at compile time, insted of using many if/else blocks that are evaluated at runti... Read more

OutOfMemoryError while compiling Android projects

Have you ever got a OutOfMemoryError while compiling an Android project, just like this? :app:dexDebug Unknown source file : Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space Unknown source file : 1 error; aborting :app:dexDebug FAILED FAILURE: Build failed with an exception. * W... Read more