Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
rgelb1
Posts: 108
Registered: ‎08-05-2008
My Device: Not Specified

The emulator tax

When developing in the JDE, to try things out, you gotta bring up your app in the emulator.  Currently, it takes about a minute for it to come up, for the debugger to attach, etc...  This really discourages me from trying out things.

 

Are there any tricks to making the emulator come up faster, a lot faster?

 

Thanks.

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: The emulator tax

This gets asked a lot.  To retiterate my own suggestion: Don't have less than 2GB of memory on your dev machine.  That's the only thing that sped up the simulation cycle for me.
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: The emulator tax

Well, for me it is easier to do testing OTA as I have a lot of diagnostics built in and a test cycle consists of invoking one

script, opening my email, hitting the link, and downloading the new version. This may not be the answer for everything

but if you have a server it can be amazingly quick once it is automated and you can send notify emails

to anyone else who may have a phone specific problem for quick testing.

 

 

Please use plain text.
Developer
richard_puckett
Posts: 191
Registered: ‎04-03-2008
My Device: Bold 9700

Re: The emulator tax

I take it your handset doesn't have to reboot in order to run the newly-installed app.  :smileyhappy:  The only thing worse than waiting 45 seconds for the simulator to start up is waiting five minutes for a handset to reboot.
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: The emulator tax

sometimes it does but it doesn't take down my whole computer while it is :smileyhappy:

In any case, it seems to be a good way for me but emulators have their purposes and something to consider

if you need to iterate on real devices- the automated approach is pretty simple once you are set up.

 

Please use plain text.
Developer
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: The emulator tax

I use the time while the emulator is loading to add my 2p worth to questions on this forum...   Sorry, got to go, the Bold is running now....
Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: The emulator tax

 

I need a simple proof of concept, perhaps you can tell me which sun jre's would be compatible with your platform independent

java class libaries. This would  work for simple testing ( I'm trying to test an xml parser):

 

$ java -classpath "net_rim_api.jar;." xxx
Exception in thread "main" java.lang.ClassFormatError: Method <init> in class ne
t/rim/device/api/xml/jaxp/XMLParser has illegal modifiers: 0x101
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at xxx.<clinit>(xxx.java:15)

Administrator@TESTBED01 /cygdrive/e/new/java/RIMM_JDE/lib

Please use plain text.
Developer
dkonigs
Posts: 248
Registered: ‎07-25-2008
My Device: Bold 9900

Re: The emulator tax

As far as I can tell, "net_rim_api.jar" is just a thin wrapper around native code running on the BlackBerry.  Pretty much every single API call exists as nothing more than an interface in that JAR file.  This means that, as far as I can tell, you have to use the emulator to test this stuff.

 

Now, I personally would love an offline-capable net_rim_api.jar, if only so I could run the bulk of my unit tests outside of the emulator.  Though I'm not sure if that is likely to happen.

Please use plain text.
Developer
marchywka
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: The emulator tax

The class files are "bytecodes" for instructions that execute on a virtual machine ( oddly enough called the

java virtaul machine). This is another "emulator" for an instruction set which doesn't exist in hardware

in most places. There are various class file versions and "class inspectors" online. Nominally

these are all the same and could run in the right JRE. I wouldn't expect everything to work

as eventually there are calls to native code but it is possible to mix and match or provide a JNI

that the emulator uses but without all the extra graphics "stuff" that probably slows down the startup.

 

The bytecode part is portable, the native part exists for the emulator anyway. It should be possible

to startup a JRE using the right set of classfiles and native code without starting all the other junk.

 

Certainly I would find it surprising if the xmlparser uses native code but it still just be a matter of hunting down

the pieces you need to test.

 

http://www.google.com/search?hl=en&q=java+class+file+inspector&aq=f&oq=

 

 

 

Please use plain text.
Developer
dkonigs
Posts: 248
Registered: ‎07-25-2008
My Device: Bold 9900

Re: The emulator tax

Try to decompile "net_rim_api.jar" sometime.  Pretty much *everything* in there is just an interface with no implementation.  What I'm trying to say is its *all* JNI.  The only way you'll ever get something that depends on the BlackBerry API to run outside the BlackBerry simulator is to essentially reimplement the whole thing.

 

 

Please use plain text.