Skip to main content

Share Text To Facebook & Twitter ANDROID

Shaadi.com Indian Matrimonials

Before Create this app you must Have to create Application on FACEBOOK & TWITTER















Comments

  1. Can you provide the source code please ?

    ReplyDelete
    Replies
    1. source code is here : https://github.com/dhaval0122/Share_to_Facebook_twitter

      Delete
  2. Can we share an image with text also on twitter?
    Thanks in advance!!

    ReplyDelete
    Replies
    1. Yes you can using Twitpic jar file.

      for more detail see here: http://stackoverflow.com/a/10757209/1168654

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. He.I have added concumer key an consumer secret key in constants.java but still after pressing the login button to twitter in the app,its redirecting me to the same page.what else should I fill in the fields?

    ReplyDelete
    Replies
    1. show me your logs..... you have added permission on facebook app & twitter app??

      Delete
    2. Facebook sharing is working fine but the twitter sharing isnt working..I click the login button for twitter,it takes me to the webview to authorize my app,then comes back to the login button oage of my app but doesnt shares any thing..Below is my log...

      08-28 09:54:03.940: W/ResponseProcessCookies(478): Invalid cookie header: "set-cookie: guest_id=v1%3A137766384317537124; Domain=.twitter.com; Path=/; Expires=Fri, 28-Aug-2015 04:24:03 UTC". Unable to parse expires attribute: Fri, 28-Aug-2015 04:24:03 UTC
      08-28 09:54:03.959: I/ActivityManager(70): Starting: Intent { cmp=com.Background_fb_twitter/.Background_fb_twitterActivity } from pid 478
      08-28 09:54:03.959: W/ActivityManager(70): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { cmp=com.Background_fb_twitter/.Background_fb_twitterActivity }
      08-28 09:54:04.049: I/com.Background_fb_twitter.PrepareRequestTokenActivity(478): OAuth - Access Token Retrieved---2
      08-28 09:54:04.580: I/ActivityManager(70): Displayed com.Background_fb_twitter/.Background_fb_twitterActivity: +579ms
      08-28 09:54:04.690: D/kiran-> token(478): 1685102257-JZF8P5QOJ2UckO44bh35Vj4OWJI81iyXyanarZ6
      08-28 09:54:04.710: D/kiran-> secret(478): t9YyBInt4MNK84cdeqVdaO4ANPjAuOYw5GRRJmc8Xag
      08-28 09:54:04.710: D/acc_token :(478): AccessToken{screenName='null', userId=0}
      08-28 09:54:04.999: D/error dj-->(478): 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (http://support.twitter.com/forums/10711/entries/15364).

      08-28 09:57:42.101: D/SntpClient(70): request time failed: java.net.SocketException: Address family not supported by protocol

      Delete
    3. He Dhaval....Iam not able to execute your twitter sharing part of the code..I have even added both the keys into constant.java.Though the facebook sharing part is working properly..I cannot add the log over here hence kindly request you to go through the link I have given below....Thats my question I have posted in Stack Overflow...plz check and revert back...I haven't changed any thing in your code.....
      LINK--->http://stackoverflow.com/questions/18527044/not-able-to-login-to-twitter-and-share-the-text-through-my-application/18527120?noredirect=1#comment27248365_18527120

      Delete
    4. Plz reply...Im stuck on it since 3 days...

      Delete
    5. I ll respond you at you stack question please check this http://stackoverflow.com/q/18527044/1168654

      Delete
  5. What permissions Am I suppose to add for the twitter app?

    ReplyDelete
  6. give me share source code of android apps

    ReplyDelete
  7. give me share source code of android

    ReplyDelete
  8. Thank's you. I wan't share images to facebook.You can help me!

    ReplyDelete
  9. plz send the code how to text share in facebook

    ReplyDelete

Post a Comment

Popular posts from this blog

Android - Google MAP V2 PART 3 (add Polyline)

Download Full Code  of  PART-1 , 2 , 3 , 4 Before go ahead Please look in to PART-1 & PART-2 I have just modify Main Activity class: package com.djandroid.mapsv2; import android.graphics.Color; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.GoogleMap.OnMapClickListener; import com.google.android.gms.maps.GoogleMap.OnMarkerClickListener; import com.google.android.gms.maps.SupportMapFragment; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.Marker; import com.google.android.gms.maps.model.MarkerOptions; import com.google.android.gms.maps.model.Polyline; import com.google.android.gms.maps.model.PolylineOptions; public class MainActivity extends FragmentActivity { private GoogleMap MAP; private boolean markClic...

Android show Data from Sqlite DB into Grid View

Shaadi.com Matrimonials Shaadi.com Indian Matrimonials Your Main Activity class package com . Sqlite_grid_view ; import java . util . ArrayList ; import java . util . List ; import android . app . Activity ; import android . os . Bundle ; import android . util . Log ; import android . view . View ; import android . widget . AdapterView ; import android . widget . AdapterView . OnItemClickListener ; import android . widget . ArrayAdapter ; import android . widget . GridView ; import android . widget . TextView ; import android . widget . Toast ; public class AndroidSQLiteTutorialActivity extends Activity { private GridView gridView ; public static ArrayList < String > ArrayofName = new ArrayList < String >(); /** Called when the activity is first created. */ @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ); setContentView ( R . l...

Connecting mysql Database in ANDROID using PHP & JSON

 To implement this tutorial you should have basic knowledge of how to run PHP script and start server.  If we talk about client-server architecture, client is Android device and in server side there is a combination of PHP Script and MySQL. In short, PHP Script sits in middle as shown in image. Lets suppose that we have a MySQL database named Employee, and a table int created, with the following SQL: CREATE TABLE `employee` (   `emp_id` int(11) NOT NULL auto_increment,   `emp_name` varchar(100) NOT NULL,   PRIMARY KEY  (`emp_id`) ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; The PHP code will be very simple: Now Create Android Project :  The Android part is only a bit more complicated: -use a HttpPost to get the data -convert response to string -parse JSON data in to List In Your First Activity : O/P :