(I have solved my problem, so have edited it to look more like a blog post - the final working solution has been placed as an "answer" below.)
Aim
I want to package our BB libraries (v4.5 OR v5.0) into JAR format, so we can give application source code to clients WITHOUT giving library source code.
Workaround
Currently, I have my SDK, and my apps, all setup with source code, as different projects in the same workspace. All projects compile. My SDK is setup as a library project, my apps as applications.
In each app, I add the SDK project to the build path.
Eclipse handles the build perfectly, creates the various COD files. I copy & unzip the COD files into the same folder, run updatejad
to combine the JAD files, and end up with many COD files that install perfectly.
Problem is - the library is required to be in source code.
Problems Encountered
There are many conflicting sources of information on this. The process is simple, but not well documented. In some attempts, I have encountered the following problems:
- JAR file needing preverification (perhaps a topic for another comprehensive post in the future)
- JAR file needing the RIMAPPSA2 "secret" signature from the signing tool
- Final built app being seen as "not signed" despite signing tool confirming success
- Final built app not finding the SDK code (JAR file was not exported in the build path settings)
Unfortunately the main document that seems to be referenced from RIM is incorrect - details below.
(I hope its OK to cross-reference this question with the following long list of links?)
StackOverflow links:
- Blackberry: Verificattion error when using Library project as External Jar
- https://stackoverflow.com/questions/6134940/how-to-use-external-library-jar-file-in-blackberry
- Blackberry 5.0 - Add reference to a Java Library Project
- How to add external jar or zip file in the Blackberry project
- Blackberry Apps - Importing a code-signed jar into an application project
- How to add library project with the current development project in blackberry
This one gives other links - quite useful:
These not so useful:
- In Blackberry, can we create common library that can be used by different applications?
- BlackBerry Facebook SDK jar file
- Adding and Testing Compatibility of External Jar to Blackberry Project
- How to attach Jar in Blackberry
- BlackBerry RIMAPPSA2 signing key required -- why?
- Is there a list of classes, methods and API which will trigger RIMAPPSA2 permission when signing Blackberry application?
RIM: