I was able to glean a lot of information from the printexample project in the SDK and I would recommend anyone looking for printer information to look there first for a good look at implementation. It still seems that you are able to pass the PrintService a text input stream or formatted html and it will work just fine. I still don't see any thorough documentation on what different ways the InputStream can be formatted.
The PrintService must register as a component of the bundle and must be registered in the bundle.permissions file as well. As I have implemented it thus far, the main Profile (GoudaProfile) has a callback function that sets the PrintService member variable when it becomes available and sets it to null if it is not available. From there the GoudaProfile constructs a MeetingPrinter object by passing the PrintService member variable to the MeetingPrinter Constructor.
Gavin took care of the Google API's and he created the main data class which is Meeting.java. He used the builder pattern but the way he implemented it, each builder can only build a single object so if you want multiple objects you must create multiple builders.
Meeting.Builder expects a certain date-time format for it's argument which is based off an ISO standard but a simple example of something I used to mock a Meeting object was 2013-10-30T14:00:00-05:00
Today Gavin and Daniel will be coming over here to work on the project further and we will soon be moving the printer back to Marksbury so that we can all VLC into it.
Here is the test code i usedc to mock meeting objects and send them to the MeetingPrinter
//Create a new meeting object
Meeting.Builder builder = new Builder(DateTimeZone.UTC, false);
builder.host("Batman", "b@tman.com");
builder.name("Deep voice lessons");
builder.startDatetime("2013-10-30T10:00:00-05:00");
builder.endDatetime("2013-10-30T11:00:00-05:00");
Meeting meeting = builder.build();
Meeting.Builder builder2 = new Builder(DateTimeZone.UTC, false);
builder2.host("Batman", "b@tman.com");
builder2.name("Play COD with Robin");
builder2.startDatetime("2013-10-30T13:00:00-05:00");
builder2.endDatetime("2013-10-30T14:00:00-05:00");
Meeting meeting2 = builder2.build();
if(printService != null) {
MeetingPrinter meetingPrinter = new MeetingPrinter(printService);
meetingPrinter.print(new Meeting[]{meeting, meeting2});
}
No comments:
Post a Comment