Skip to main content

Posts

Showing posts from March, 2015

Robolectric setup in Android Studio 1.0

These days I have been using Android Studio v1.0 and I want to do test using Robolectric, which give you more freedom for unit testing in Android. You can perform your test without emulator running. But I have faced setting problems even though the website looks like they're explaining well about how to setup the configuration. I blamed my brain but I found out there were missings for Android Studio gradle build and I had to google it a little bit more. I am not familiar with Gradle yet, but Android Studio uses Gradle as default build tool and Gradle seems to be a quite great build tool. There are two 'build.gradle's for Android Studio project. These are the main file for build configuration. One of them(a) is in your project folder is for global setting and the other one(b) in the 'app' folder is just for your app. myproject - build.gradle (a) - app - build.gradle (b) For the right setup, we need to touch a few things. 1) Installation 'Android

How to remove log completely in release version in Android

You can use  ProGuard  to remove completely any lines where a return value is not used, by telling ProGuard to assume that there will be no problems. The following proguard.cfg chunk instructs to remove Log.d, Log.v and Log.i calls. - assumenosideeffects class android . util . Log { public static *** d (...); public static *** w (...); public static *** v (...); public static *** i (...); } The end result is that these log lines are not in your release apk, and therefore any user with logcat won't see d/v/i logs. ref. http://stackoverflow.com/questions/5553146/disable-logcat-output-completely-in-release-android-app