@@ -0,0 +1,1369 @@
+package edu.cmu.cs.cloudlet.android.discovery;%0A%0Aimport java.net.URL;%0A%0Aimport org.json.JSONException;%0Aimport org.json.JSONObject;%0Aimport org.teleal.cling.model.meta.Device;%0Aimport org.teleal.cling.model.meta.RemoteDevice;%0A%0Aimport edu.cmu.cs.cloudlet.android.util.KLog;%0A%0Apublic class CloudletDevice %7B%0A%0A%09private String ipAddress;%0A%09private boolean isUPnP;%0A%0A%09public CloudletDevice(Device device) %7B%0A%09%09URL address = ((RemoteDevice) device).getIdentity().getDescriptorURL();%0A%09%09this.ipAddress = address.getHost();%0A%09%09this.isUPnP = true;%0A%09%7D%0A%09%0A%09public CloudletDevice(JSONObject device)%7B%0A%09%09this.isUPnP = false;%0A%0A%09%09try %7B%0A%09%09%09this.ipAddress = device.getString(%22ip_address%22);%0A%09%09%09double latitude = device.getDouble(%22latitude%22);%0A%09%09%09double longitude = device.getDouble(%22longitude%22);%0A%09%09%7D catch (JSONException e) %7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(Object o) %7B%0A%09%09if (this == o)%0A%09%09%09return true;%0A%09%09if (o == null %7C%7C getClass() != o.getClass())%0A%09%09%09return false;%0A%09%09%0A%09%09CloudletDevice that = (CloudletDevice) o;%0A%09%09if (this.ipAddress == that.ipAddress)%0A%09%09%09return true;%0A%09%09else%0A%09%09%09return false;%0A%09%7D%0A%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09%0A%09%09return %22Cloudlet at %22 + this.ipAddress; %0A%09%09%0A%09%09// For UPnP%0A%09%09// return device.isFullyHydrated() ? device.getDisplayString() : device.getDisplayString() + %22 *%22;%0A%09%7D%0A%0A%09public String getIPAddress() %7B%0A%09%09return this.ipAddress;%0A%09%7D%0A%0A%7D

Add class for representing founded devices from discovery service