How to post a message on linkedin in android? -
i new android.in application , there requirement when click on share button need share on linked in wall.how can ? please can 1 me.
thanking in advance.
well using socialauth android posting messages on linkedin , twitter.
and more basic approach can go through this
here example socialauth :
first have download socialauth-android-sdk-2.0.zip here
then copy jar dist folder , paste in libs folder of project.
now,
register application on linkedin , api key , secret key
copy file "oauth_consumer.properties" assets folder of zip assets folder of project , edit file , write api key , secret key in linkedin section
#linkedin api.linkedin.com.consumer_key = ************* api.linkedin.com.consumer_secret = **************
also drawable of linkedin example provided in example folder of zip.
finally, change activity accordingly (activity given below),
public class shareactivity extends activity implements onclicklistener { edittext sharetext; socialauthadapter shareadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.share_layout); button = (button) findviewbyid(r.id.share); button.setonclicklistener(this); imageview product_image = (imageview) findviewbyid(r.id.share_image); sharetext = (edittext) findviewbyid(r.id.share_text); shareadapter = new socialauthadapter(new responselistener()); shareadapter.addprovider(provider.linkedin, r.drawable.linkedin); } @override public void onclick(view v) { switch (v.getid()) { case r.id.share: shareadapter.authorize(this, provider.linkedin); break; } } private final class responselistener implements dialoglistener { @override public void oncomplete(bundle values) { shareadapter.updatestatus(sharetext.gettext().tostring()); toast.maketext(getapplicationcontext(), "message posted", toast.length_short).show(); } @override public void onerror(socialautherror e) { log.v("share", "omg error!!!!" + e.getmessage()); } @override public void oncancel() { // toast.maketext(share.this, "cancelled", // toast.length_short).show(); } @override public void onback() { // toast.maketext(share.this, "back", toast.length_short).show(); } } }
Comments
Post a Comment