Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7699169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:24:56+00:00 2026-05-31T22:24:56+00:00

I am creating a chat application for Gtalk using the asmack api, and i

  • 0

I am creating a chat application for Gtalk using the asmack api, and i want to get the messages when user goes offline, but gettting problems because of some problems in ServiceDiscoveryManager and its saying that feature not implemented(501) and tried to implements all the things which other users have same problem, but now i m getting this error. I am posting the code and logcat with this. any help appreciated.

 ConnectionConfiguration connConfig = new ConnectionConfiguration(
                    host, Integer.parseInt(port), service);
 connConfig.setSASLAuthenticationEnabled(true);
 connConfig.setSendPresence(false);
 connection = new XMPPConnection(connConfig);
 connection.connect();
 connection.login(username, password);
 ServiceDiscoveryManager sdm= ServiceDiscoveryManager.getInstanceFor(connection);
 mOfflineMessageManager = new OfflineMessageManager(connection);
 offlinemsgs = mOfflineMessageManager.getMessageCount(); 

this is the code where I call for offline messages just after login, and below is the response in logcat error:

03-16 11:26:53.871: W/System.err(325): feature-not-implemented(501)
03-16 11:26:53.881: W/System.err(325):  at org.jivesoftware.smackx.OfflineMessageManager.getMessages(OfflineMessageManager.java:210)
03-16 11:26:53.881: W/System.err(325):  at com.apache.android.xmpp.MainScreen.getOfflinemessages(MainScreen.java:911)
03-16 11:26:53.881: W/System.err(325):  at com.apache.android.xmpp.MainScreen$LogIn.doInBackground(MainScreen.java:612)
03-16 11:26:53.881: W/System.err(325):  at com.apache.android.xmpp.MainScreen$LogIn.doInBackground(MainScreen.java:1)
03-16 11:26:53.881: W/System.err(325):  at android.os.AsyncTask$2.call(AsyncTask.java:185)
03-16 11:26:53.881: W/System.err(325):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
03-16 11:26:53.881: W/System.err(325):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-16 11:26:53.881: W/System.err(325):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
03-16 11:26:53.881: W/System.err(325):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
03-16 11:26:53.891: W/System.err(325):  at java.lang.Thread.run(Thread.java:1096)

please help on this, trying to get the solution from many days but cant find any solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:24:57+00:00Added an answer on May 31, 2026 at 10:24 pm

    try this :

     ConnectionConfiguration connConfig = new ConnectionConfiguration(
                        host, Integer.parseInt(port), service);
     connConfig.setSASLAuthenticationEnabled(true);
     connConfig.setSendPresence(false);
     connection = new XMPPConnection(connConfig);
     connection.connect();
     connection.login(username, password);
     ServiceDiscoveryManager sdm= ServiceDiscoveryManager.getInstanceFor(connection);
    
    ////////////////////////////
    
        OfflineMessageManager offlineManager = new OfflineMessageManager(  
                        Client.getConnection());  
                try {  
                    Iterator<org.jivesoftware.smack.packet.Message> it = offlineManager  
                            .getMessages();  
                    System.out.println(offlineManager.supportsFlexibleRetrieval());  
                    System.out.println("Number of offline messages:: " + offlineManager.getMessageCount());   
                    Map<String,ArrayList<Message>> offlineMsgs = new HashMap<String,ArrayList<Message>>();    
                    while (it.hasNext()) {  
                        org.jivesoftware.smack.packet.Message message = it.next();  
                        System.out  
                                .println("receive offline messages, the Received from [" + message.getFrom()  
                                        + "] the message:" + message.getBody());  
                        String fromUser = message.getFrom().split("/")[0];  
    
                        if(offlineMsgs.containsKey(fromUser))  
                        {  
                            offlineMsgs.get(fromUser).add(message);  
                        }else{  
                            ArrayList<Message> temp = new ArrayList<Message>();  
                            temp.add(message);  
                            offlineMsgs.put(fromUser, temp);  
                        }  
                    }  
                    / / Deal with a collection of offline messages ...  
                    Set<String> keys = offlineMsgs.keySet();  
                    Iterator<String> offIt = keys.iterator();  
                    while(offIt.hasNext())  
                    {  
                        String key = offIt.next();  
                        ArrayList<Message> ms = offlineMsgs.get(key);  
                        TelFrame tel = new TelFrame(key);  
                        ChatFrameThread cft = new ChatFrameThread(key, null);  
                        cft.setTel(tel);  
                        cft.start();  
                        for (int i = 0; i < ms.size(); i++) {  
                            tel.messageReceiveHandler(ms.get(i));  
                        }  
                    }  
                    offlineManager.deleteMessages();  
                } catch (Exception e) {  
                    e.printStackTrace();  
                }  
    

    See this Like : http://community.igniterealtime.org

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a chat using Ajax requests and I'm trying to get messages
I am Creating a chat application using XMPP Framework in iPhone. I want to
I am creating a chat application using java sockets programming. I want to launch
I am creating a chat application using JApplet . I have a TextArea where
Let's say you're creating a database to store messages for a chat room application.
I am creating a chat application wherein I want to use smileys in the
I am creating a chat application the interacts between two users. I want to
I'm creating chat. This chat is refreshing every 2 seconds but in messages cold
I am creating a web chat application using asp.net vb. I have got the
I am creating a application with chat using java ,mongo database using servlet ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.