I am trying to receive a file using the asmack jar. I am able to receive text on my android device with no problem but when I set up the file transfer I get an error saying that "does not support file transfers". The listener is never being called... I set up my listener like this:
if (m_connection != null)
{
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
if (sdm == null)
{
sdm = new ServiceDiscoveryManager(connection);
sdm.addFeature("http://jabber.org/protocol/disco#info");
sdm.addFeature("jabber:iq:privacy");
}
// new ServiceDiscoveryManager(connection);
FileTransferNegotiator.setServiceEnabled(connection, true);
FileTransferManager manager = new FileTransferManager(m_connection);
manager.addFileTransferListener(new FileTransferListener() {
public void fileTransferRequest(final FileTransferRequest request)
{
Log.i("InstallerActivity", "Got new File!!!");
EDIT: Added these to make it work:
pm.addIQProvider("si", "http://jabber.org/protocol/si", new StreamInitiationProvider());
pm.addIQProvider("query", "http://jabber.org/protocol/bytestreams", new BytestreamsProvider());
pm.addIQProvider("open", "http://jabber.org/protocol/ibb", new IBBProviders.Open());
pm.addIQProvider("close", "http://jabber.org/protocol/ibb", new IBBProviders.Close());
pm.addExtensionProvider("data", "http://jabber.org/protocol/ibb", new IBBProviders.Data());
pm.addIQProvider("open", "http://jabber.org/protocol/ibb", new OpenIQProvider());
pm.addIQProvider("data", "http://jabber.org/protocol/ibb", new DataPacketProvider());
pm.addIQProvider("close", "http://jabber.org/protocol/ibb", new CloseIQProvider());
pm.addExtensionProvider("data", "http://jabber.org/protocol/ibb", new DataPacketProvider());