ItempApi overview
ItempApiPub is the public control API for Itemptechnology boards. It lets your
Android application drive device functions the standard SDK does not reach:
power scheduling, GPIO, display, network, kiosk lockdown and debug switches.
How it works
Every function is a static method on ItempApiPub. You do not create an
instance and you do not hold a handle.
import com.itemp.itempapi.ItempApiPub;
// That's the whole calling convention. No setup, no connect step.
ItempApiPub.reboot(context);
ItempApiPub.setScreenBrightness(context, "200");
Under the hood each call sends an Android broadcast Intent to a system service built into the firmware. That design has three consequences you must keep in mind, because they shape how every function on this reference behaves.
1. Most calls return void and do not report success
A call hands a request to the system service and returns immediately. It does not wait for the action to finish and it does not tell you whether it worked.
ItempApiPub.setStaticIp(context, "192.168.1.50", "192.168.1.1",
"255.255.255.0", "8.8.8.8", "1.1.1.1");
// Returns instantly. The IP change happens a moment later, asynchronously.
// If the arguments were wrong, nothing is thrown — the request is just ignored.
Where you need to confirm a result, use the matching getter if one exists
(getUsbDebugStatus, getGpio0) or read the effect back through a normal
Android API. Do not assume a setter succeeded because it did not crash.
2. A few calls read the device directly
The GPIO getters are the exception to the broadcast model — they read a sysfs file on the device rather than sending a broadcast, and so they return a value synchronously. See GPIO for the path and its caveats.
3. The action runs in a privileged system service
Each call is handled by a system service that runs with elevated privileges on our firmware. Your app does not need to hold the underlying system permission itself — it just sends the broadcast, and the service does the privileged work. See Permissions and signing for why this is simpler on our boards than on a standard Android device.
Permissions and signing
On a standard Android device, the privileged actions in this API — hiding the system bars, blocking installs, scheduling power — would require your APK to be signed with the platform key or the device to be in owner mode. That is a real obstacle on most hardware.
Our firmware runs with root (SU) privileges, so that obstacle is removed. The system service that handles these broadcasts already holds the elevated rights it needs. Your app does not have to be platform-signed and the device does not have to be in owner mode.
In practice this means:
- A normally-signed APK — even a debug build — can call every function here and it will take effect.
- You do not need our platform key to build a product on these boards.
- The full API, including the lockdown and power functions, is available from a standard app install.
Because the firmware is rooted, these calls really do what they say with no
safety net. powerOff, setUsbStorageBlock, intallBlock in whitelist mode
and the bar-hiding calls can lock a device down hard. Always build in a way back
in (a hidden gesture, a timed unlock, network ADB you can reach) before you
deploy a locked-down unit to the field.
Import
import com.itemp.itempapi.ItempApiPub;
The API ships with the firmware. Add the provided library to your module — see the downloads section of the support page for the artifact.
What is on this reference
| Section | Functions |
|---|---|
| Power and schedule | Reboot, power off, sleep, timed on/off |
| System time | Set clock and date, NTP, auto-time |
| Display | Brightness, rotation, backlight, HDMI, screenshot |
| GPIO | Set outputs, read inputs |
| Network | Static IP, DHCP, Wi-Fi hotspot |
| Debug | USB/network ADB, log capture |
| Kiosk and lockdown | Hide bars, block install, block USB storage |
Conventions on every page
- Signature — the exact static method.
- Parameters — including the string formats the firmware expects (many
arguments are strings like
"0"-"23", not ints). - Example — a real call you can paste.
- Notes — timing, silent-failure behaviour, and anything that bites.
Arguments are frequently strings even when they represent numbers — hour is
"0"-"23", brightness is "0"-"255". Passing an int will not compile. Each
page states the format per parameter.