2

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.

Flow
  • 23,572
  • 15
  • 99
  • 156
Vignesh
  • 215
  • 3
  • 10
  • Hi,did you resolve this problem ? I can't use xep 198. – Tolgay Toklar Feb 10 '15 at 15:07
  • @TolgayToklar Updated ejabberd version to 14.x and verified streammanagement in configuration file.(by default it is enabled). This fixed the issue. – Vignesh Feb 26 '15 at 10:21
  • @Vignesh hi! can you let me know what is the key in config file of ejabbered to check streammanagement is configured or not – Ninad Sep 29 '15 at 13:53

1 Answers1

0

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

Flow
  • 23,572
  • 15
  • 99
  • 156
  • Thanks a lot flow,will try beta2 and update this post. I have another question. How do we send server time in the stanza. We want to maintain the server time like in whatsapp – Vignesh Feb 06 '15 at 15:51
  • same issue with beta2. – Vignesh Feb 07 '15 at 09:25