Solutions, Tutorial

Google Play Games API + Playground

The Problem… So I wanted to reset my score on one of my google play games here(QuickAZ) and for that I could use Google Play Games API if the user was registered as a tester in the play console. In order to easily authenticate to the service and test the API I used Google’s Playground. The only […]

, , ,
Privacy Policy

Android Studio Tip #6 – Multiple Cursors

I have heard before about this “ability” of Android Studio of having multiple cursors active at the same time, but I haven’t found it very useful until today. You can see what I am talking about in the gif below: Press ALT + SHIFT and left click on the mouse and select the position of

, , ,
Privacy Policy

Android Studio Tip #5 – Autocomplete “for” statement

When you want to write a for statement most of you guys (or at least me :P) start to write character by character “for (int i = 0; i < list.size(); i++)”. Well Android Studio makes this easier for us and we can avoid writing that much by using a combination of 2 keys: CTRL

, , ,
Uncategorized

Android Studio Tip #4 – Automatic Negation

Sometimes, (in fact, many times :P) you have to negate boolean expressions, and in order to do that, you write the expression and after that you go back to the beginning to add “!”, am I right? :D Well, you can avoid doing this, by pressing the “!” instead of Enter when you use autocomplete. Just

, , , ,
Solutions

Android Debugging is not working

PROBLEM You add breakpoints and you cannot debug your code. CAUSE The problem might be that you have ProGuard enabled in the gradle file. buildTypes { release { minifyEnabled true } SOLUTION So if you set minifyEnabled to FALSE, your debugging should start working. If this is not the issue, then you can try restart AndroidStudio

, , ,
Solutions

Genymotion Get Google Play Services

If you need Google Play Services, you must know that Genymotion doesn’t have Google Play by default, at least for the moment. So you have to download a zip file containing it from here. For Android 5.1 Download from here For Android 5.0 Download from here For Android 4.4.4 Download from here For Android 4.3 Download from

,
Uncategorized

Android Studio Tip #2 – Extract Instance Variable

You might need to “convert” a local variable into an instance variable. Well, you can do this very easy with Android Studio. So, in order to extract an instance variable (field) you can do this by using the following shortcut: CTRL + ALT + F (on Windows) or Cmd + ALT + F (on Mac OS)

, , , ,
Uncategorized

Android Studio Tip #1 – Extract Constants

If you have hardcoded strings that should be extracted into constants, you can do that in at least 2 ways: the hard way the EASY way The hard way  is to write yourself the constant and then replace it in the entire code where the string is used. And the EASY way  is to use the power

, , , ,
Solutions, Tutorial

Load localized strings at runtime

Here is a possible solution if you want to load localized text resources on a TextView in Android. Problem: You may need to extend your app flexibility to be able to load localized texts at runtime from a web server for example. That would be to be able to add new localizations (for new countries)

, , , , , , , ,
Snippets, Solutions

How to unzip Gzipped InputStream

If you are working with HttpURLConnection on Android then you might encounter strange InputStream outputs like when you have a strange character encoding even though on the server side everything seems ok. A problem I was encountered lately was when I needed to parse a RSS/Atom feed on Android. I was getting the following error:

, , , ,
Snippets, Solutions

Print Android signing key SHA in code

If you ever want to get the Android SHA (1/256), MD5 or the signing key used to sign your app for example you can use the following snippet. Important! Be aware that you should not print that in a production environment as it might leak sensitive data API 28> (Kotlin) Deprecated (Java) And the converter

, , , , , , , ,
Scroll to Top