Skip to content

Content classified under "Software"

Page 12 of 21

ProgressDialog in AsyncTask: Dynamic Update Text/Title

July 17, 2015Category: Software
Sometimes, you may want to update the text shown in the progress dialog. If you try to perform this in doInBackground() you'll get an exception along the lines: Only the original thread that created a view hierarchy can touch its views The solution is to not do it in doInBackground() but instead…

ProgressDialog in AsyncTask: Dynamic Update max()

July 16, 2015Category: Software
Sometimes you determine the max of the progress bar in the background task. Unfortunately, there's almost no way to transmit that to an UI thread-executed method like onProgressUpdate() (well, you could, but that'd be abusing the method). Instead you can do something like: This way, the variables…

Butterknife: ClassCastException: Symbol$VarSymbol ...

July 10, 2015Category: Software
The other day I decided to update my Butterknife from 6.x.x to 7.x.x. Immediately I noticed some refactoring (e.g. @InjectView became @Bind). I updated my code and got build (from Android Studio's "make"). Unfortunately, when I tried to test it, I got: java.lang.ClassCastException: com.sun.tools…

Move Gradle Home

June 20, 2015Category: Software
I'm having some space constraints and I need to move as much as possible to a non-backed-up place. Gradle home (the .gradle directory) has 2.23GB on my computer. A lot, so it must go. The procedure is simple . Just create an environment variable named GRADLE_USER_HOME: Now all your gradle stuff…

Gradle(w) and Proxy Authentication

June 18, 2015Category: Software
The recent updates in Android Studio eliminate the possibility of passing JVM arguments to gradle. That's quite unfortunate because I quite liked my solution and now I was getting a (not) nice Connection refused message... So I had to find a different solution. Environment Variable As always…

My ProGuard Configuration Base File

May 28, 2015Category: Software
Following my previous proguard entry , I think it's useful to present my final proguard configuration. I'm starting with my base file (proguard-rules.pro), explaining it along the way (as much as I can understand). Proguard Set-up I have a normal project structure ( <fallpaper>/<app> ), and my…

Get Access to Files in Genymotion

May 26, 2015Category: Software
Genymotion is a fine emulator. I'm using it as any normal user and once in a while I need to get a file from the VM to analyse (a DB file or a trace usually). Normally, the way I go is via the Device Monitor (which, in turn goes via adb). Granted, this is the universal method (read: works both on…

Android AdMob Bug

May 23, 2015Category: Software
I'm trying to implement AdMob in my application as an exercise. I followed the tutorial to the letter (read: copy/pasted code from the sample into my app). I ended up with an activity, where onCreate() had the following code: and a layout like this: Pretty simple. However, I found that after…

ProGuard and Third Party Libraries - a Strategy

May 22, 2015Category: Software
Today I tried to compile my app for release with proguard . Previously, I skipped proguard, but now I wanted a lean package :). Soon, I got into a bit of a mess, because I noticed I have quite a few libs which need custom proguard rules. So, I ended up with one proguard file per library, included…
PreviousNext

All categories