How to Sharing Content To Media Social with Intent in Android

    



           Almost android application have sharing content function for share information application to media social, why this module very popular? because you need many users to join on your application, you don't use all your power and capability for that. your users will automatically invites his friend to join.
           there are many ways for create sharing content.first way,you can use all media social sdk like google+, facebook and others , but thats taking long time and you must create  key hash, registration your app to all media social  and put different code .
        Second way, import other a media social's library to your application, but you will increase the file size of the built. the minimum standard size of media social's library from example github is 3 until 5 mb, so big right .
         Third way , using intent for open all social media installed in your device. if you only need simple sharing, this is The fastest way and takes 1 hours for making your module. so  will give tutorial for create sharing function using intent in android, please follow my step

First Step : Create new project and put "shareintent" as project's name 

  
and then you click button next and follow the procces until your project succesfull to created.

Second Step : Create Design layout in content_main.xm like this image or you can use all your creativity for make it. 



Add this code into content_main.xml  : 



Third Step : Put the code in MainActivity.java for add action to yout button, then the subject and the message will post to your media social.


Fourth Step : Running your project on your device or emulator.
       
        When you was running your project, dont forget to input subject and message that you want share like this :

After that, click red button and  will show the intent chooser


        I tried to pick my email to share content to friends. subject and the message that I have written, will be moved in the email box in your gmail. please look image below :



             
             Easy enough right? you dont need spend many time for create that and make your apps more fast finish. Thank you for read , please share this articles and add your comment

Share this

Related Posts

First