Question

Greetings,

My Java experience is limited, but I have a fair enough understanding of it. With that in mind, I am attempting to write a mobile application with a self-contained database -- Java DB -- for the purpose of maintaining my fitness log.

Netbeans is my preferred IDE, and it is currently of the latest stable version and Java DB is installed -- indeed the database is ready and waiting -- but I simply cannot figure out how to attach a Java DB to a J2SE project.

Searching for tutorials and what not online lead me to Java Desktop Applications w/ a self-contained database, and when I attempt to port the import statements to a J2SE project, I receive nothing but import errors -- even with adding the Java DB jar files to the project library.

Any assistance or point in the right direction would be greatly appreciated. Also, I am not deadset on the use of Java DB, and so if another portable database is preferable, then I am open to suggestions.

Thank you

Was it helpful?

Solution

J2SE is very different to J2ME. J2ME contains a cut down VM and does not have many of the features (e.g. generics, iterators, collections, reflection, finalization, thread groups, JNI ) that you would normally find in J2SE.

J2ME is not the platform to use for logging lots of information and trying to display it in informative graphs. A typical MIDlet can store around 2MB of information, although this varies between devices and is not a definitive number.

J2ME was designed for devices with little memory, so it has a small max heap size. This means that you would most likely run out of memory trying to display over a months worth of detailed fitness information.

There are a limited number of J2ME graphing APIs and because of the limitations of the platform, none of them can display graphs in a manner you'd expect in J2SE.

As another person mentioned J2ME uses a RecordStore to persist information. It can only store byte arrays which normally means you start writing your own very light serialisation framework for storing objects. Where every object you want to serialize implements a toByerArray() and fromByteArray(byte []) interface. However you can use other frameworks which will serialize objects for you.

OTHER TIPS

If you're thinking of writing your app to run on the MIDP platform, you'll be sorely disappointed because JavaDB won't work on MIDP. J2SE != MIDP by any stretch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top