devicehive / devicehive-android Goto Github PK
View Code? Open in Web Editor NEWDeviceHive Android example
License: Apache License 2.0
DeviceHive Android example
License: Apache License 2.0
I think I found a bug when device is trying to register.
When device registers returns status code 204, from documentation for RESTful protocol 1.3.1 -
"204 No Content: Requested operation completed successfully and there is no resource in the response body (typically for DELETE operations)."
So according to this i think that code 204 is successful status code and need to be in isSuccessStatusCode(int statusCode) in network/NetworkCommand.java. So on line 171
FROM:
protected boolean isSuccessStatusCode(int statusCode) {
return statusCode == 200 || statusCode == 201;
}
TO:
protected boolean isSuccessStatusCode(int statusCode) {
return statusCode == 200 || statusCode == 201 || statusCode == 204;
}
When the code is 204 and it has no resources in the body, an exception is raised, because responce.getEntity() returns null and toString cannot parse it. So on line 209 I suggest
FROM:
String responceString = EntityUtils.toString(responce.getEntity());
TO:
try {
responceString = EntityUtils.toString(responce.getEntity());
} catch (IllegalArgumentException iae) {
responceString = "";
}
Please look at this bug, and if it is real bug please fix it.
When trying to get deviceId from with
GetDeviceEquipmentStateCommand.getDeviceId(resultBundle), an error is returned that states that expected result was String, but it got Parcelable instead.
The simple fix is to make a change in the following line:
GetDeviceEquipmentStateCommand: 96
from getParcelable(...) to get String().
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.