Coder Social home page Coder Social logo

devicehive-android's People

Contributors

edubovik avatar maxim-kiselev avatar vyrostkov avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devicehive-android's Issues

Unhandled status code 204 and unhandled exception - bug ?

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.

GetDeviceEquipmentStateCommand - bug when getting deviceId

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().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.