Building the Botan library for Android

Botan is a C++ crypto library with a wide range of supported cryptographic algorithms. In this article, I’ll walk you through building Botan for Android, so that it can be used in applications that are built with the Android NDK. Preparations In the following, I use Ubuntu 12.04 LTS (x86_64) with Eclipse as my development …

java -jar ignores classpath — Workaround

When you want to run a Java class wich needs additional libraries, you usually run java -cp mylib.jar MyClass or you specify the environment variable $CLASSPATH before running the class. When you have a JAR file you want to run, you usually do this by issuing java -jar myjarfile.jar Maybe you’ll think: Hey, I want …

Caching using weak references

Some time ago I wrote a Java class that caches generated images so I don’t need to re-render them all the time (rendering SVG graphics takes some time…). There’s only one problem: As more and more different images are getting cached, the maximum heap space of the JVM will eventually get exhausted. Increasing this limit …

Anonymous classes: references to parents

If you want to create an anonymous class (here: inherited frow OtherClass) and you need a reference to the containing class (here: MyClass), you should do it as follows: class MyClass { void myProcedure() { OtherClass oc = new OtherClass() { void otherProcedure() { foo(MyClass.this); } }; } } It is much easier to use …