1. How do I install the PilotBean package?

2. How do I run the sample program?

3. Why do I get assertion exceptions about byte locations?

4. What is the format of the pilot directory?

5. What is the format of the username?

6. How do I write an application that uses PilotBean?

7. How do I instantiate a new PilotBean?

8. How do I find out what the current PalmPilot directory or username is?

9. How do I change the Pilot directory or username?

10. How do I add a memopad entry?

11. How do I add a datebook entry?

12. How do I find out the number of datebook entries?

13. How do I obtain the nth datebook entry?

14. How do I obtain the fields of a DatebookEntry?

15. How do I obtain the fields of a PilotDate?

16. How do I edit datebook entries?

17. How do I connect a MemoAddedListener?

18. How do I fix the following run-time errors?

19. I chose "Begin listening for new memos" and added a memo, and nothing happened. What's wrong?

20. I tried adding a memo or datebook entry and I received the following error message: "File not found: java.io.FileNotFoundException: "

21. I have a Memo/DateAddedListener; however, it does not detect the new memos or datebook entries that I add.


1. How do I install the PilotBean package?

  1. Move the pbeanv20.exe file to your preferred working directory and double-click on it to extract the PilotBean package. You should now have the following 7 files in in your working directory:
    README.txt
    pilotbean.jar
    FAQ.txt
    jpdn20.dll
    Sample.class
    Sample.java
    License.txt.
  2. Copy the file pdn20.dll, which can be found in the PalmPilot Desktop directory, into your working directory.
  3. Add the path [your_working_directory\pilotbean.jar] for the PilotBean.jar file to your CLASSPATH.

[Goto Top]

2. How do I run the sample program?

  1. At a DOS prompt, go to the PilotBean package directory.
  2. Type in the following command:
    java sample <pilot directory> <username>

[Goto Top]

3. Why do I get assertion exceptions about byte locations?

It is probably because your PalmPilot Desktop is not version 2.0. PilotBean version 2.0 currently requires PalmPilot Desktop version 2.0 file formats to process datebook entries.

[Goto Top]

4. What is the format of the pilot directory?

The pilot directory is the complete path of the directory in which the PalmPilot Desktop application is found. The path must be specified using forward slashes rather than the DOS standard of using back slashes. Also, the path must end in a forward slash.

Here is an example of a pilot directory path:

c:/progra~1/pilot/

[Goto Top]

5. What is the format of the username?

The username is the shortened name that the PalmPilot Desktop application uses to keep track of users. Usernames have the format in most cases. However, to confirm your username, look into the PalmPilot Desktop directory. In this directory, there should be a subdirectory for each user; the labels of these subdirectories are the usernames.

Here is an example username for someone named John Doe:

DoeJ

[Goto Top]

6. How do I write an application that uses PilotBean?

  1. Look at the Sample.java file to see examples of the various PilotBean functions.
  2. Write the application that you want to use PilotBean.
  3. Import the PilotBean package: "import com.ibm.pilotbean.*;"
  4. Move the jpdn20.dll and pdn20.dll files to the directory in which your application is found.
  5. Compile your application and run it.

[Goto Top]

7. How do I instantiate a new PilotBean?

PilotBean pilot = new PilotBean(String pilotDirectory, String username);

[Goto Top]

8. How do I find out what the current PalmPilot directory or username is?

pilot.getPilotDirectory();
pilot.getUsername();

[Goto Top]

9. How do I change the Pilot directory or username?

pilot.setPilotDirectory(String pilotDirectory);
pilot.setUsername(String username);

[Goto Top]

10. How do I add a memopad entry?

pilot.addMemo(String memo);

[Goto Top]

11. How do I add a datebook entry?


pilot.addDate(String date, String startTime, String endTime

		      String description, String note);



		- OR - 



pilot.addDate(PilotDate startDate, PilotDate endDate,

                            String description, String note);



		- OR -



pilot.addDate2(String date, String startTime, String duration

	       String description, String note);



* date (String) - <mm or m>/<dd or d>/<yyyy or yy>

* Time (String) - <thh or h>:mm<P or A or nothing>

* duration (String) - <hh or h>:mm

* note - this field is optional

[Goto Top]

12. How do I find out the number of datebook entries?

pilot.getNumDates();
pilot.getNumNewDates();
pilot.getNumUpdatedDates();

[Goto Top]

13. How do I obtain the nth datebook entry?

pilot.getNthDate(n);
pilot.getNthNewDate(n);
pilot.getNthUpdatedDate(n); Note: indexing starts at 0.

[Goto Top]

14. How do I obtain the fields of a DatebookEntry?

DatebookEntry dbEntry;

String description = dbEntry.description;
String note = dbEntry.note;
PilotDate startDate = dbEntry.startDate;
PilotDate endDate = dbEntry.endDate;

[Goto Top]

15. How do I obtain the fields of a PilotDate?

PilotDate date;

int year = date.getYear();
int month = date.getMonth();
int day = date.getDay();
int hour = date.getHour();
int minute = date.getMinute();

[Goto Top]

16. How do I edit datebook entries?

DatebookEntry entry;

pilot.appendDescription(entry, <String>);
pilot.appendNote(entry, <String>);
pilot.setStartDate(entry, <PilotDate>);
pilot.setEndDate(entry, <PilotDate>);

Note: Currently, calling the setDate methods on a repeated entry will not cause any modifications to be made to the datebook.dat file.

[Goto Top]

17. How do I connect a MemoAddedListener?

connect components within the Beanbox

- or -


	class SomeListener implements MemoAddedListener {



	  PilotBean pilot;



	  public SomeListener() {

	    pilot = new PilotBean("path", "username");

	    pilot.addMemoAddedListener(this);

	  }



	  public void memoAdded(MemoAddedEvent e) {

	    // do some stuff

	  }

	}

[Goto Top]

18. How do I fix the following run-time errors?

ERROR: "UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: no jpdn20 in shared library path"
SOLUTION: Be sure that the jpdn20.dll file is in the same directory as your application.

ERROR: "Error in loading DLL."
SOLUTION: Be sure that the pdn20.dll file is in the same directory as the pilot.jar file.

ERROR: "Can't find class sample"
SOLUTION: Make sure "." and the pilot.jar file are both in your CLASSPATH.

[Goto Top]

19. I chose "Begin listening for new memos" and added a memo, and nothing happened. What's wrong?

MemoAddedEvents are not caused until the files have been saved on the Pilot Desktop. Save your files from the Pilot Desktop.

[Goto Top]

20. I tried adding a memo or datebook entry and I received the following error message: "File not found: java.io.FileNotFoundException: "

This is actually not an error. This message is shown from time to time and is due to file access problems. The memo or datebook entry should have been added to the Pilot Desktop.

[Goto Top]

21. I have a Memo/DateAddedListener; however, it does not detect the new memos or datebook entries that I add.

The PilotMonitor that monitors the datebook.dat and memopad.dat files checks these files every sixty seconds; it may be that you did not wait long enough.

[Goto Top]