Viewing PDF Files on Mobile Phones via the NetBeans Platform
Viewing PDF Files on Mobile Phones via the NetBeans Platform
Join the DZone community and get the full member experience.Join For Free
In the discussion below, he highlights Jamorea Desktop, an open source NetBeans Platform application for previewing and managing PDF files and for handling their transfer to mobile devices.
What's Jamorea, in a nutshell?
Jamorea is a set of applications used for viewing PDF files on Java ME devices, mainly on cell phones. One of the applications in the set is called "Jamorea Desktop":
Jamorea Desktop is used for the conversion of PDF files for mobile viewing. And it is based on the NetBeans Platform, while supporting conversion, previewing, and file transfer via Bluetooth.
What's the technology behind Jamorea Desktop?
The main purpose of "Jamorea Desktop" is conversion of PDF files to a form suitable for viewing with Java ME applications via Jamorea Micro. I chose Apache PDFBox library to facilitate conversion because it provides useful PDF manipulation features. Custom conversion functionality such as converting font types, color space of images, and so on, is performed using this library. The result of the conversion process is a valid PDF file that can be read not only using Jamorea Micro but also, with a possible minor decrease in quality, using regular PDF viewers.
When you have a converted file you want to, obviously, in this case, transfer it to your mobile device. Today two main ways exist: you can use direct access to the memory card of your phone via USB or you can use Bluetooth. The NetBeans Platform can help you with the first task out of the box: I've used the Favorites window in NetBeans IDE to work with the file system. And there is an easy way to use Bluetooth too. This approach is provided by Bluecove, which is a Java library for Bluetooth. Bluecove offers many features, one of which is OBEX file transport. Jamorea Desktop can discover the mobile device and enables transfer by simply drag & dropping the file, using common Java platform functionality.
How does Jamorea compare to similar products? What are its distinguishing features?
There are cell phones featuring proprietary embedded PDF viewers, there are PDF viewers for smart-phones, but there is a lack of such software for more low-end, yet Java ME enabled devices. As far as I'm aware, there's only Jamorea in this space.
Jamorea can display, at least, after conversion, various PDF files with text, tables, and graphics. It is suitable for reading general documents or eBooks. It runs on every CLDC 1.0/MIDP 2.0 compliant device with at least 1MB RAM.
And, of course, it is open source software!
You wrote your university thesis about this. How did that go?
The aim of my thesis was to perform research regarding the problem of viewing PDF documents on Java ME devices and to design and implement a basic solution for the given problem.
The task included reading through 1000+ page PDF format specification and producing a short introduction as a part of the thesis text... and implementing what is today Jamorea. I worked on the thesis for about 6 months, but not full-time, since there were classes I had to take and other university projects. I successfully defended it and gained my academic degree in June 2009.
You used the NetBeans Platform in this project, why?
The focus of my thesis was Java ME application and the PDF file format. I needed something to ease the task of creating the desktop application used for the preview and conversion of documents. Particularly, I did not want to bother with connecting JButtons, JLabels, layouts, menus, commands, and listeners etc. The NetBeans Platform includes many common GUI components one can use and I could get professionally looking application in almost no time at all. Those parts I had to design myself were easily created using the GUI builder in NetBeans IDE.
I also like the idea of modularity. Below you see the modular structure of the application, together with the Java ME library being created in NetBeans IDE.
Thanks to modularity, I was able to develop the previewer without needing to think about how it would affect the code relating to file transfer using Bluetooth, which was only an idea at that stage of the preview module development.
What are the top 3 benefits you gained from the NetBeans Platform?
- Modularity. Adding a feature is very easy when it is implemented as a module.
- The professional look of the application and the set of available standard components.
- The multiplatformness of the framework. Suddendly my desktop application supports Windows, Linux, Solaris, and Mac!
How did you get started using the NetBeans Platform?
I went through the tutorials from platform.netbeans.org, the great video series called Top 10 NetBeans APIs, and the book "Rich Client Programming: Plugging into the NetBeans Platform".
I tried to write some smaller applications and then, via trial-and-error, began to focus on the thesis related work, usually spending half of the time reading the platform documentation and... your blog. :-)
What was it like to learn how to use the NetBeans Platform? Do you have any tips?
At the beginning I had to get used to terminology, such as "TopComponent". I also had to become familiar with the concept of modularity. But then learning became fun. I really suggest developers starting with the NetBeans Platform to go through the aforementioned video series and to use it to code by example, i.e., try to implement the examples in the screencast series.
What are one or two things that surprised you about the NetBeans Platform after you started using it?
I was surprised by the modular design and the whole concept of modular applications. I wa surprised at how easily they can be implemented via the NetBeans Plaftorm. It saved me many late nights of before-the-screen hours!
What's the future of Jamorea? Do you need more developers working on it? How to get started?
Here's the result right now, on the side of the mobile phone:
I hope to find some new developers to continue work on the project. There is room for improvement in performance and also the PDF support can be broadened to include support for more font types, color spaces, and more.
The easiest way to get started is to go to the official website:
Check-out the source files and start hacking away! And/or to send me an email to tomas DOT mann AT email DOT cz to discuss problems and share thoughts.
Opinions expressed by DZone contributors are their own.