473,490 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

J2ME and Parser and bytecode

Hi,

Does anyone know of a good place to look for a starting point -- I'm
building an application on J2ME and I want to have a scripting
language to both access my UI and the database RMS. Most phones have
very limited resources so the interpreter should be small and fast.
Does anyone know of a simple scripting language source to handle if (
) { } else {} and while ( ) { } and expressions and function calls
back into Java. I'm using javacc at the moment and it's good but it
generates a lot of code.

Plus, I'd like the script to be compiled into a bytestream and then
executed on the phone. The compilation will happen before loading on
the phone. It's a little like javac compiling .java to .class and then
the KVM executing the bytecode. The problem is that ClassLoader
support is not in J2ME ( or I would compile the scripts as .class
[renaming them, of course] and load via ClassLoader) and the size of
the class is limited by the phone's preverifier, but the resource
limits are much higher. Therefore, we can put the scripts and
database stuff in a resource and allow our app do more than the limits
of phone's preverifier allows.
Basically, the question is:

Is there a small language/ compiler/ executor example out there?
Or is it better to simply obfuscate the source script (making it
smaller) and run that?

Thanks,
Ralph
Jul 17 '05 #1
1 3536
Ralph Yozzo wrote:
Hi,

Does anyone know of a good place to look for a starting point -- I'm
building an application on J2ME and I want to have a scripting
language to both access my UI and the database RMS. Most phones have
very limited resources so the interpreter should be small and fast.
Does anyone know of a simple scripting language source to handle if (
) { } else {} and while ( ) { } and expressions and function calls
back into Java. I'm using javacc at the moment and it's good but it
generates a lot of code.

Plus, I'd like the script to be compiled into a bytestream and then
executed on the phone. The compilation will happen before loading on
the phone. It's a little like javac compiling .java to .class and then
the KVM executing the bytecode. The problem is that ClassLoader
support is not in J2ME ( or I would compile the scripts as .class
[renaming them, of course] and load via ClassLoader) and the size of
the class is limited by the phone's preverifier, but the resource
limits are much higher. Therefore, we can put the scripts and
database stuff in a resource and allow our app do more than the limits
of phone's preverifier allows.
Basically, the question is:

Is there a small language/ compiler/ executor example out there?
Or is it better to simply obfuscate the source script (making it
smaller) and run that?

Thanks,
Ralph


You might want to take a look at LuaJava - http://www.ideais.com.br/luajava/

Disclaimer: haven't got around to playing with it myself yet.

--
Chris Gray ch***@kiffer.eunet.be
/k/ Embedded Java Solutions

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
17278
by: Oz Mortimer | last post by:
Hi, Is there any way that I can scroll a canvas - i.e. if there are too many items on the canvas you can still access by pressing down. I know Form does this (apparently) but I need to do it...
0
3374
by: Todd Christy | last post by:
I am building a J2ME application for a BlackBerry handheld device. This application connects to an IIS server via HTTP to execute remote ASPX-based services that collect and return data. We are...
0
2269
by: Dave Rathnow | last post by:
We are looking at using J2ME in a embedded device that will be deployed in an industrial application and I've been doing some research to see how practical J2ME would be for our application. Most...
1
4041
by: Sveta | last post by:
Hi, all! I am new with J2ME. I have application that has form with 2 commands (exit and select). All UI uses are high level API, and it is very important to leave it high-level. This...
0
2703
by: Fine | last post by:
Hallo, ich habe ein midlet mit eclipse erstellt und erhalte folgende Fehlermeldung Error verifying method Approximate bytecode offset 5 Inconsistent or missing stackmap at target Probleme...
3
1927
by: cr88192 | last post by:
for various reasons, I added an imo ugly hack to my xml parser. basically, I wanted the ability to have binary payload within the xml parse trees. this was partly because I came up with a binary...
2
3351
by: mayankcdac | last post by:
Hi i am a new guy in j2me field i am working in j2me gaming but i want to switch from gaming to application. i am facing some problems to build j2me application can any one give me any source code(...
1
8717
by: charlesvc | last post by:
Hallo I am working on web design on mobile. So i came to know for webpage in html or xhtml needs to be parsed to show on mobile So my doubt is the parsing will give only tags text...
0
7112
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.