A few years ago, I published an Android game, mostly as a hobby. I actually fell into making the game, it was originally planned to be a demo for a talk I was considering giving at a conference. The plans few through, but I kept on tinkering with the game. It was also a good source of material for earlier posts on this blog.
The result was Sedition for Android.
About a about ago, I got the crazy idea to port the game to run inside a browser. I have done some work with the Google Web Toolkit in the past, and I've been very impressed with the way in which it can make developing a rich client side application feel like you're developing a traditional desktop application. GWT compiles Java language code into very efficient complied Javascript. With the advent of HTML 5's media support and WebGl, I had everything I needed to take the Android source and port it.
Originally, I called it "Sedition 4 Chrome", since I was planning to make it a Chrome packaged app and put it in the Chrome app market. I may still do that. Writing a Chrome app gives you access to more features that you can do with lowest common denominator general web apps.
It has numerous quirks, and the rendering especially is not quite right in several ways, but that actually matches the last released version of the Android version. I do plan to fix both eventually. Some of the rendering oddities, especially "sprite parallax" are much more noticeable on large screens than the small mobile screens the game used to run on.
I also have a few ideas for the general engine I developed while working on that game that might come in handy for some of my other projects.
It's a fun project to work on, and in part I wanted it to server a sort of a portfolio of what types of applications I can develop.
Play it yourself at
http://anibit.com/sedition/
--P
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Monday, February 22, 2016
Tuesday, September 13, 2011
Scala and Random musings
I've always been a programming language geek. I love learning new programming languages, though C++ and C# (and to a lesser extent Java and Ada) have paid my mortgage over the years.
I'm more of a fan of statically typed languages, but when I have to, I can feel my way around Python. Windows Power Shell is also a fantastic dynamic language that doesn't get the credit it deserves. I'll admit the syntax can take a little getting used to, and if you don't use it frequently, you will forget a lot of it.
For a reason I can't remember now, I recently read about Scala. (Wikipedia) I'd heard its name thrown around for a few years, but never really looked much into it. If a language is not available for production use for me, I have a little less incentive to check it out. Scala's primary platform is the JVM, and it can also run on Android's Dalvik without too much fuss. There is a .Net variant that uses the Java-.Net bridge/abstraction framework IKVM, but it is apparently not quite ready for prime time.
I'm more of a fan of statically typed languages, but when I have to, I can feel my way around Python. Windows Power Shell is also a fantastic dynamic language that doesn't get the credit it deserves. I'll admit the syntax can take a little getting used to, and if you don't use it frequently, you will forget a lot of it.
For a reason I can't remember now, I recently read about Scala. (Wikipedia) I'd heard its name thrown around for a few years, but never really looked much into it. If a language is not available for production use for me, I have a little less incentive to check it out. Scala's primary platform is the JVM, and it can also run on Android's Dalvik without too much fuss. There is a .Net variant that uses the Java-.Net bridge/abstraction framework IKVM, but it is apparently not quite ready for prime time.
Wednesday, July 20, 2011
Sedition
After many months, and even a good deal of schedule slippage, I uploaded my game, Sedition, to the Android market. You can find it here:
Sedition Ad-Supported and Sedition Ad Free
I also have a Blog dedicated to my software endeavors, DigitalPopcorn
Sedition Ad-Supported and Sedition Ad Free
I also have a Blog dedicated to my software endeavors, DigitalPopcorn
My baby |
(Apologies to anyone reading this who might not be able to access it in the Android Market, I plan to expand offer to additional countries soon, as well as other distribution channels.)
Anyways, it is still in "Beta", but here is a run down of some of the technical/design details of it:
Android Library Management for publishing multiple editions of an android app
[UPDATE 12/30/11: This post is a little out of date, I recently updated to r16 of the ADK, and eclipse 'Indigo' (3.7). I had to play around with the library settings to make the dex process happy, and the settings actually make a little more sense now. I'll make a new post]
Sorry for the long title, but I spent a frustratingly long time( hours ) doing something that should have been achievable in seconds. My hopes are that I am able to document the steps needed here well enough that someone can save themselves some time.
As a last step before publishing, I needed to be able to quickly make two versions of Sedition, an Ad-supported version, and an Ad-free, paid version. In the Android market applications are distinguished from one another by the "package" property in your AndroidManifest.xml file. So simple, change your manifest name and re-build. Not so fast, the resources in your application, eg the files that get assigned an id in the infamous "R" class, are built to live in that class. So when you change your package, any code that references anything in your R class will break. For me this resulted in over 100 errors. I have some final static variables in that help me define code behavior for any given flavor of build. This was the closest I ever got to a #ifdef type mechanism that I mentioned a few months ago. Unfortunately, there is no solution for changing manifest files in a similar manner.
The conventional wisdom of the Web suggests moving your application into an android library, then make two new "Applications" that then link to the library, like so:
This is what I did. It should, by all accounts, have been quick. It wasn't, there were a ton of booby traps, and unless you have innate knowedge of the inner workings of the android build tools, it's a little bit of a mysterious beast. Here's what I did:
Sorry for the long title, but I spent a frustratingly long time( hours ) doing something that should have been achievable in seconds. My hopes are that I am able to document the steps needed here well enough that someone can save themselves some time.
As a last step before publishing, I needed to be able to quickly make two versions of Sedition, an Ad-supported version, and an Ad-free, paid version. In the Android market applications are distinguished from one another by the "package" property in your AndroidManifest.xml file. So simple, change your manifest name and re-build. Not so fast, the resources in your application, eg the files that get assigned an id in the infamous "R" class, are built to live in that class. So when you change your package, any code that references anything in your R class will break. For me this resulted in over 100 errors. I have some final static variables in that help me define code behavior for any given flavor of build. This was the closest I ever got to a #ifdef type mechanism that I mentioned a few months ago. Unfortunately, there is no solution for changing manifest files in a similar manner.
The conventional wisdom of the Web suggests moving your application into an android library, then make two new "Applications" that then link to the library, like so:
Monday, May 23, 2011
Lot's todo
All developers are familiar with the infamous "//TODO" comment in code. It means "I know this code is not finished and will need work", or "I have deadlines and Fred's code is broken so this is the best that can be done until he fixes his library". The problem is that these thing can linger forever. I know, I'm guilty of it myself.
Who hasn't seen things like:
//TODO fix after June
(But that comment was checked in 2 years ago)
//TODO see Fred for a fix.
(Fred doesn't work there anymore, by the way).
Amongst the many code quality techniciques and policies, such as unit testing, treating warnings as errors, and using static analysis tools, I propose a system for dealing with a "TODO" - something that has been identified as needing rework eventually.
In my Android Game, I have recently started using a class to denote such beasts. Behold:
Who hasn't seen things like:
//TODO fix after June
(But that comment was checked in 2 years ago)
//TODO see Fred for a fix.
(Fred doesn't work there anymore, by the way).
Amongst the many code quality techniciques and policies, such as unit testing, treating warnings as errors, and using static analysis tools, I propose a system for dealing with a "TODO" - something that has been identified as needing rework eventually.
In my Android Game, I have recently started using a class to denote such beasts. Behold:
Saturday, March 26, 2011
Java Conditional Compilation.
For a "main stream" programming language, Java has a few aggravating shortcomings. The lack of conditional compilation is one of them.
Subscribe to:
Posts (Atom)