Java Memory Optimization & Server Resources

[Photo: Not much here]I’ve learned a bit about Java and also about Linux this past week-end. I finally found out, what it was that kept me from going forward with the deployment of my web application. I kept getting OOM errors when starting up a second java process on my virtual server. Even stackoverflow users, thorough and diligent as they are, could not provide me with a solution. (In the end it turned out however that one had provided me with the right information, he just could not know that I was unable to apply it, due to the configuration of the server.)

To begin here are a few quick notes on java memory usage and two nice articles: common errors and an overview of JVM Options:

Continue reading

Posted in development, java | Leave a comment

Automate your Android builds comfortably

Or: How to set up your Android app’s Multi Module Maven build as Eclipse project.

So schön ist die Eifel This week I spend a few hours searching for a solution for automated Android builds with Maven. I want to launch my first paid app with minimum fuss. There is a free version of the app on the market already and now I want to use a multi module Maven project to manage both a free and a paid version of the same app comfortably. I am a lazy programmer after all.

Since it was not quite the trivial endeavour I had hoped – but of course not expected – it to be, I decided to write this up as an article for myself and of course for all the other Android developers out there who don’t want to waste time setting up projects when they could be gold-plating their apps ;)

You are probably only reading this after you have already created your app and have everything running from Eclipse. And it works, too, up to a certain point. I only started on automated builds when it started hurting me to not have them. So I won’t cover setting up a fresh project. You should have some working knowledge of Maven and Android. I will assume you have both setup Android and Maven projects in the past.

This article assumes that you have an Android project without an automated build somewhere. If you don’t have one just create a new Android project in Eclipse, this will give you a HelloWorld app and everything that is necessary to follow the instructions in this article. Please don’t recycle your project, you can easily copy over your classes and resources later. Start from scratch with the setup until you have understood what is going on – there’ll be less crying if you don’t break your working project along the way. If you really want to do this on an existing project, tag now!
Continue reading

Posted in android, apps, development, work less | 2 Comments

A fairy tale of the Wicket and the Maven

ApollotempelLately I’ve been working on several Apache Wicket projects. Wicket is quite an intuitive and well-rounded web-application framework. Well intuitive for someone who has been programming Java for a long time. Since for the moment I am back to using Real Java (as opposed to Android), I am also happily back to using Maven and that’s what this article is mostly about.

When starting out with a new technology I think it’s best to jump in and get started on a project. Because nothing teaches as fast as doing and nothing leaves the same lasting impressions as the mistakes you make.

The fastest way to introduce yourself to wicket is the Wicket Quickstart project. Here’s the commandline (you could also do the same by creating a project in Eclipse but I would have to provide screenshots and much more explanation, when the original page – see link above – does the same quite well).
Continue reading

Posted in development, java | Leave a comment

How to use the Android Camera

I have now spent quite a few hours programming for my next app which needs to take pictures. I did not want to use the camera app that’s already there for several reasons. So I need to programm my own. The API is not all that difficult to understand. Here’s the basic version of how to talk to the camera:

    //creating the camera object
    Camera camera = Camera.open();
    camera.setPreviewDisplay(getSurfaceHolder());
    final Camera.Parameters parameters = findBestParameters(w, h);
    camera.setParameters(parameters);
    camera.startPreview();
    final PictureCallback callback = new PictureCallback() {
        @Override
        public void onPictureTaken(byte[] data, Camera camera) {
            try {
                //async task for storing the photo
                new SavePhotoTask(CameraView.this.ctx, data).execute();
            } catch (final SavePhotoException e) {
                //some exceptionhandling
            }
        }
    };
    //no need for shutter callback or raw callback, jpg callback is enough
    camera.takePicture(null, null, callback);

Doesn’t sound so hard? It only took me hours to get it right. Because I never got to the onPictureTaken(...) method. The callback never happend! I made the mistake wanting to do something else after taking the picture – who wouldn’t?
Continue reading

Posted in android | Leave a comment

Open Source Android: DroidWeight

SegelbooteA few minutes ago I made my first commit on the new svn repository for DroidWeight on google code: http://code.google.com/p/droidweight/.

I had a couple of requests to open source it. Since I never planned on making money from the app anyway – after all it is my learning app – I thought I could just as well share. Maybe I’ll find a couple of contributors.

So if you would like access to the repository and the google group just drop me a note via mail or the contact form and I’ll see to it.

Right now the documentation is practically non-existent, so you should be brave enough to find your own way through the code.

I’ll still be publishing releases as before only now everyone can see the code and take it to make their own stuff with it, laugh about dumb beginner’s errors I made or contribute patches.

This is the first time I am open sourcing a project of mine and I am curious how it will turn out :)

PS: the app is close to 10.000 downloads on the market!

Posted in android, apps | Leave a comment

Call for links

I am looking for pages, forums, communities and blogs on all things scrum or agile. I will also happily take a look at general software development processes and methodology sources. I’d be grateful for some good places to start reading.

What are your favorite places to go read up on the latest agile news?

Posted in Agile Methods, processes | 3 Comments

3 Approaches to Change

In Can you change your team? I asked you to think about what you want to change the most about your work. What you want to change dictates which approaches to change is most likely to succeed. The best approach depends largely on how much influence you have on that aspect of your work.

Analyse your problem

Now that you know what you want to change, it is time to start thinking about a solution. Most of the common problems can be sorted into three categories according to the most promising approach to get them fixed:

Posted in processes | Leave a comment

Can you change your team?

obamafyYes you can!

The words may have gotten a bit old by now. I still say: you won’t know until you have tried and succeeded.

Are you working in one of those teams, that I described in my last article? It can be hard to imagine, that you are able to facilitate any change regardless of your role in the team.  Are you the team leader and everybody thinks you should be the one to change everything? Or are you a team member and you think you do not have the power to change anything? You all have your excuses for not even trying: Continue reading

Posted in processes | 4 Comments

Why every team needs a development process

Imagine a typical software development team. There are 2 types of such teams: those that are based around a single project or those around a single system. People tend to want to differentiate between those types only to find out in the end that they are remarkably similar if you zoom out far enough. Since my experience is with the latter I’ll talk about that. If something does not apply to your team on first glance it just might on second glance. The similarities are enough that I think I can generalize and make my point.

What then do I want to talk about? Three attributes most IT projects share are

  • the complexity is always greater than anticipated
  • projects tend to grow over time
  • they are difficult to manage

Nothing new here probably.  There are solutions that help getting a grasp on the complexity and make some parts of IT projects not easy but easier. Those things are called ” development processes” and I have a favorite in that department which you will find out soon if you don’t know already. Continue reading

Posted in processes | Leave a comment

The Android Dropdown: Spinner

Dropdown and Spinner TutorialI am currently working on the next release of RpgTracker and I thought I might do another tutorial since I haven’t written one in quite a while.

In Android the dropdown selection widget is called Spinner. Dropdowns are used to select one of a fixed set of values. They are quite helpful to improve usability of apps to make sure only the right values can be chosen.

In this short tutorial you will find two examples with different applications for a spinner:

  • a spinner used as part of an activity
  • a spinner in a dialogue

Continue reading

Posted in android | Leave a comment