SOXLibs for multi programming languages
Java&Android SOX Library
- How to setup for Java Application / How to setup for Android Application
- Latest version for developer (GitHub)
- Download JSoxLib v1.5 beta (best for soxfire xmpp server). For ejabberd server, please use v1.0.
- Examples
JavaScript SOX Library
iOS SOX Library (Objective-c)
- iOSSoxLib v0.2 Application Template (Cross-domain SOX federation is now supported.)
- iOSSoxLib Samples (iOSSoxLib v0.2) (Cross-domain SOX federation is now supported.)
Python SOX Library (only internal developers)
Examples of SOX APIs
We provide complementary client-side APIs for different programming languages including Java, Javascript, Objective-C and python. SOXFire libraries hides complex XMPP communication and existence of two types of nodes _meta and _data, and enables users to access virtual sensors in simple ways. Followings are usage examples of Java SOXFire API.
Connecting to a SOXFire server
SoxConnection con = new SoxConnection(“server-name.org”);
Getting virtual sensors list
//get the list on connected server
ListnodeList = con.getAllDeviceList(); //get the list on federated server
ListnodeList2 = con.getAllDeviceList(“other-server.org”);
Associating a virtual sensor to SoxDevice object
//associate to virtual sensor on connected server
SoxDevice sd = new SoxDevice(con, “sensor_name”);//associate to virtual sensor on federated server
SoxDevice sd2 = new SoxDevice(con, “sensor_name”, “other-server.org”);
Getting meta data information from _meta pubsub node
Device deviceInfo = sd.getDevice();
Retrieving last sensor data from _data pubsub node
Data data = sd.getLastPublishData();
Subscribing the sensor and handling data to be published
sd.subscribe();
sd.addSoxEventListener(this);
…
public void handlePublishedSoxEvent(SoxEvent e){
Listvalues = e.getTransducerValues();
//then write processing of the data
}
Those APIs are object oriented, and share almost the same class hierarchy among different programming languages, so various kinds of applications can be developed easily on, for example, smartphones (both iOS and android), web pages and PCs.