SamLib - Basic4ppc and Samsung Mobile Phones


Active Member
Licensed User
This is version 0.9 (beta release) of SamLib - a Basic4ppc library that adresses Samsung Phones. SamLib lets you develop for phones such as the Samsung Omnia and similar devices and use specific features:Haptics, Orientation indication, camera flash, LEDs, Accelerometer, FM Radio, and the light sensor that feels the current illuminance outside. Proximity sensor is not implemtnetd by Samsung on their SDK yet, hence not included. Also not included are some features I thought are of less interest: wheel key, optical mouse, TV out, Slider, R2VS, and some advanced camera features that anyway need DirectShow support. Feel free to ask for these features, if you want them, and more and I'll try to help.

This library requires Basic4ppc 6.8 or later. It supports both Desktop and Device. The values returned from the functions when running on the desktop will usually be -10 (see the SamErrors object for error codes in this dll).

Please note this is a preliminary beta release. There are probably bugs. Any feedback is greatly appreciated. Especially note that the RDS functions of the FM radio are not implemented on this version, though their signatures exist.

In the zip:
- SamLib.dll
- 2 cab files - the Samsung SDK - you should install the right one, see help file
- Help file - important to read
- Sample program - SamTest.sbp. All functions are demonstrated there - a good source to see the way of using the functions. It requires bList.dll from the following thread here.
- An image for the sample.
*** - Once a final release is published, I will of course attach the source code for merging.

I wish to thank Benjamin Gramüller for his invaluable help in the development of this dll.

EDIT 10/10/09
Version 0.91 attached - the "Resources" object is removed.


Installation instructions:
Copy the SamLib.dll to the Libraries folder, and to your device.
Install the right cab file on your device - consult the help file "overview" section for information.


Last edited:


Licensed User
Well done and very interesting Ariel. Thank you.

I wish HTC would do the same as Samsung i.e make their SDK:s available.


Active Member
Licensed User
There are some leads on the web. I'm into gathering details now, but I cannot assure anything will come out of this...


Active Member
Licensed User
As I wrote in the thread you referred to, I'll fix it - I plan to do it tomorrow - you are right :).
Last edited:


Licensed User
Ariel, library update isn't planned?
Not bad to add a Orientation3D class for access obtaining to Position structure.

Has tried to make by self to create lib with Orientation3D class.

New1 - create object
GetHeading () as Integer -
The yaw or azimuth angle, or rotation of the phone on its vertical axis. The value starts at 0 when the phone is facing magnetic north, and increases as the phone is turned clockwise. For example, a phone facing east has a heading of 90, the south 180, the west 270. The maximum heading value is 359.
GetPitch () as Integer -
The angle the phone is rotated on its lateral axis. The value is an integer from -180 to 179. Pitch is zero when the phone is face up; it increases as the top edge of the phone is moved downward, and decreases when the top edge is moved upward.
GetRoll () as Integer -
The angle the phone is rotated on its longitudinal axis. The value is an integer from -90 to 90. Roll is zero when the phone is face up; it increases when the right edge of the phone is moved downward, and decreases when the right edge of the phone is moved upward.

GetAccuracy () as Integer -
Calibration level percentage. Values are from 0-100, with 0 = not calibrated, and 100 = fully calibrated.
Last edited: