Hi,
I am totally new to Codename One and recently got involved in Codename One project. I want to ask some questions related to best practices when we want to use some third party libraries with Codename One. First I want to describe what we already have in our project to clarify my doubts.
We are using two libraries: bouncy castle and protostuff. We have external eclipse project for that libraries with downloaded sources and with added lib CLDC11.jar . Now I want to ask some questions as I'll be describing how we got this to work.
So first we have to build this project in eclipse. And here are my doubts about this step:
1. Is this ok to compile java sources outside of Codename One project and then use it (so they are not compiled via ant script in Codename One project and are just copied into application jar)? Only thing I've changed in this step was setting compliance level to java 1.5 and changed code so it could be compiled.
2. Those libraries have some dependencies to core java classes that are missing in CLDC11.jar from e.g.
java.io or java.security package. So we have some core java sources in same project. When I tried to send build I got some errors so I've changed names of those java packages to resolve conflicts. So my question is: is it ok to use core java classes this way?
Next step is to include those classes in Codename One build. So we did it by editing build.xml file and changed some classpath and adding some fileset on copy libs target. So te question is: is it good practice to change build.xml file this way?
Now if it is totally messed up what solution do You suggest?
For bouncy castle I know there already are compiled binary for Codename One. So I will try them. One thing that I already saw is that there are some missing classes when comparing orginal bouncy castle with codename one bouncy caste sources. I hope this will not be big problem.
For protostuff I came up with two solutions:
1. Create Codename One library project for them. But as I mentioned before they are using some core java classes that are missing in Codename One so question how to deal with it?
2. Remove protostuff. We are using it for object to json conversions but it can be done with core Codename One classes.
So before I start to reorganize this whole project I wanted to be sure that I am doing and getting this correctly.
Best regards.