aSmack Ad-Hoc Command in Android

I am doing a project on android-aSmack and I want to implement ad-hoc commands in it, so when I am sending an ad-hoc command it is Ok but for receiving it I have an error, in sender console the error is “Forbidden” and when I am checking in debug window , after sending command the sender receives the xml code from receiver app which include a line with “Error Type = auth” . I’d appreciate if someone can help me.

problem solved!

There was a stupid thing… when you create a class for registering command , the class should be extends “LocalCommand” and it will override automatically too many methods.

one of those methods is “hasPermition()” and by default is returning “false” , I just changed it to true and everything works perfectly.