So on the high level I have learned that all things are packaged into things called bundles, these bundles are managed by the OSGi framework. Each bundle has an activator that is run when the bundle is being prepared for use. When the bundles activator has completed the framework gives control to dependent bundles callback that is listening for the activation to be complete. Bundles must declare their dependencies explicitly in their manifest and must also say the cardinality of the dependency.
The Print Service API is really simple though it is not well documented. I gained most of my knowledge by looking at the example app in the sdk which showed that it was possible to print from a url by getting a handle to an inputStream object that contains the html of the webpage. I took this concept further and constructed a string and from that a String into an InputStream via the following code:
// convert String into InputStream
inputStream = new ByteArrayInputStream(str.getBytes());
No comments:
Post a Comment