IoT | Smartphone App
iChipNet Smartphone (Android) App
This Android app was designed for the example below – a connected power socket – to show how to build an Android app that can access the Embedded Technology WiFi modules through the iChipNet cloud solution.
Below, are two Android Studio projects:
DCS_NEW.zip (download 17 Mbyte) is the whole connected power socket project including the source code, providing a programmer a complete working project to explore.
DCSLib.zip (download 9 Mbyte) is also a complete project that has the two classes code with an application to demonstrate how to use the classes.
The classes are DCSConnect.java and DCSDevice.java
A programmer can simply add these files to the application and use them to communicate with the DCS.
DCSConnect – this class will log on to the DCS using the Account name and Password supplied to it and will return a list of DCSDevice objects which contains the device data such as its S/N, online state, and the IP:PORT of the services available on the device such as Web Server, Listen sockets, LATI socket and Serial NET.
The sample application will log on to the “M2M” account and fetch all the devices on that account.
The DCSConnect class has only two methods on the public interface:
public void ConnectToDCS(String strAccount,String strPassword) – which takes the Account name and the Password as arguments.
This function will return immediately and initiate a thread to deal with the login authentication and fetching the devices.
It stores each device in a DCSDevice object and places all of the devices into a list.
public List<DCSDevice> getDevices() – this property will return the list of the devices fetched.
The DCSDevice class holds all the information available from the DCS about a specific device.
It has the following interface:
public String getSN() – returns the device Serial Number
public String getHSTN() – returns the device HSTN
public String getWWW() – returns the IP:PORT to connect to get to the device web server
public String getLATI() – returns the IP:PORT to connect to get to the device LATI Socket
public String getSNET() – returns the IP:PORT to connect to get to the device SerialNET socket
public String getLTCP1() – returns the IP:PORT to connect to get to the device Listen socket 1
public String getLTCP2() – returns the IP:PORT to connect to get to the device Listen socket 2
public String getOnline() – returns the device online status
For more information on using this Android app, please contact email@example.com