try {
if (!apiManager.customize(this, "Hello World")) return;
if (myWriteToStream) {
String outputStreamName = apiManager.getOutputStream(".txt");
if (outputStreamName == null) return;
PrintWriter outputStream =
new PrintWriter( new FileOutputStream(outputStreamName));
outputStream.println(myMessage);
outputStream.close();
apiManager.openExternalViewer(outputStreamName);
}
else {
System.out.println(myMessage);
}
}
catch (Exception e) {
e.printStackTrace();
}