java

Android App Development Diary: Entry Number 1

Travis Black's picture

Getting started with Android dev was a bit of a pain. Honestly, more than I thought it would be. I thought, its an open source platform, with millions of users and developers, and its created by Google. Surely there will be tons of examples on the web and getting started will be a breeze. Boy was I wrong.

The first thing I did when I decided to create an Android app was go to Google and search for Android SDK. The first result was the result I wanted and there was a nice link to a Zip file for Mac. Beneath were a great little set of instructions on how to get started. I moved the SDK files over to my ~/cl folder, which is where I keep all of my command line tools. I then opened up the "Detailed Instructions" for installing the SDK and thus began my journey. http://developer.android.com/sdk/installing.html

It was a little rough in the beginning, with downloading Eclipse, installing ADT, trying to decide which tools, platforms and Add On's to install, creating my VM, etc. I finished all of this up, and moved on over to "Hello World, Android Edition". Hello World was when I hit my first issue. In Hello World (http://developer.android.com/resources/tutorials/hello-world.html) about halfway down, you will notice where it is asking you to create your strings.xml file. Unfortunately, every time I edited this file (which was auto-generated), I got an annoying pop-up in eclipse stating: java.lang.NullPointerException and every time I clicked or attempted to edit this file, I got this error. I was going crazy, when finally, I deleted the file, created it from scratch, and it worked great. Finally, I was over my first hurdle and on my way towards real mobile app development.

PDF Forms

Dan's picture
Tags:

One of our clients has a simple enough request. They wanted a PDF form to be populated in with a set of values gathered from a web form. We decided to settle on xfdf as a method to do this.

I wasn't familiar with xfdf, but was pleased to discover it is an easy format.

<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields>
  <field name="firstname">
    <value>Dan</value>
  </field>
  <field name="lastname">
    <value>Cocos</value>
  </field>
  <field name="email">
    <value>dan@echoditto.com</value>
  </field>
</fields>
<f href="example.pdf"/>
</xfdf>

Now that the xfdf problem was solved we had to move on next to adding the fields to the PDF. We were unable to find suitable PHP libraries to handle it. Luckily there is a free and open source Java* library iText that does all of this and more.
Miles an EchoDitto intern took the first crack at it and had a working example in no time. A little bit of code clean up and voila a short while later a working tool to merge form data into a PDF.

*There is also a C# port for those so inclined.