Category: Android

Android: Simple Example of Page Transition Using ViewPager

17 May, 2015 (18:54) | Java, Snippets, Programming, Code, Android

The ViewPager class built in to the Android SDK is a simple method of showing an animated transition between two views. For example, turning a page, or a calendar scrolling through months. This functionality can be added with only a few lines of code. Below I present an example containing pretty much […]

A Quick Snippet for Drawing Images in Java

2 October, 2014 (02:22) | Java, Snippets, Programming, Code, Android

Java does not have the best built-in tools in the world for drawing images, but it’s still useful for many purposes. Below is just a snippet on getting started drawing in Java. For more information on what’s available see the Java Graphics class reference.

BufferedImage i = new BufferedImage(500, 500,BufferedImage.TYPE_INT_RGB);
Graphics g=i.createGraphics();
g.drawLine(0, 0, 500, 500);
g.drawString(”This […]

Android: Accessing other views from inside a custom view using findViewById().

1 October, 2014 (11:15) | Java, Snippets, Programming, Android

If you attempt to call findViewById() on the ID of a view that is not from the Activity that holds the view, findViewById() returns null. I’ve seen a lot of solutions posted for attempting to access a View from outside the activity that created it. Most of them involve inflating the original view […]

Resurecting a broken Android phone as a development sandbox for app development.

24 August, 2014 (22:17) | Java, Programming, Operating Systems, Android

I had the unfortunate incident of cracking the screen on my fairly new Galaxy S5. Since most of the phone worked, I wanted to get all of my old data off, on to my new phone, and finally re-purpose the old phone as a development sandbox which I can dedicate to Android app development. […]