I have use alljoyn for wifi share. I want device list connected to wifi network on channel base.
I have follow one demo but it not call implemented method announced
AboutListener
is part of alljoyn.
import org.alljoyn.bus.AboutListener;
public class OnboardingApplication extends Application implements AboutListener {
@Override
public void announced(String busName, int version, short port, AboutObjectDescription[] objectDescriptions, Map<String, Variant> aboutMap) {
Map<String, Object> newMap = new HashMap<String, Object>();
try {
newMap = TransportUtil.fromVariantMap(aboutMap);
String deviceId = (newMap.get(AboutKeys.ABOUT_APP_ID).toString());
String deviceFriendlyName = (String) newMap.get(AboutKeys.ABOUT_DEVICE_NAME);
m_logger.debug(TAG, "onAnnouncement received: with parameters: busName:" + busName + ", port:" + port + ", deviceid" + deviceId + ", deviceName:" + deviceFriendlyName);
addDevice(deviceId, busName, port, deviceFriendlyName, objectDescriptions, newMap);
} catch (BusException e) {
e.printStackTrace();
}
}
}
In order to get the announced method called you'll need to register your AboutListener:
mListener is your object that implements AboutListener.
When you call whoImplements(null) you are saying you want all announcements from all interfaces.