On the Terminal API Quickstart page, the first snippet of code shows how to “Create device code”.
And when you select Java (for my Android application), it gives this code:
DeviceCode deviceCode = new DeviceCode.Builder("TERMINAL_API")
.name("Counter 1")
.locationId("NHT...CGJ")
.build();
CreateDeviceCodeRequest body = new CreateDeviceCodeRequest.Builder("123-456-789", deviceCode)
.build();
devicesApi.createDeviceCodeAsync(body)
.thenAccept(result -> {
System.out.println("Success!");
})
.exceptionally(exception -> {
System.out.println("Failed to make the request");
System.out.println(String.format("Exception: %s", exception.getMessage()));
return null;
});
However, when I add that code to my Android application, I get these errors:
- Cannot resolve symbol ‘DeviceCode’
- Cannot resolve symbol ‘CreateDeviceCodeRequest’
- Cannot resolve symbol ‘devicesApi’
So is there an SDK I should be using that will resolve these unknown classes?