Tag: java

  • Setting JDK level in Android Gradle builds

    Setting JDK level in Android Gradle builds

    The correct, complete, 2024, settings to configure the Java version in Gradle for Android.

  • This one simple change for better class naming will blow your mind

    Single Responsibility[^n], Beware the Share[^n], Boyscout Rule[^n]. These are some conventions that guide good practice in software development and I believe naming can benefit from these ideas and other practices. This blog post will discuss class naming using Model View Presenter as the example and show you one change you can do to make your…

  • Clean Code: Java Class Fields

    Keeping your code clean is no easy task. Clean code allows your project to pass the test of time. It can be broken down into making your code simple to read, write, and understand. This post will explain how you can clean up your class fields to move towards a cleaner project. Code maintenance is…

  • [TUT] Easier / Quicker Generic Collection Creation

    Sick of repeating your generics declaration?Sick of repeating your generics declaration? [java] List<SomeObject> listOfSomething = new ArrayList<SomeObject>(); Map<SomeKey, SomeObject> mapOfSomething = new HashMap<SomeKey, SomeObject>(); [/java] For a quick and easy way to create a collection of objects you can do the below. Create yourself a util class: [java] package com.blundell.util; import java.util.ArrayList; import java.util.HashMap; public…

  • [TUT] Create your own CheckStyle check

    Android code is just like any Java system, you need to write tests and have automated code review checks. CheckStyle is a way of double checking your Java code. Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to…

  • [TUT] Using Annotations for Android XML onClick visibility

    In this tutorial I’ll show you how to create a basic Annotation. The idea being you can use this to highlight the entry points into your code. (These entry points coming from XML onClick declarations in your layout files). I did this originally for myself, I was finding it hard when looking through my Activity…

  • [TUT] Running an Ant script with Eclipse

    In a previous tutorial I explained how to use an Ant script to build and run your projects. However it’s no good knowing how to do that, if you can’t run the Ant script. So here is a simple picture by picture example of running an Ant script with Eclipse. First you need to add…