Android Fractal Explorer

Published 16 Jun 2012

Hello again! Since I realise that it has been a significant since my first semester exams and first post. Its about time I finally post some updates! This is what I would consider to be my first piece of proper Android code though I had a crash course at DevXS hack weekend and contributed to the creation of Intr; the code I produced whilst fuelled with muffins, tea and a general lack of sleep would not have won any awards (well maybe the “What was I doing here?” award). This code was actually written a while ago, but I never got round to posting it. To start my introduction to the Android platform, I decided to implement a simple fractal explorer that would draw the Mandelbrot Set. As I had previously had experience with drawing fractals, the underlying logic was already known and the aim was to give me insight into the Android drawing libraries. For specifics about the Mandelbrot Set, see link. Current State In it’s current state it takes typically around 4 – 7 seconds to recalculate the data needed to draw the fractal (e.g. when you change the bounds), dependant on the CPU and resolution of the device. This means that its not overly practical to use. A possible method of making it quicker would be to reduce the number of calculations required, though we would effectively be losing detail in the fractal image. Plans I propose to use RenderScript to improve this as it operates on a lower level than the Java code that is typically used in Android programming and take advantage of the GPU which is ideal for parallel calculations. Unfortunately the RenderScript APIs were only introduced after Android 3.x Honeycomb, meaning that the app would not run on older devices. Additionally pinch to zoom is in the works, as well as support for other types of fractals such as the Burning Ship.