Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Infrastructure for Instant Messaging

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Infrastructure for Instant Messaging

    Hi , i read several articles about Infrastructure for Instant Messaging for android . i created an app of news and i'd like integrate an instant messaging app inside the app , but i'd like know which is the best way to do it quickly with jabber for exemple .
    what do you advise me ?
    thank you advance for your response


  2. #2
    Forum VIP
    Join Date
    Jun 2011
    Posts
    232
    My Mood
    Stressed
    Thanks
    36
    Thanked 66 Times in 54 Posts
    Blog Entries
    4

    Default Re: Infrastructure for Instant Messaging

    Brace yourself for the awesomeness that is Intents. You have probably used intents for starting activities but they can do a lot more that this. Basically, an app like Jabber will tell the operating system it is capable of doing something. Your app then requests the operating system does something like sending an email or sms. It constructs a list of all the apps that can achieve this action and lets the user choose which app to use.

    As a taster, here is some code to send an email:

    String subject = "Hi there";
    String message = "Java is cool.";
    Intent sendIntent = new Intent( Intent.ACTION_SEND );
    sendIntent.setType( "text/plain" );
    sendIntent.putExtra( Intent.EXTRA_SUBJECT, subject );
    sendIntent.putExtra( Intent.EXTRA_TEXT, message );
    _main.startActivity( Intent.createChooser( sendIntent, "Email:" ) );

    The putExtra() allows you to pass name/value pairs to the destination app. Read up on the list of standard extras in the intent documentation.

Similar Threads

  1. My instant messanger program doesn't work completely!
    By jabirfatah2009 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 28th, 2013, 04:11 PM
  2. Replies: 0
    Last Post: December 9th, 2012, 08:45 PM
  3. Spatial Data Infrastructure download service as Atom feed
    By asraf in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 3rd, 2012, 09:28 AM
  4. asynchronous communication instant messenger program......
    By mythicalone in forum Java Networking
    Replies: 3
    Last Post: November 14th, 2011, 09:33 PM