share

Sharing a URL with a query string on Twitter

心不动则不痛 提交于 2019-11-27 17:13:57
I'm trying to put a Twitter share link in an email. Because this is in an email I can't rely on JavaScript, and have to use the "Build Your Own" Tweet button. For example, sharing a link to Google: <a href="http://www.twitter.com/share?url=http://www.google.com/>Tweet</a> This works fine. The problem I'm having is when the URL has a query string. <a href="http://www.twitter.com/share?url=http://mysite.org/foo.htm?bar=123&baz=456">Tweet</a> URLs with query strings confuse Twitter's URL shortening service, t.co. I've tried URL encoding this in various ways and cannot get anything to work. The

How to add facebook share button on my website?

放肆的年华 提交于 2019-11-27 16:43:39
I have this code that suppose to work, but doesn't work. If this helps you in anyway that would be great. <script src='http://connect.facebook.net/en_US/all.js'></script> <p><a onclick='postToFeed(); return false;'><img src="images/fb.png" /></a></p> <p id='msg'></p> <script> FB.init({appId: "338334836292077", status: true, cookie: true}); function postToFeed() { // calling the API ... var obj = { method: 'feed', redirect_uri:'https://www.facebook.com/cryswashington?fref=ts', link:'https://developers.facebook.com/docs/reference/dialogs/', picture: 'http://fbrell.com/f8.jpg', name: 'Facebook

Make my android app appear in the share list [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-11-27 14:14:36
问题 This question already has an answer here: How to make my Android app appear in the share list of another specific app 6 answers How do i make my application appear here? : some informations led me to put this code on my Manifest ( See code below ) but it doesn't work. The thing is if i want to share an image from my gallery, i want to see my app on the list of app on the share list. Any pointers? please help. <activity android:name="com.my.package.MyIntent" android:label="@string/app_name"

Share raw resource via WhatsApp

我是研究僧i 提交于 2019-11-27 14:14:19
问题 Intent share = new Intent(Intent.ACTION_SEND); share.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource://" + ContextID.getPackageName() + "/" + ResourceID)); share.setType("audio/*"); ContextID.startActivity(Intent.createChooser(share, "Condividi il suono")); The above code works fine with Gmail, while Whatsapp gives a toast message like "Share a file failed, please try it again" Maybe i've the same problem of this guy: Intent.ACTION_SEND Whatsapp But how can i temporarily copy my

How to pass a complex structure between C and Java with JNI on Android NDK

房东的猫 提交于 2019-11-27 14:02:06
问题 I have a complex strucutre in the C code on my Android application and I would like to use it in the Java side. I've done some research with google and in stackoverflow, so I've created the java class from my C strucutre, but now how to get it in Java. I've found these informations, about making a pointer in the class and use this on the C side : Get the field ID : (*env)->GetFieldID(...) Get the pointer : (*env)->GetLongField(...) Set the pointer : (*env)->SetLongField(...) But I don't

Sharing audio file

こ雲淡風輕ζ 提交于 2019-11-27 13:48:57
I'm trying to make a button for sharing an audio file. This is not working. First I tried to send the file right from my raw folder without copying it to the card of the phone. That didn't solve my problem. The second thing I tried, is saving the file to the phone and then share it. The part that saves the file to the phone works now, but when I try to share the audio file to another device all the compatible apps crash (Whatsapp, Gmail, etc). This is my code: String sharePath = Environment.getExternalStorageDirectory().getPath() + "/Soundboard/Ringtones/custom_ringtone.ogg"; Intent share =

Make Android app listen to shared links

五迷三道 提交于 2019-11-27 12:54:37
I want my Android app to appear listed as an option when the user shares an URL from another app (like the browser). How can I register my app to do that? How can I react to link shares? Thanks a lot. Edit: I've tried using IntentFilter like this without success: <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> </intent-filter> Any ideas? At the very bare minimum you need: <activity android:name=".ShareActivity"> <intent-filter android:label="Share with

Android 6: cannot share files anymore?

爷,独闯天下 提交于 2019-11-27 11:48:05
I am sharing an image, and this code works properly for devices before Android 6: Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("image/*"); Uri uri = Uri.fromFile(new File(mFilename)); shareIntent.putExtra(Intent.EXTRA_STREAM, uri); mContext.startActivity(Intent.createChooser(shareIntent, mChooserTitle)); However I get the toast error " can't attach empty files " when I try to share using Android 6. I verified that the file exists and it's not zero-length. Anyone has a solution for this? One limitation of the Android 6.0 runtime permission system is that there will

Sharing to facebook, twitter via share intent android

耗尽温柔 提交于 2019-11-27 09:54:04
问题 I am currently trying to share text to gmail, facebook and twitter. I am using share intent method to share. Below is the code i used to share Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("plain/text"); sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, "My text"); startActivity(Intent.createChooser(sharingIntent,"Share using")); The above code only show share options like gmail and skype. Why is facebook and twitter options not shown in the list even

Android share intent for facebook- share text AND link

我的梦境 提交于 2019-11-27 08:49:15
I am trying to use the Android share intent to post something on facebook. It looks like this: shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); shareIntent.setType("text/plain"); shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Free education for all! http://linkd.in/xU8mCc"); startActivity(shareIntent); So my post has both - some text and a link. But when the message is posted on facebook, it only has the link, no message. I tried various extras but nothing works. Anyone faced this issue and solved it? I have facebook app version 1.8.1 Edit: I tried removing the link, and the