Warning: A non-numeric value encountered in /homepages/38/d425795598/htdocs/medotuk/wp-content/themes/Divi/functions.php on line 5837

Recently, I’ve been working on a side project for work in my free time. It’s basically a mini quiz type app that could be used at a convention or something like that. The user picks the type of questions that they would be interested in, answers the questions, and then are given a percentage and asked if they wouldn’t mind giving their contact details to us.

The percentage was just a piece of boring text that was taking half the screen. Still being new to Android development, and java as a whole, I soon hit up stackoverflow to find what I wanted.

I came across this question: http://stackoverflow.com/questions/19731261/android-draw-circle-with-2-colors-pie-chart/19731358#19731358. It did basically everything that I wanted.

The main changes I have made have been adding colour ranges to represent low, medium, and high values. I’ve also added an outline only mode – this is where only the outside edge of the circle is coloured.

If you want to check it out, you can use the Demo app below, or find the source over on github.

Github Source

[pb-app-box pname=’co.uk.captainstu72.example.percentview’ name=’Percent View Example’ theme=’discover’ lang=’en’]