04-30-2010 09:45 AM
i know that we can create a .class file from .java file by compiling it. However i am unable to do the same with some of the .java files of my blackberry application. The java compiler gives error for BB specific namespaces and classes.
Can anyone tell me how we can create .class files for the .java files in our BB application?
05-01-2010 09:11 AM
There are 2 reasons for doing this:
1> I have different applications on BB that have very similar requirments. By putting the common classes in a jar file i can simply import them in whichever app i want and use them. This allows for code reuse and also if i need to make any future fixes i dont have to make the same changes to all my apps.
2> The size of the code is expanding. I want to put all the related classes into a single jar file and use these jars in my application.
05-01-2010 10:04 AM - edited 05-01-2010 10:04 AM
Remember that the BlackBerry does not use a jar file, it uses cod files. So you can organize things the way you want, but you will have to do it by putting the classes you want in one cod (= one jar) in one project. Make this a Library project and then you can do what you want.
It is my understanding that the BlackBerry only supports one version of any class. So if you have two applications that share the same jar (i.e. cod), then you will only have one copy of that cod installed on the device. So if you want to share code, you will need to be careful about how you manage your applications.
In short, the option you are looking for of moving classes around into various cods is not supported on the BlackBerry, you need to do this with the source and manage the source into shared Libraries.
05-03-2010 01:07 AM
Okay thanks Peter!
Now i have a better understanding of what can be done with BB code files.
Also i would really appreciate if you could explain to me the meaning of the last line of your previous post:
"and manage the source into shared Libraries."
05-03-2010 12:52 PM
For manage, read 'move'.
What I think you were wanting to do was to create a jar by moving the class files into it. You will have t move the source files that should be in that jar, into a separate project.