The history of Android

Ron Amadeo of the tech news site Ars Technica, recently posted a rather lengthy article on Android history, from version 0.5 to todays 4.4. Its worth reading. The history of Android I now notice that android has come a looong way, since my first android device, the white HTC Magic with cupcake 1.5, to the Nexus 5 with android 4.4.3. I don’t think I could ever go back to the magic, today. (I shiver

» Read more

How to fix ArrayIndexOutOfBoundsException in your custom ListAdapter

If you are creating your own ListAdapter, perhaps you want to show different list items, or list item headings in your list by overriding the getItemViewType and the getViewTypeCount in the implemented Adapter class, then you may have come across the ArrayIndexOutOfBoundsException, as the example below: ERROR/AndroidRuntime(400): FATAL EXCEPTION: main ERROR/AndroidRuntime(400): java.lang.ArrayIndexOutOfBoundsException ERROR/AndroidRuntime(400): at android.widget.AbsListView$RecycleBin.addScrapView(AbsListView.java:4540) ERROR/AndroidRuntime(400): at android.widget.AbsListView.trackMotionScroll(AbsListView.java:

» Read more

Google Play just got a nicer permissions layout

Google Play just got updated to version 4.8.20, with a much nicer ui for app permissions. Review App Permissions. Here you can see a list of all the permissions app may ask for. Simplified permissions on Google Play To help make it easier to understand what an app will have access to, the Play Store has recently made improvements to how permissions are displayed. Permissions are organized into permissions groups, easily identified by icons (example:  Location) to help

» Read more

Using fail2ban to block Wordpress login attempts

If you are being brute force attacked by someone trying to login to your website, more specifically your WordPress blog, you could certainly block them in the firewall by their ip adress, with iptables like this: iptables -A INPUT -s 13.22.33.12 -j DROP However, this gets quite cumbersome to do everytime your site is under attack, so the best solution would be to have an automated blocking system.  This is where fail2ban comes in. Using fail2ban to

» Read more

Android string.xml resource formatting

If you are using the strings.xml file for your applications string resources (which you should!) then you might have wondered what to do if you need to combine a string and a value. Take this text for example: Hi, my name is Ruben and I am 26 years old String resource formatting This can easily be solved by using string formatting to insert the values; Ruben and 26. In you strings.xml file, create a new string resource like

» Read more

Web API testing tools - Postman

Whatever you are developing, you are most likely contacting or creating a web API. For quickly testing web APIs, there are numerous tools you can use to do requests, instead of before implementing everything in code. This can quickly speed up the development process, and discover bugs and problems with the API early. For almost two years now, I have been used to using Fiddler for doing HTTP requests and testing APIs. Postman A few days ago, I came across

» Read more

Android Volley library - Fixing the empty POST parameters

Recently, I came across the Volley library for Android. I already had an app that used network requests, to post and get data from a Node.js webserver with Express.js. The code I had for doing the network part, downloading JSON data and images, with memory and disk cache of images, was working fine, but I thought I’d make use of volley instead. As it had better support for certain things, one of them; grouping and cancelling requests

» Read more

Got a problem with spaces in strings.xml getting stripped away?

If you have a string in your strings.xml file that you want to have a space character in front or after the string itself, you may notice that this space gets trimmed away automatically. To avoid the string getting trimmed away, you can use one of the following tricks: Trick one – Wrapping the string in quotes If you wrap the string in a pair of quotes, the space will not get stripped away. Also, the quotes themselves does not

» Read more

Linode - The best VPS host

A couple of years ago, I was looking for a good place to host a VPS, with this blog, and other stuff. After testing out a couple of known and little known services, I stumbled across Linode. The VPS you get for your money, is absoslutely worth it! They have a pretty powerful starter plan, with 1 GB of ram and 48 GB of storage. Theres great guides and support for setting things up. Great performance, uptime and customer support.

» Read more

How to extract strings into strings.xml resource files in Android Studio

I have previously posted a guide on how to extract string resources in Eclipse, so I thought I would do it for Android Studio too, as it is not directly obvious how to acheive this. All your applications strings should be placed in the various /values/strings.xml files in your app. This is the best practice, gathers all texts, and easily enables you to translate your app into other languages. While developing apps, it might be easier to just

» Read more