ASQUARETE

Chainway's Obsolete SDK API: Migration Notes

Chainway (SDK family-wide) · Android · Updated Jul 18, 2026 · Device SDK

Chainway's sample repositories across its UHF handheld line still demonstrate RFIDWithUHF, a class the SDK's own build marks deprecated in favor of RFIDWithUHFUART. This guide maps every commonly used obsolete call to its current replacement so migrations don't happen method-by-method under production pressure.

Every Chainway UHF handheld — C72, C71, C66, C5, and others in the same UART-based reader family — ships sample code built around RFIDWithUHF. Every one of those SDK builds also marks that same class deprecated, pointing at RFIDWithUHFUART as the forward-compatible replacement. Almost no integrator reads far enough into the SDK's Javadoc-equivalent comments to notice.

Device photo — Chainway UHF handheld reader family, multiple models
Chainway's UART-based UHF handheld line — shared SDK, shared deprecation

What the vendor docs don't tell you

The deprecation isn't a rumor or a forum post — it's an annotation in the SDK's own class definition. It just never made it into the sample apps that most integrators actually copy from.

What the docs don't tell you

RFIDWithUHF was retained for backward compatibility with apps built against Chainway's earliest UHF SDK generation, before the company standardized on a UART transport layer across its handheld line. New devices are validated against RFIDWithUHFUART internally; RFIDWithUHF receives no further testing beyond "does it still compile," which means edge-case behavior (buffer overflow handling, reconnect-after-sleep) can silently diverge between the two classes on newer firmware even when both technically still run.

Why this matters for production

A demo app that works during a five-minute vendor evaluation and a production deployment that runs eight hours a day for a year are different reliability bars. The obsolete API's untested edge cases are exactly the paths that only surface under sustained production load — buffer overflow during a long inventory session, reconnect behavior after the device sleeps, and UART port contention across app restarts.

Migration map

Obsolete (RFIDWithUHF)Current (RFIDWithUHFUART)Notes
new RFIDWithUHF()RFIDWithUHFUART.getInstance()Current class is a singleton; do not attempt to instantiate directly
.init(context).init()UART variant does not take a context parameter in most SDK builds
.uhfGetTagInfo().readTagFromBuffer()Naming and return-type shape both changed; check nullability handling
.startScan().startInventoryTag()Functionally equivalent trigger for antenna sweep
.stopScan().stopInventory()Equivalent teardown call
.close().free()Must be called in onPause(), not only onDestroy(), to release the UART port reliably
.setPower(int).setPower(int)Signature unchanged; range still 5–30 dBm on most firmware

Migration steps

Migrating a live app off RFIDWithUHF is mechanical if the reader access is already isolated behind a wrapper class, and a larger refactor if it isn't.

// Before
class LegacyRfidManager(private val context: Context) {
    private val reader = RFIDWithUHF()
 
    fun start() {
        reader.init(context)
        reader.startScan()
    }
 
    fun read(): TagInfo? = reader.uhfGetTagInfo()
 
    fun stop() {
        reader.stopScan()
        reader.close()
    }
}
 
// After
class RfidManager {
    private val reader = RFIDWithUHFUART.getInstance()
 
    fun start(): Boolean {
        val ok = reader.init()
        if (ok) reader.startInventoryTag()
        return ok
    }
 
    fun read(): UHFTagInfo? = reader.readTagFromBuffer()
 
    fun stop() {
        reader.stopInventory()
    }
 
    fun release() {
        reader.free()
    }
}
  1. Isolate all direct RFIDWithUHF calls behind a single manager class if they aren't already — this is the highest-leverage refactor for the migration and pays for itself on the next SDK bump too.
  2. Swap the class reference and method names per the migration map above.
  3. Add an explicit release()/free() call to the hosting Activity or Fragment's onPause(). The old .close() call was more forgiving about when it ran; .free() on the UART class needs to run before the process can be backgrounded safely.
  4. Re-test the trigger-key integration path specifically — keycode handling didn't change, but any code that assumed RFIDWithUHF's buffer behavior around rapid trigger press/release cycles should be re-verified against the UART class's buffer semantics.

Common errors

ErrorCauseFix
App builds and runs fine on RFIDWithUHF, then reads stop after a firmware updateDeprecated class's edge-case behavior diverged from RFIDWithUHFUART on newer firmwareMigrate to RFIDWithUHFUART proactively rather than reactively after a firmware-triggered failure
NoSuchMethodError after migrating partwayMixed calls from both classes left in the codebaseGrep the codebase for RFIDWithUHF( (not RFIDWithUHFUART) to find any remaining direct instantiations
UART port locked after migration.free() not called where .close() used to beConfirm release()/free() is wired into onPause(), not just onDestroy()
Buffer behavior differs under rapid trigger pressesBuffer semantics differ subtly between the two classesRe-test trigger-key rapid press/release specifically post-migration; don't assume parity from the migration map alone

FAQ

Why does Chainway still ship sample code using a deprecated class?

Sample repositories lag SDK releases across most hardware vendors, not just Chainway. The demo code was written against an earlier API generation and updated selectively; the deprecation notice lives in the SDK's Javadoc-equivalent comments, not in the sample.

Is RFIDWithUHF still functional, or does it fail outright?

It still functions on most current firmware — deprecation is a forward-compatibility warning, not a removal. Treat it as a ticking clock: new firmware revisions are not guaranteed to keep supporting it.

Do I need to rewrite an entire app to migrate off RFIDWithUHF?

No. The migration is localized to the reader-access layer if the app was structured with a repository or manager class wrapping SDK calls. Apps that call RFIDWithUHF directly from Activities or Fragments will need broader refactoring first.

Does the obsolete API produce different tag data than the current one?

The underlying tag data (EPC, RSSI) is equivalent. The differences are in lifecycle methods, buffer-draining method names, and initialization patterns — not in the radio-level data itself.

Asquarete · Published Jul 18, 2026 · Updated Jul 18, 2026

Related guides

Stuck on this device?

Feasibility read in 24 hours.

Get a feasibility read