Hover API Rest SDK for Java bindings
Welcome to the Hover SDK for Java, this SDK is for building a robust java application based on the Hover API. The Hover SDK for Java makes it easy to integrate a full Hover API services into java apps. All documentation about classes, methods, etc.. are published into a javadoc
- Java JDK 1.6 or higher
- Maven (if you use pom.xml)
- Dependency Gson for json serialization
Add the dependency in your pom.xml if you are using Maven, otherwise build all sdk/src code into a single jar file as a library and then add to your project.
First configure the logging, providing the absolute path where hover_sdk.log.* will be created, the logs are in a
rotate way so each 1 MB the log file increases by 1
Logs.initialize("/Users/zgbjgg/Desktop");The configuration for the sdk is based on an properties file where you must provide:
- HTTP connection configuration
- API access parameters
- Credentials
Configuring your sdk is easy, just create a file called sdk-java.properties like placed on resources and add to your application.Now provide the absolute path to properties file for loading as a resource,
// SDK initializaton
SDKTools.initialize("/Users/zgbjgg/sdk_config.properties");Now the SDK is ready to use!!
All requests to the RESTful API on the SDK are made using a serialized class, so, each request has their own translation from json to class, for example: to register a single user use User class and its attributes instead build a json file.
NOTE: If you want add more attributes to any serialized class, then just extends from the desired class.
All responses from the RESTful API on the SDK are managed by Response class, this class stores the HTTP Status Code, the raw response (json, xml, etc ...) as a string and the body response casted to a desired class.
For example if you register a user, then your response instance stores the serialized object, just provide the class to map:
User userInfo = (User) response.getBodyT(User.class);.
Under test directory exists a bunchet of code snippets that allow testing diferent scenarios and shows you how to use the API with the SDK.
- Profiles
- Creating a profile
- Fetching profiles
- Updating profile
- User
- Creating basic user
- Creating user with login
- Fetching user info
- Login
- Checking availability
- Checking color and fetching data
- Merge
- Merging users
- Fetching merged
- Nfc
- Assigning nfc to user
- Fetching assigned nfc cards
- Updating nfc info
- Notifications
- Creating user notification
- Fetching all notifications
- Fetching specific notification
- Mark notification as read
You can find more info about courses of how to use the API, SDK's or integration of Hover into your app, visiting us at: http://www.thehover.com or mail us: [email protected]