How to enable Stream Management (XEP-198) in Smack 4.1.0-beta1?

909 Views Asked by At

connection.isSmEnabled() is always returning false.

Below is the code

            config=XMPPTCPConnectionConfiguration
                .builder()
                .setHost("host")
                .setPort(5222)
                .setServiceName("localhost")
                .setSecurityMode(SecurityMode.disabled)
                .setDebuggerEnabled(true)
                .build();

            connection=new XMPPTCPConnection(config);

            XMPPTCPConnection.setUseStreamManagementDefault(true);
            send.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) 
            {
                connection.setUseStreamManagement(true);
                Toast.makeText(getApplicationContext(), String.valueOf(connection.isSmEnabled()), Toast.LENGTH_SHORT).show();
                connectionss con=new connectionss();
                con.execute();
                //Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                //startActivityForResult(i, 1);
            }
            }   );

Pls help. I am trying to test smack 4.1 in android.

1

There are 1 best solutions below

2
On

This could be because of a bug in Smack 4.1.0-beta1. Try using beta2.