Java Ninja Chronicles By Norris Shelton

Things I learned in the pursuit of code

You see lots of examples that use ListActivity to display a list of data. The thing they don’t tell you is that the class was written for ListView with an id of ‘list’. That means you can only have one of them for your whole projects. Gah!

Code your custom implementation and save yourself the trouble.

This may help http://www.vogella.com/tutorials/AndroidListView/article.html

November 12th, 2012

Posted In: Android

Leave a Comment

An easy way to add dependencies to your Android project in IntelliJ is to use the Maven repository dependencies. This works great until they have dependencies that are provided by the Core maven libraries. This leads to error messages like the following:
the “–core-library” option to suppress this error message.
If you go ahead and use “–core-library” but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.

This is caused because SimpleXML also has dependencies on stax and xpp3. Remove those and you are good to go.

November 11th, 2012

Posted In: Android

Leave a Comment

LinkedIn Auto Publish Powered By : XYZScripts.com