commons-pdb

A Java library for reading PalmOS PDB database files.

The source code can be found at GitHub and is distributed under the terms of GNU Lesser General Public License Version 3.

Installation

commons-pdb is available at Maven Central. Just add this snippet to your pom.xml:

<dependency>
  <groupId>org.shredzone.commons</groupId>
  <artifactId>commons-pdb</artifactId>
  <version>1.0</version>
</dependency>

Or use this snippet in your build.gradle (e.g. in Android Studio):

dependencies {
    compile('org.shredzone.commons:commons-pdb:1.0')
}

Quick Start

This example reads a calendar PDB file, and converts the records to ScheduleRecord objects using a ScheduleConverter.

try (PdbFile pdb = new PdbFile(new File("calendar.pdb")) {
    PdbDatabase<ScheduleRecord, CategoryAppInfo> database = pdb.readDatabase(new ScheduleConverter());

    System.out.printf("Name: %s\n", database.getName());

    List<Category> cats = database.getAppInfo().getCategories();
    for (int ix = 0; ix < cats.size(); ix++) {
        System.out.printf("Category %d: %s\n", ix, cats.get(ix));
    }

    for (ScheduleRecord entry : database.getRecords()) {
        System.out.println(entry);
    }
}

Dependencies and Requirements

commons-pdb requires at least Java 7, but has no other dependencies. It can also be used on Android (API level 19 or higher).