Creating cross platform games

I am a game programming newbie and right now I am just trying to make some simple games in Java, following through various tutorials, etc. However, I have an interest in making both desktop and Android games. I have seen frameworks such as libGDX that allow for cross platform support but I was wondering how I would go about developing a cross platform game myself. I was wondering if anyone knows of any examples of people doing this that I could look at.