2014

Privacy Policy

Android Studio / IntelliJ IDEA code regions

If you ever worked with Xcode then you must know the power of “#pragma mark” macro. You could just define regions of code using that and sometimes it helps when you have classes that can get a bit big or if you just want to have a nice structure of your class. Well you can do […]

, , ,
Snippets, Solutions

Android Gradle & Manifest merge

[Deprecated] This post is now deprecated, the Manifest Merger has changed since my first post. You can find more about this on the android developers site. Manifest file & Gradle If you started using Android Studio and implicitly Gradle, or you just started using Gradle with other IDEs (like Intellij for example), then maybe you

, , ,
Solutions

Android Canvas Issue Starting API Level 14

Recently I had to change the target SDK on one of my applications, but by doing that, I ran into some problems with the Android Canvas.  In this application I use an animation which simulates an explosion. So, I tested my app and I noticed that everything was working OK, until I changed the target

, , , ,
Snippets

Clear Fragment back stack

To clear the Fragments back stack of a FragmentManager, you could iterate through all back stack items and call popBackStack() but there is also a more elegant solution. Please see below: // in my case I get the support fragment manager, it should work with the native one too FragmentManager fragmentManager = getSupportFragmentManager(); // this

, ,
Snippets, Solutions

Run code on main/UI thread on android

Android’s UI components are not thread safe so one may need to update Views or other UI components from a secondary thread when returning from an asynchronous database query or a web service call.  If you run the code from a secondary thread you might see that the code crashes almost on each try. Below

, , , ,
Solutions

Android Studio: Cannot install from SDK Manager:”Access is denied.”

On Android Studio I noticed that if I try to install the android sdk files I get an error like in the image below: (I have Windows 8 on my computer) So I found out that the solution is to open the Android Studio as Administrator from where it is installed. In my case Android

,
Solutions

Android Studio Gradle 0.9 error: Unable to load class ‘com.android.builder.testing.api.DeviceProvider’

I had to re-install my windows, therefore I had to re-install all my programs too, including Android Studio :) So, after I had re-installed Android Studio, I kept getting a Gradle error: ” Unable to load class ‘com.android.builder.testing.api.DeviceProvider’”. After I googled it I found the solution here. It seems that we have to delete gradle’s cache.

,
Solutions, Tutorial

How to get user location

Nowadays, knowing the location is very important for applications. Even if you want to develop a simple application that returns the coordinates, or you develop different kind of apps that need location and you need to know what is the location of the use,r this tutorial might help you. In order to get your current

, ,
Tools

Android State list generator

Inspired by a post from stackoverflow, I made a simple XML State List generator :), you simply need to fill the inputs with your corresponding drawable names and then press Generate button. For more details regarding android StateList XML please check the official documentation. Android state list generator version 2 is here:  New in android state list generator

, ,
Scroll to Top