I am trying to get last offline time of a particular jabberId by this piece of code.
LastActivityManager lActivityManager = LastActivityManager.getInstanceFor(MessageService.getConnection());
lActivityManager.isLastActivitySupported(to + "@localhost");
Log.v(TAG, "Last Activity: " + lActivityManager.getLastActivity(to + "@localhost"));
LastActivity activity = lActivityManager.getLastActivity(to + "@localhost");
But I am keep getting service-unavailable exception. I have checked the server configuration but this feature is implemented correctly from server side.
Have you added other jabber id as your roster. If not try adding them then check. If you are using ejabbered then you can manually add roster from their admin panel for testing. I used this code snippet to add roster--