title: android how to send and receive image and location (using map ) in group chat using xmpp-smack
body: <p>i developing group chat app using android-xmpp, in that i don't know how to send and recive pics-image or location (using map).</p>
  
  <p>So any one one can please give me way to do these.</p>
  
  <p>currently , i got text message and add to list view , like following ,</p>
  
  <pre><code>Message msg = new Message(to, Message.Type.groupchat);
  msg.setBody(text);
  if (Constants.connection != null) {
      try {
          Constants.connection.sendPacket(msg);
          Log.d("Send to room  : Name : ", to);
          Log.d("store", "store data to db");
          //DBAdapter.addUserData(new UserData(text, "", "1" ,beam_id));
      } catch (Exception e) {
          Log.d("ooo", "msg exception" + e.getMessage());
      }
  
      messages.add(text);
  
      runOnUiThread(new Runnable() {
          public void run() {
             // set to listview
              setMyChatAdapter();
          }
      });
  }
  </code></pre>
  
  <p>and receive using StanzaTypeFilter. So how for image and location sharing ?</p>
  
  <p>I try following code for image using  FileTransferManager , using <strong>smack-extensions-4.1.3-sources.jar</strong> . </p>
  
  <pre><code> private void sendImage()
   {
  
    FileTransferManager mg=new FileTransferManager(Constants.connection);
    OutgoingFileTransfer transfer = mg.createOutgoingFileTransfer(beam_id+"@"+Constants.conference_name + "/" + Constants.resources);
    File file = new File(selectedImagePath);
    try {
        transfer.sendFile(file, "test_file");
    } catch (Exception e) {
        e.printStackTrace();
    }
    while(!transfer.isDone()) {
        if(transfer.getStatus().equals(FileTransfer.Status.error)) {
            System.out.println("ERROR!!! " + transfer.getError());
        } else if (transfer.getStatus().equals(FileTransfer.Status.cancelled)
                || transfer.getStatus().equals(FileTransfer.Status.refused)) {
            System.out.println("Cancelled!!! "+ transfer.getError());
        }
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    if(transfer.getStatus().equals(FileTransfer.Status.refused) || transfer.getStatus().equals(FileTransfer.Status.error)
            || transfer.getStatus().equals(FileTransfer.Status.cancelled)){
        System.out.println("refused cancelled error"+ transfer.getError());
     } else {
        System.out.println("Success");
     }
  } 
  </code></pre>
  
  <p>But when i access that file using following ,</p>
  
  <p><strong>FileTransferManager mg=new FileTransferManager(Constants.connection);</strong></p>
  
  <p>it give me error <strong>... has a private access of ...</strong> So , i find constructor of that file is private , this is jar file so i can not change it to public .</p>
  
  <p>So, how can i access that file-class into my class ?</p>
  
  <p>So, how can i share(send-receive) image and location message in chat ?</p>
  
  <p>Please help me as soon as possible.</p>
  
  <p>Thanks in advance.</p>