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 Nexus 5 USB Driver

Recently I had to install the driver for Nexus 5,  but I completely forgot how to do that so I decided to write a post about this.  So what problems did I have? Well, I did some research on the internet (again) and found the steps to install, but for some reason my Nexus 5

, ,
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, Tutorials

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

, ,
Tutorials

Android and Java sockets – simple messenger

Hello all, as you requested in the previous TCP server-client tutorials, I made a new tutorial on how to create multiple client connections to a single server. I posted the projects on GitHub here for you so I will post here only the main classes and functionality that I consider important to walk through. You

, , , , , , , , ,
Solutions

Android maps v2 generate SH-1 key (MAC OS)

There are two keys that you can do with this, one the debug and the second for the release key. Basically is the same thing just that the debug key is already made for us and it is used when you run the app from your IDE .. So to generate the SH-1 key you

, ,
Snippets, Solutions

Android: Prevent cut-copy-paste popup to be displayed

If you ever need to disable the popup for cut-copy-paste when you long tap a text from an edit text you can do this by using the code below: yourEditText.setCustomSelectionActionModeCallback(new Callback() { public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } public void onDestroyActionMode(ActionMode mode) { } public boolean onCreateActionMode(ActionMode mode, Menu menu) {

, , , , ,
Tutorials

Android Studio Graddle, add GooglePlayServices library

Nowadays, everything is in a continuous change, so I don’t know if you heard about this, but the android team moved to a new build system named Gradle.  Also the Android team moved from supporting Eclipse as IDE to Android Studio. The latest, has the Gradle system incorporated so you might want to started migrating to

Tutorials

Android: Send SMS to Emulator

The Android emulator has support for receiving text messages. You can send a SMS to an emulator by using the command line. So the first step is: 1. Be sure you have the Telnet Client feature on To enable the Telnet feature on windows you have to make the following steps: Go to Control Panel

, , , , ,
Tutorials

Android: ListView with SearchView

In this tutorial I will present you how to use the SearchView using FTS3. If your data is stored in a SQLite database on the device, performing a full-text search (using FTS3, rather than a LIKE query) can provide a more robust search across text data and can produce results significantly faster. See sqlite.org for information about FTS3 and

, , ,
Info

Android Studio – TestFlight upload plugin

As you well know the new IDE for Android is Android Studio and it is using the power of Intellij IDEA IDE which is great.If you work with TestFlight to distribute your builds to your testing teams or customers, you will surely like my new plugin that helps you upload the builds more faster and

, , , , , ,
Scroll to Top