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 672563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:29:55+00:00 2026-05-14T00:29:55+00:00

I would like to create a simple XMPP client in java that shares his

  • 0

I would like to create a simple XMPP client in java that shares his location (XEP-0080) with other clients.
I already know I can use the smack library for XMPP and that it supports PEP, which is needed for XEP-0080.
Does anyone have an example how to implement this or any pointers, i don’t find anything using google.

thanks in advance.

  • 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-14T00:29:56+00:00Added an answer on May 14, 2026 at 12:29 am

    Kristof’s right, the doc’s are sparse – but they are getting better. There is a good, albeit hard to find, set of docs on extensions though. The PubSub one is at http://www.igniterealtime.org/fisheye/browse/~raw,r=11613/svn-org/smack/trunk/documentation/extensions/pubsub.html.

    After going the from scratch custom IQ Provider route with an extension I found it was easier to do it using the managers as much as possible. The developers that wrote the managers have abstracted away a lot of the pain points.

    Example (modified-for-geoloc version of one rcollier wrote on the Smack forum):

    ConfigureForm form = new ConfigureForm(FormType.submit);
    form.setPersistentItems(false);
    form.setDeliverPayloads(true);
    form.setAccessModel(AccessModel.open);
    
    PubSubManager manager 
          = new PubSubManager(connection, "pubsub.communitivity.com");
    Node myNode = manager.createNode("http://jabber.org/protocol/geoloc", form);
    
    StringBuilder body = new StringBuilder(); //ws for readability
    body.append("<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>");
    body.append("   <country>Italy</country>");
    body.append("   <lat>45.44</lat>");
    body.append("   <locality>Venice</locality>");
    body.append("   <lon>12.33</lon>");
    body.append("   <accuracy>20</accuracy>");
    body.append("</geoloc>");
    
    SimplePayload payload = new SimplePayload(
                                  "geoloc",
                                  "http://jabber.org/protocol/geoloc", 
                                  body.toString());
    String itemId = "zz234";
    Item<SimplePayload> item = new Item<SimplePayload>(itemId, payload);
    
    // Required to recieve the events being published
    myNode.addItemEventListener(myEventHandler);
    
    // Publish item
    myNode.publish(item);
    

    Or at least that’s the hard way :). Just remembered there’s a PEPManager now…

    PEPProvider pepProvider = new PEPProvider();
    pepProvider.registerPEPParserExtension(
        "http://jabber.org/protocol/tune", new TuneProvider());
    ProviderManager.getInstance().addExtensionProvider(
       "event", 
       "http://jabber.org/protocol/pubsub#event", pepProvider);
    Tune tune = new Tune("jeff", "1", "CD", "My Title", "My Track");
    pepManager.publish(tune);
    

    You’d need to write the GeoLocProvider and GeoLoc classes.

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

Sidebar

Ask A Question

Stats

  • Questions 367k
  • Answers 367k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem with the DataContext is that it isn't designed… May 14, 2026 at 4:46 pm
  • Editorial Team
    Editorial Team added an answer I think you need to move the ORDER BY outside… May 14, 2026 at 4:46 pm
  • Editorial Team
    Editorial Team added an answer In your example you haven't closed your <ul> properly (missing… May 14, 2026 at 4:46 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.