Major Announcement: HTML Tutorial How to intergrate Facebook and Twitter Share in your app !!

    Ok you know major games and apps have social network buttons that when the user presses the twitter or facebook icon , it takes them to twitter and facebook and post the link to their game thats what we are talking about. @Mark found the facebook intergration and @pixelpower (me) found the twitter intergration. What this means for you the developer is a %100 better chance at your game or app going viral. For now you do need to intergrate these social network buttons using an HTML homescreen. Before we start the link to the demo apk and a screenshot of twitter and facebook button on an andromo game.

Download APK here


" />

Ok the facebook intergration is easy , first I will post the code then explain it.

<img  src="fshare.png" onclick=location.href="";
style="position:absolute;left:0px;top:80px;height:60px;width:100px" />

<img src="fshare.png"   means I am placing a image onscreen as a button "fshare.png" is the name of the image I used.

onclick=   means I am making this image clickable

location.href=   means this is the website I want the button to open"  PLACE YOUR WEBSITE LINK HERE "

style="position:absolute;left:0px;top:80px;height:60px;width:100px"     this is to set the location of the button onscreen.

Now on to twitter intergration , the code is much longer but you only have to add the link.

<a href="" class="twitter-share-button"
data-text=" Super Mario Bros for #Android"
{var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
(document, 'script', 'twitter-wjs');</script>

All you have to change is

Super Mario Bros for #Android"


I advise you to just copy and paste my code then make the slight changes. Any questions just ask!!


  • Gonna give it a try but, instead of having a blank archive with two sharing buttons is there away to make it so when the link in the menu is clicked it will automatically redirect the end user? 
  • BTW I'm not using a html game so it's an app that will look stupid with a big white space and a small twitter icon?
  • edited September 2014
    Thanks for this.

    Does this share via their facebook app on their android device or via the web? i.e. I would think most visitors don't want to go to the web and login since they use the fb app on their device...

    Also, if I want someone to share from a web page (e.g. after they submitted a form from my app and now are on a thankyou page on my website) - can I use the same code?
  • This shares on the web but I never tested the app before. Yes you can share any web page using the facebook or the twitter.

    Also Pixelpower has been banned so he will not be able to come here and answer questions on the HTML posts.
Sign In or Register to comment.