DDH Software, LLC Making a big world smaller






Return to Knowledgebase Home
HanDBase API (HAPI) Documentation
Product: Article Number: 74Creation Date: 12/03/2001
HAPI Documentation

The HanDBase API, known hereafter as HAPI, was created to allow Palm OS software developers a simple way to interface their applications with HanDBase Databases. An example of this implementation is the PocketReport program, which lets the user format a report template, and then grabs data from selected HanDBase databases to print or email in the report.

Functions available for users are as follows:
HapiGetDBNames - Returns a list of HanDBase databases installed to the handheld at the present time.
HapiGetDBInfo - Returns various information about a specific HanDBase database, including the field names and types, and the number of records in the database.
HapiGetFieldValue - Returns the text value of a specific field in a specific record.
HapiGetLinkInfo - Returns the link information for a specific field in a specific record (used in conjunction with HapiFindNextLinkedRecord).
HapiFindNextLinkedRecord - retrieves the next linked record number that belongs to a specific link field.
HapiSetFieldValue - Set a specific field of a specific record to a passed text value.
HapiSetRecordValue - Set all fields in a specific record to an array of passed text values.
HapiGetRecordValue - Get all fields in a specific record into an array of passed text values.
HapiCreateDatabase - Create a new HanDBase Database, using the database name, field names and types passed.
HapiAddRecord - Add a new record and set all fields in a specific record to an array of passed text values.

Instructions on adding HAPI capability to your Application
1. Download the HAPI Library from here.. Save the file and extract (using WinZIP, Stuffit, ZipCentral or 7-Zip) to your source directory.
2. #include the hapicall.h header file in your code. (eg, #include "hapicall.h")
3. Add the hapicall.c source file to your project or Makefile. The last routine in the file is an exhaustive example of reading records from all databases, so you may want to delete that function to save space in your final .PRC file.
4. Call the wrapper functions in hapicall.c, making sure to pass the proper parameters, and check the return values that come back.

That's all there is to it! Please email devsupport@ddhsoftware.com with any questions you have, and please do let us know if you do implement support for HanDBase in your application so that we may add a reference to your program on our site.

If you are interested in software development using HanDBase as a tool, please visit our Developer's Resource Center. It is designed to provide the tools, documentation and SDKs needed in order to use key features of our products.

Update 12/16/2003
Library files updated for HanDBase 3.0!
The HAPI files have been updated to support HanDBase 3.0, you may download them from the link in the article above or from here.. If you have a previous project and wish to update it to support 3.0, please read the hapicall.c file for minor changes you need to apply in your software.

HAPI 3.0 Sample Project!
For those new to HAPI (and old users wanting to get a few pointers), we have a sample project available to download. It shows basic items like creating a database and adding a record, as well as advanced stuff like recursing through a set of Link/Linked databases. Make sure you read the README.txt file! The project was built using Metrowerks Codewarrior, but the actual source files should be compatible with GCC for PRC-Tools developers. Download the project from here..


This article has been viewed 465201 times.

Return to Knowledgebase Home