Header
Home | Sitemap Set as homepage | Add to favorites
  Search the Site     » Advanced Search
Sections



Porting Techniques

by

image

Porting Techniques

If you do decide to port one of the parsers that doesn't build in MIDP out of the box, there are several techniques you may wish to consider:

  • Dump features you don't need. If the parser code is modularized well, you may be able to remove entire subdirectories of the source code, assuming you don't need those features in your application. You might, for example, be able to drop off a package that puts a SAX interface on top of the parser or a WAP support package.

  • Parsers often won't compile because they use classes from J2SE that aren't present in MIDP. One way to fix this is to supply the missing J2SE classes. There are two challenges with this approach. First, there are legal restrictions on the use of J2SE source code. See the source license for the full details. You can work around this by supplying your own implementation. The second problem is that MIDP implementations won't load classes defined in the java.* and javax.* namespaces. You can work around this problem using an obfuscator that renames the classes into different packages. (Chapter 15 has some more details on this.)

  • A cleaner option is to use classes in the same package or inner classes to replace the missing pieces of J2SE.


475 times read

Related news

» Using Parsers in the J2ME Wireless Toolkit
by admin posted on Nov 17,2006
» Compiling a MIDlet
by admin posted on Nov 17,2006
» Trimming Bouncy Castle Down to Size
by admin posted on Nov 17,2006
» The Connected Device Configuration (CDC)
by admin posted on Sep 26,2007
» Compilation
by admin posted on Sep 26,2007


More Top News
Cisco Wireless Networking
Most Popular
Featured Author