How do I store a date and find how many days have passed since that date?Should be just fine. Importing external stuff isn't a bad thing outright. I'd only start to worry if you were bloating your download to the point where it was annoying to anyone installing it, and this is often outweighed by not having to reimplement functionality that's already out there in some library. One thing to watch out for with JodaTime is that you may get some warnings if you take their compiled library and import it (as it converts the Java bytecode to Dalvik bytecode). I don't think these are an issue, but if you want to get rid of them, compile the JodaTime library for Java 1.5).

Java Servlet Static ClassIf you're looking up to read up on such issues, then Effective Java will give you a background on making things immutable, and other basics. For a richer coverage of concurrency issues you may want to take a look at Java Concurrency in Practice.

Aug22

comment

Java Servlet Static ClassThere isn't an instance of the class (which is exactly what we avoided by having the constructor like that). Calls to that particular static method can be considered thread safe. z is a local variable and will be instantiated separately each time the method is called. A case I can think of where you may hit concurrency issues with such a method is if you were passing it a mutable object (rather than a primitive, and an immutable object wouldn't suffer the same problem). That object could then be modified externally at the same time, depending what else you'd passed it to.

Aug22

comment

Android - Another button questionOkay, I didn't realise that it was possible to specify the On Click action in the XML (which is good to know). It looks like ImageView has that property too, so you should be able to set it there too.