Sunday, 2 October 2016

The Fantom Programming Language

The Fantom programming language compiles into bytecode ("fcode") that can be easily compiled to run on the JVM and CLR. There is an interesting blog post on Fan vs Scala.  It was started as a part-time project in 2005.

Saturday, 23 July 2016

Programming in Scala, Third Edition

As of April 2016, Programming in Scala is now in its Third Edition. Authors are Martin Odersky (the language's creator, and also a professor at EPFL in Lausanne, in the French speaking part of Switzerland, and a Fellow of the ACM), Lex Spoon (an engineer at Semmle) and  Artima President Bill Venners.

Sunday, 5 June 2016

Debugging On-Device from Android Studio

You need to have the appropriate OEM drivers installed for ADB (Android Debug Bridge).

What does a Basic App Look Like in Android Studio?

There are two folders:

1. One for your App - which will be called "YourAppName"
2. One for the Gradle build - which will be called "Gradle Scripts"

What does "YourAppName" I look like?

There's a .idea folder (which relates to IntelliJ settings), an app folder (that's your code), and gradle folder containing gradle-wrapper.jar.

What does "Gradle Scripts" look like?

Bunch of files, most important is gradle.properties.



Failed to Sync Gradle Project in Android Studio

A look at the error detail reveals the following - "Unable to start the daemon process: could not reserve enough space for object heap. Please assign more memory to Gradle in the project's gradle.properties file".

More detail on Gradle's configuration can be found here.

More information about GC configuration can be found here.

To get around this error, try adjusting the -Xmx setting in gradle.properties. Just be careful not to increase it beyond the "maximum representable size".

Why does Android need a Java SDK to run?

The Android build process, which converts an application into an APK (or Android Application Package) relies on the JDK to a large extent.  Also, jarsigner is needed to sign the APK.  Since the JDK is required, ensure that your JAVA_HOME variable is set and that you can run javac from the command line (edit your system PATH to ensure you can do this).

Tuesday, 31 May 2016

An Idiot's Guide to Android Studio

Android Studio is the official IDE for Android development. The latest version has support for N preview development, the next version of Android after Marshmallow. C and C++ integration is available via the Android NDK. There is an additional overhead and complexity so evaluate carefully whether you ought to be using the NDK.

Installing Android Studio is a 1-day job.  Even once you install and extract the relevant files, the first time you run Studio it will still need to download additional components, this takes quite a while.

One of the final steps is the creation of the Android virtual device. This requires installation of Intel HAXM (Hardware Accelerated Execution Manager) to speed up Android application on the host machine.

Wednesday, 17 February 2016

Jenkins

Jenkins is an open source, web-based build automation server. It's worth a mention here as it's built in Java. It was created in 2006 and initially named "Hudson" by a developer at SUN called Kohsuke Kawaguchi. When Oracle bought SUN in 2009, there was a dispute over trademarks and the project continued under the banner of Jenkins.

Jenkins can be used for technology stacks other than Java. For example, MSBuild is supported via dedicated plugin. There is also an Android emulator plugin.

A book, "Jenkins: The Definitive Guide" has been published in 2001 and written by Sydney-based IT consultant John Ferguson Smart.

HDFS In Numbers

Hadoop makes use of the Hadoop File System, or HDFS, a distributed file system. It differs from other distributed file systems in that it is specifically designed for:

1) Large data sets (in the sense that each file is gigabytes or terabytes in size)
2) Implementation on low cost hardware (so cheaply scalable to hundreds or thousands of machines)

Each server machine can store part of the file system's data.

A more detailed introduction on HDFS' design can be found here.

The Hadoop API is detailed here.
 

Sunday, 17 January 2016

Automating Builds with Gradle

This is Gradle.

Gradle expresses its build files in Groovy.

It is marketed as a "polyglot" build tool supporting builds in Java and Scala as might be expected but also can build C/C++ and iOS code.

The Gradle "daemon" can be used to speed up builds. It is recommended to be switched "on" on developer machines but disabled on continuous integration servers.

Settings on the daemon include:

  • maximum heap size:  -Xmx
  • minimum heap size:  -Xms

Some information on migrating from Apache Maven.