Skip to content

my take on things - David Linsin
Syndicate content
{ by david linsin }David Linsinhttp://www.blogger.com/profile/12280104990941617395dlinsin@gmail.comBlogger485125
Updated: 1 hour 1 min ago

Is the Future of Mobile Apps the Web?

Mon, 03/08/2010 - 06:25
The Mobile Times 2010 conference in Dusseldorf, which took place last Thursday, featured a lot of talks on how to do approach cross platform development. A lot of them suggested web development technics as a way to escape native vendor lock-in, such as Apple's iPhone OS.

There are mainly two approaches:

1. You develop a web site using HTML, JavaScript and CSS zip it and deploy it together with a Player

2. Or you develop a custom website which is served from your servers

The first approach is usually tackled using a framework such as PhoneGap. It event provides an API to include platform specific functionality such as GPS in your application.

The second approach either uses traditional web development technics or targets a specific browser, such as WebKit. One example is jQTouch, a jQuery plugin with cross platform support - unfortunately only WebKit.

The presentations, advocating those two approaches, mentioned mainly two advantages:

1. No need to comply with platform policies (think of Apple's App Store)

2. And you can leverage cheap web coding skills

Those are the facts, I collected during Mobile Times 2010. Unfortunately, the benefits using the web development approaches were not really balanced by any downsides.

I really doubt that the web development approach is the way to go in terms of cross platform mobile app development. I think frameworks like PhoneGap are doing an awesome job, putting an abstraction around the native platform.

Unfortunately you get the least denominator of your platform is capable of and that's a real downside to me. If I put on "average Joe head", I want an app that is using the full potential of my phone. I don't care that it was cheaper to develop a web-based solution and I definitely don't care that the framework I'm using is only offering partial support for my phone features.

Another problem is platform defragmentation! I won't go into it - don't worry - I simply want to point out one downside: In my humble opinion, it is not possible with web development technics to "write once, run anywhere"! You will have to tweak the CSS and work around the abstractions of the framework your are using! It might be cheaper, because we all know that the average web development frickler (amateur craftsman), only charges what he deserves. However, I don't think it gets you anywhere in the long run.

I think we shouldn't approach mobile application development with only the engineering side in mind. Instead we should rather focus on the customer and what he asks from a mobile app. I think the success of the App Store has proven that native apps are the way to go, even if they mean more effort on the development side.
Categories: Blogs

Doublemill Private Beta

Sat, 03/06/2010 - 16:13
Last year I was working on a Nine Men's Morris mobile game called Doublemill. My job was to implement a REST-based server back-end on the Google App Engine. You might remember a couple of posts on that. My colleagues were responsible for coding the Android client. Since I'm an iPhone user and I'm not going to switch to Android anytime soon, I decided to port the game to the iPhone/iPod touch platform.

If you own a iPod touch or an iPhone and have some time at hand, sign up at iBetaTest.com for the private beta of Doublemill Lite. Don't want to sign up? No problem, just drop me a line and I'll hook you up.

I appreciate your feedback and opinion on my first Objective-C endeavor.

Categories: Blogs

Mobile Times 2010

Mon, 03/01/2010 - 05:31
On Thursday, I'll be attending the mobile times 2010 conference in Düsseldorf, Germany. It's a rather small one day event and as the name suggests, all about mobile development.

There's only a two or three sessions, I'm really interested in, since my focus is iPhone and Android. However, there's one session which I'm really looking forward to: "Cross-compiling Android Apps for iPhone with XMLVM". The reason why I'm interested in this is that I just went through a rather unpleasant experience of porting our Android game Doublemill to the iPhone OS. If there was a faster and more efficient solution, I'd be happy - frankly, I don't think it works!

I'll blog more about my roller-coaster ride from Android to iPhone in a future post, but for now I'm looking forward to Mobile Times 2010.

Categories: Blogs

iPhone Development

Mon, 02/22/2010 - 05:59
Last year I was working on a Nine Men's Morris mobile game called Doublemill. My job was to implement a REST-based server back-end on the Google App Engine. You might remember a couple of posts on that. My colleagues were responsible for coding the Android client. Since I'm an iPhone user and I'm not going to switch to Android anytime soon, I decided to port the game to the iPhone/iPod touch platform.

This will be a series of blog posts on how a rookie at Objective-C and the whole iPhone OS came about to release an iPhone app.

I started out with a complete UI, stitched together in Interface Builder in only 15 minutes and ended up on a roller-coaster ride with 3 weekends straight spent on coding and a lot of understanding from my wife. It was really amazing bringing the game to life.

That brings me to the first difference between being a Java back-end guy and an iPhone developer. It's not so much the different programing languages or operating systems, but the fact that you bring something to life. You can hold it in your hands an show it to people. I can even show it to my parents and they can give it a try.

When I was working on the back-end of Doublemill, the only thing I was able to show someone was an URL and the JSON response when you make a HTTP GET. Although my wife is very supportive, when it comes to my pet projects, she's much more pleased with an iPhone App than with a JSON response.

I learned a lot about the iPhone platform, the tool chain and Objective-C during the past couple of weeks and I must say, I get more and more intrigued with diving in completely. I'll blog a lot more once Doublemill Lite, the first version is out the door, until then there's still a lot to do.
Categories: Blogs

GWT @ JUG-Ka

Tue, 02/09/2010 - 08:06
Tomorrow night there'll be the another event of the Java User Group Karlsruhe. It'll feature a talk on the Google Web Toolkit by Papick Taboada, who is quite an expert on the topic. The second part of the event will be a get-together after the talk, where you can discuss GWT over a beer. My company Synyx GmbH & Co. KG is kindly sponsoring the drinks.

The talk will take place at University Karlsruhe in room 101 and start at 7:15pm. The room is located in the basement, which you will find easily, if you follow our duke featured logo.

If you are interested in our lottery, where you can win a JetBrains or ZeroTurnaround license, submit your details through our online form. The winners are going to be announced at the end of the talk and must be present.

Last but not least, check us out on Twitter and subscribe to our Google Calendar or join our Xing Group.
Categories: Blogs

Community Gathering @ JUG-Ka

Mon, 01/25/2010 - 05:40
After the first successful JUG Karlsruhe talk on Groovy, we will kick off the community involvement with a gathering this coming Wednesday.

Everybody who wants to get involved in our little Java User Group here in Karlsruhe is invited. We are looking for people with lots of ideas, sense of community and passion. I prepared a couple of slides, which will help us structure the gathering, but mainly we are hoping to get your feedback and ideas heard.

You can help steer the JUG in the direction which you want it to go. Just join us on Wednesday at 7:15pm, the usual time and the usual place. The University of Karlsruhe kindly sponsored a room (SR-107), which is located in the basement, next to the usual location.

I'm looking forward to see you guys on Wednesday to share some ideas on how to improve your Java User Group Karlsruhe.
Categories: Blogs

Adding a UINavigationBar to a UITableView

Mon, 01/18/2010 - 05:25
A couple of days ago, I implemented a RSS-Reader feature for an app, I'm coding at work. There's a nice tutorial on this topic, which I can highly recommend to you, although it's a little outdated. I'm using a UITableView to implement the RSS-Reader feature and I wanted the header section to be a UINavigationBar. Somehow I couldn't find a proper tutorial on how to achieve this. At least there wasn't anything that explained it in a simple manner.

You will need a UINavigationController, in case you want to navigate through the hierarchy of UITableViews, but we put that thought on hold and I'm gonna show you how to add a custom UINavigationBar.



This is roughly what the final result should look like. You can see my company's logo at the top, inside of a UINavigationBar, which in return is inside of a UITableView. All the components are wrapped in a UITabBarController, which you can see at the bottom in the form of a tab bar.

My first approach was to tackle this kind of interface solely in Interface Builder. It's very straight forward, there's nothing fancy here and my first impression was, that it should work out of the box - the box being InterfaceBuilder. Well, I was able to design almost everything through Interface Builder, just the part with the UINavigationBar made me throw in the towel.

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

tableViewNavigationBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)];

UIImage *image = [UIImage imageNamed:@"synyx_150_no_os.png"];
imageView = [ [ UIImageView alloc ] initWithFrame:CGRectMake(84.0, 1.0, image.size.width, image.size.height) ];
[imageView setImage:image];

[tableViewNavigationBar addSubview:imageView];

[super.tableView addSubview:tableViewNavigationBar];
}


This is what the code looks like. It is implemented in the custom UITableViewController, which is assigned responsibility from the UITabBarController, as soon as its' tab is active.

First step is to initialize the UINavigationBar. In my case, I assign it to an instance variable, which is released in the dealloc method. You can see, that you also have to initialize and add the image yourself, which is usually a simple drag & drop in Interface Builder. That image is then added to the initialized UINavigationBar.

You can see that the solution is only a couple of lines of code, but note that it only works, if you don't want to navigate to a sub view. For that you'd need a UINavigationController.
Categories: Blogs

Watch the Java User Group Karlsruhe Online

Fri, 01/15/2010 - 13:42


This is our first attempt to record a talk of the Java User Group Karlsruhe. Please forgive us the weird camera angle and the volume, we promise to improve that. Other than that I think it's quite reasonable.

I'm really impressed by the tools and platform Parleys.com provides. The best part is - it's free for JUGs. A big thank you from Karlsruhe to Belgium for that!
Categories: Blogs

Groovy @ JUG-Ka

Mon, 01/11/2010 - 05:55
The first talk of 2010 at the Java User Group Karlsruhe is this coming Wednesday. After a successful finale in December 2009 with a talk on Scrum, we are turning our attention to the technical side of things again - Groovy.

We had a talk on Groovy back in early 2008, in case you remember. It was an introduction, whereas this coming talk will target a more advanced audience.

The speaker of the night will be Dierk König from Canoo Engineering AG, Switzerland. He is a Groovy committer and author of the book Groovy in Action. He'll give us an overview of 7 scenarios in which to use Groovy in your project.

I'm excited, that we are going to have a Groovy expert in the house Wednesday evening. If you have any questions on Groovy, it's your chance to get an answer, so make sure to drop by.

The talk will take place at University Karlsruhe in room 102, located in the basement - just follow our duke featured logo. The talk will start at 7:15pm.

Our monthly lottery of JetBrains and ZeroTurnaround, which are each giving away a free license of one of their products is already on. If you are interested in participating in the draw, submit your details through our online form. The winners are going to be announced at the end of the talk and must be present.

To keep up with all the JUG goodness in 2010 subscribe to our Google Calendar or join our Xing Group.
Categories: Blogs

Spring's ResourceBundleMessageSource

Fri, 01/08/2010 - 08:56
Last week my colleague Marc spent hours trying to figure out why a ResourceBundle wasn't loaded in a Spring based web app we are developing here at Synyx. It turned out to be a broken Unicode representation, which wasn't properly reported by Spring's ResourceBundleMessageSource.

In case you don't know ResourceBundleMessageSource, here's an excerpt of its javadoc:

MessageSource implementation that accesses resource bundles using specified basenames. This class relies on the underlying JDK's ResourceBundle implementation, in combination with the JDK's standard message parsing provided by MessageFormat.

We are leveraging the basename functionality of ResourceBundleMessageSource in our application, the way it's suggested in the javadoc. It's pretty neat and you should definitely check it out, if you've never used it.

The problem we encountered indicated that the bundle could not be found. This is what we saw in our log statements:

WARNING: ResourceBundle [broken_messages] not found for MessageSource: Can't find bundle for base name broken_messages, locale en_US

Of course, we tried to fiddle with the classpath, changed the names of the properties files and moved them to different directories in our WAR file - it would only print the above log statement. After hours of trying and failing, Marc discovered an invalid Unicode character representation (something like d\u00Fvid instead of d\u00FCvid) in the ResourceBundle, which wouldn't let ResourceBundle load the damn thing.

So where's the problem with ResourceBundleMessageSource? The problem is that it swallowed the cause of its own MissingResourceException. Here's what Java's good old ResourceBundle class tells you in case of a broken \uxxxx representation:

java.util.MissingResourceException: Can't find bundle for base name broken_messages, locale en_US
...
Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.


You can clearly figure out what the problem is and how to solve it. Whereas, with the message of MissingResourceException the least you would expect, is to look for the problem in the properties file itself.

I created a small test case to reproduce the problem and filed a request for improvement. I hope there'll be a fix, so that other people don't have to suffer the same way we did.
Categories: Blogs

Top Content 2009

Thu, 12/31/2009 - 11:34
Like last year, I'd like to talk a little bit about my blog's top content of the year 2009, as well as a couple of interesting stats.

Let's start off with some statistics, in particular my blog's page views. They increased by almost 30% compared to last year. I think it's because of posting my blog entries on dzone. It brings a nice stream of visitors for each entry, especially if it's a controversial topic.



Unfortunately, the time which visitors spent reading through my blog entries did not increase significantly. That indicates readers are accessing a particular blog post, skim through it and then leave again. I would have loved, if people find more interesting content on their way reading through a particular entry. Since that isn't the case, I decided to revamp the style of my blog a couple of weeks ago and remove all unnecessary clutter to improve navigation and load time.

Let's get on with my blog's top content of the year 2009. This year's winner is my overview of the proposed JDK 7 language changes. It's not alone though, there is another blog entry in the top 5, which is about the future of Java the language. For me, there's one big surprise in those top 5 blog posts: my sample on JBoss Rules, which was the 3rd most accessed post in 2008 and moved up to the 2nd spot in 2009. The most amazing thing about this blog post is the fact that it was written in 2006. So without further ado, here's the top 5 bog posts:

1. More JDK 7 Language Changes
2. JBoss Rules Example
3. JDK 7 Language Changes Coined
4. Having Fun with JDK's tools.jar
5. Java Runtime.exec Opens Too Many Files

What's coming in 2010? To be honest, I don't really know. The past year I published on a weekly basis, which wasn't really a problem, because I had a lot to say. In 2010 I'm planning to change my personal focus from the Java platform to the iPhone platform, Objective-C and mobile development. There's still gonna be posts on Java, I just don't know how many and how regular.

I hope you enjoyed my regular take on development and Java this year! See you in 2010.
Categories: Blogs

Book Review: Beginning iPhone 3 Development

Mon, 12/21/2009 - 05:48
Apress was kind enough to pass me a copy of this book, which I agreed to review in return.

I reviewed a couple of fine books for Apress over the past two years, but I must say that "Beginning iPhone 3 Development" is one of the finest! The authors did an excellent job, addressing the code and complexity of the underlying platform.

When I first got my hands dirty with iPhone development everything was new: the IDE, the programming language and the environment to which my code is deployed. I didn't know my way around Xcode and I had no idea what Protocols are in Objective-C. This kind of knowledge is what the authors of "Beginning iPhone 3 Development" assume and work with very nicely. They are not trying to explain Xcode in every detail or tell you all about Objective-C, instead they focus on what you need to know right there and then to solve the problem the chapter is focused on.

I like this concept a lot! This way you get to know Xcode and Objective-C step-by-step in bits and pieces, with really good examples. Although the authors are not explaining all the tools and language features in detail, I think you really get a good sip of background information.

Another thing which really makes "Beginning iPhone 3 Development" stand out from other books I read lately, is the style of writing. It's not only the words the authors chose to describe a complex junk of Objective-C code, but also the way they approach it. They keep repeating the basic concepts, but always in a different way, so it doesn't get boring to read about stuff like Delegates and ViewControllers over and over again. It's just exactly what you need to wrap you head around this sort of topics.

If you follow the blog of Jeff Lamarche, one of the authors, you can really see that this guy is all about writing. You can find tons of tutorials there for iPhone development, which immediately remind you of "Beginning iPhone 3 Development". The style and tone of writing are quite similar.

After all the praise there is one downside, it's a minor one, but then again, to you it might be important: the website. It's really just a pointer to a phpbb forum, which is meant to be a place where people can discuss or ask questions about the book. That's all well and good, but the thing wants you to register, even if you merely want to download the source code, which sucks. I just don't need another forum account.

A colleague raised the question why you need a book, in order to develop for the iPhone? After all, the documentation Apple provides is pretty extensive and of high quality. That is true! Apple's Developer Connection provides a plethora of documents on all sorts of topics, all very well written. The problem with those documents is that they don't give you a coherent picture. It's more of a reference documentation. You go there, if you need an answer to some specific problem.

"Beginning iPhone 3 Development" on the other hand, provides a nice example for each chapter, which leads you through all the features of a certain angle of iPhone development. You can tag along and at the end of the chapter, you have a pretty good understanding of what just happened the past 50 pages.

For me, "Beginning iPhone 3 Development" gave me a good insight of what it takes to develop an iPhone application. It even encouraged me to dive deeper and change my development perspective from solely Java towards the iPhone platform. If you are planning to get started with iPhone development, go and buy this book! You won't regret it!
Categories: Blogs

Scrum @ JUG-Ka

Mon, 12/07/2009 - 05:47
The upcoming talk at the Java User Group Karlsruhe this Wednesday is kind of an experiment. It features Scrum, which according to Wikipedia:

... is an iterative incremental framework for managing complex work (such as new product development) commonly used with agile software development.


It's an experiment, because we usually feature sessions on development topics like REST, Hibernate and Flex. A talk on a management framework, although it's closely related to development, is rather unusual for us. If you are not interested in this kind of topic, let me know, we appreciate your feedback.

The talk will take place at University Karlsruhe in room 102, located in the basement. Unusual topics call for unusual timings, so we'll start at 8:00pm this time. Our speaker is Dr. Jürgen Hoffmann of scrumcoach.de.

This month we are giving away a free book called "Growing Object-Oriented Software, Guided by Tests by Freeman&Pryce". If you are interested in participating in the lottery, drop me an email. The winners will be announced at the end of the talk.

This is the last gathering of the year 2009. There's even more to come in 2010, so subscribe to our Google Calendar and stay up-to-date.
Categories: Blogs

Playing with Spring's RestTemplate

Mon, 11/30/2009 - 05:40
A couple of week ago, I saw a talk on Spring 3.0's MVC REST support. It's quite impressive how simple SpringSource made REST development by applying the proven concepts of the core Spring Framework.

One of those great core concepts is Templates. Spring's Data Access Framework is an example, where templates are used extensively. One of the templates is the JDBCTemplate. It provides a set of predefined methods to access a database, without worrying about Connection management or Exception handling. Templates are a nice way to help you the the job done, without constraining flexibility. The book "Building Spring 2 Enterprise Applications", which I reviewed last year, there's a whole chapter on Data Access and the corresponding Templates.

The RestTemplate is the latest child in the family. Arjen Poutsma from SpringSource wrote a blog entry about it and describes it as follows:

The RestTemplate is the central Spring class for client-side HTTP access. Conceptually, it is very similar to the JdbcTemplate, JmsTemplate, and the various other templates found in the Spring Framework and other portfolio projects. This means, for instance, that the RestTemplate is thread-safe once constructed, and that you can use callbacks to customize its operations.

In the before mentioned blog post, Arjen shows how to pull pictures from Flickr, using their REST API, and display them in a JFrame. He uses an XML based approach, whereas I'll show you some code, which handles JSON:

public Issue browse(Repository argRepository, int argIssueNo) {
RestTemplate template = new RestTemplate();
template.setMessageConverters(new HttpMessageConverter[] {
new MappingJacksonHttpMessageConverter()});
IssueResponse resp = template.getForObject(BASE_URL + "issues/show/{username}/{repo}/{no}", IssueResponse.class,
argRepository.getOwner(), argRepository.getName(), String.valueOf(argIssueNo));
return resp.getIssue();
}


You can see it's quite easy to work with a RestTemplate. You simply create an instance, tell that instance what your expected content is going to be and you are good to go. In this case we expect the request and response to be JSON. Spring is using the Jackson JSON Processor, to automagically map POJOs to JSON and all the way back.

The concept of a MessageConverter is really neat. You can set multiple converters and specify to use a certain converter for certain POJOs. You can also handle multiple content types by setting multiple instances of MessageConverter.

In order to make a REST call with the predefined MessageConverter, you simply use the getForObject method. You pass the url to call, the type the response is supposed to be mapped to and the values to be replaced in the url. The type of the response is actually a wrapper class:

public class IssueResponse {
private Issue issue;
public Issue getIssue() {
return issue;
}
public void setIssue(Issue argIssue) {
issue = argIssue;
}
}


It is necessary since the following JSON response, which is represented in the POJO Issue, needs some kind of holder object:

{"issue":
{"number":1,"votes":0,"created_at":"2009/11/01 07:27:56 -0800",
"body":"This is a sample issue! Used in my RestTemplateSample!",
"title":"Sample Issue",
"updated_at":"2009/11/01 09:16:58 -0800","closed_at":null,
"user":"dlinsin","labels":["minor"],"state":"open"
}
}


As you can see, it's really easy to work with Spring's new RestTemplate. These couple of lines are enough to retrieve a JSON or XML response from a REST call. With the Template approach, you have the full flexibility to hook almost every method and tweak it to your needs.
Categories: Blogs

Finally Running with the Snow Leopard

Mon, 11/23/2009 - 01:01
A little note upfront - this is not about software development, so if you are solely here to read about my take on coding, this blog entry is not for you!

A little more than 2 months ago I pre-ordered Apple's new Mac OS X 10.6 aka Snow Leopard one week before the official release at Gravis. As it turns out, it was a bad idea, because it took Gravis more than 6 weeks to deliver, but I digress...

After finally receiving my Family Pack, I installed the Snow Leopard on my wife's brand new MacBook. The upgrade was smooth and finished after only about 40 minutes. However, when it came to my old MacBook Pro, the tragedy began...

The first attempt to install Snow Leopard resulted in the installer quitting and rebooting the old Mac OS X as if nothing happened. Booting from the 10.6 DVD and then running the installer didn't help as well. I tried a couple of times, but the Snow Leopard wouldn't come out of the cage. Instead, I got an error message like "An error occurred while installing Mac OS X".

My second attempt was borrowing a colleagues copy of Snow Leopard and trying to install it using my built-in DVD. You might have guessed it - it failed as well, with the same error message. The next attempt was getting an external drive, which I hooked up using FireWire. Unfortunately, neither my nor my colleagues Snow Leopard DVD would let me install.

After I spent hours of trying to tame this animal, I decided to leverage my wife's MacBook as a remote dvd drive. It's pretty easy to setup and worked like a charm, however it didn't get my anywhere installing the new Mac OS X. The same problem here: the installer hangs after a while no matter which DVD I tried.

My last resort was using a USB stick/drive for installation. I found a nice description (german) on the web, which included the following steps:

1. create an image of Snow Leopard using Disk Utility (I used my wife's MacBook for that)
2. restore that image to your USB stick (I got an 8GB stick)
3. boot from your USB stick (hold option/alt while booting and select the USB drive)
4. run the installer

My stick didn't work out of the box, I had to reformat it - since it came FAT32 formatted and I had to run "Scan Image for Restore", which you can find under the Image menu in Disk Utility. After getting my USB drive ready and following the steps above, it worked like a charm. The installation took about an hour and went smoothly, without any problems.

Although I had so much trouble getting Snow Leopard installed, it was worth the pain! My system feels much more snappy and responsive now. Snow Leopard needs less space on my quite limited hard drive and Time Machine backups are reasonably fast now.

Overall, I'm quite happy jumping though all those hoops to the new Mac OS X Snow Leopard, although the experience wasn't very Apple-like.
Categories: Blogs