Author: David Stockdale

Width, Smallest Width and Height

Did you know you can check the smallest width of whatever virtual device your using with this code?

Configuration config = getResources().getConfiguration();

Because i sure as heck didn’t.

Also you can get the current width and height with this:

DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics();
            float dpHeight = displayMetrics.heightPixels / displayMetrics.density;
            float dpWidth = displayMetrics.widthPixels / displayMetrics.density;

Be careful though as this apparently changes depending on if the device is in portrait or landscape mode.

Filed under: AndroidTagged with: ,

App Combat Screen

As a quick test of this new blog here’s a preview of my app. I’m not quite happy with the text/button colours and I’m still working on getting the layouts working on a variety of different screen sizes (smallest width layouts and other such solutions are a pain to figure out).

I’m also planning to commission a small pixel artist to draw me a custom sprite for the main character but all in all I’m quite happy with the way it looks now.

Combat Screen (main character sprite and text colour not final).
Filed under: AndroidTagged with: