-1

I am trying to send user's current location from android to the server and other mobile device. And to implement that, I am using XMPP.

So far I have successfully made a connection with the XMPP server from Android using asmack library. But now I don't know how can i send the current location of user to server and other android mobile device.

While searching i came across this XEP-0080, but I don't know how to use it.

So far i am planning to do

  1. connect with an XMPP server
  2. get the connected or online users
  3. share the location with all of them

Can anyone suggest me the road map to that ?

Flow
  • 23,572
  • 15
  • 99
  • 156
Hunt
  • 8,215
  • 28
  • 116
  • 256
  • Down voters please give a reason to do the same !! – Hunt Jul 31 '12 at 10:26
  • My guess is that the question got a downvote because it stopped at "I have a specification, but I *don't know how to use it*." It doesn't show your effort in understanding the spec. – Ben Companjen Apr 04 '13 at 23:01

1 Answers1

2

To follow that specification, you would simply

  • connect with an XMPP server
  • publish your location via PEP or pubsub

Using either method, the other users can then subscribe to the geo location node and they will receive the location events. You don't send them messages directly, but follow a pubsub model instead.

Robin
  • 24,062
  • 5
  • 49
  • 58
  • is there any difference between PEP and PUBSUB ? – Hunt Jul 31 '12 at 15:19
  • PEP is a subset of pubsub. It allows the user to logically be a pubsub service to which only they can publish. Other users can subscribe to what that user is now publishing. Pubsub is not tied to any particular user and can have multiple publishers for any given node. – Robin Aug 07 '12 at 13:46
  • how would you use PEP to send the location as per, say, XEP-0080, to a subset of the contacts on your roster? – Frederick Nord Oct 09 '18 at 23:46