share

How to share a file in Android programmatically

守給你的承諾、 提交于 2019-11-29 02:53:23
问题 I want to share a file(.pdf,.apk etc) using share Intent, I searched google but I find only the code for sharing Image Intent sharingIntent = new Intent(Intent.ACTION_SEND); Uri screenshotUri = Uri.parse(path); sharingIntent.setType("image/png"); sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri); startActivity(Intent.createChooser(sharingIntent, "Share image using")); 回答1: You use the same code, you just change the MIME type for the type of data you wish to share. If you wish to

How to send a photo to Instagram using my Android app?

强颜欢笑 提交于 2019-11-28 23:16:45
问题 My app take photos and I want to share in Instagram. My app save the image in this directory File storagePath = new File(Environment.getExternalStorageDirectory() + "/DCIM/Camera/tubagram"); Now I'm trying to get the last picture I taked to share in Instagram using this code Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); shareIntent.setType("image/*"); final ContentResolver cr = getContentResolver(); final String[] p1 = new String[] {MediaStore.Images.ImageColumns._ID,

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

允我心安 提交于 2019-11-28 22:08:35
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" android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.ALL

Google+ share with custom text and thumbnail

会有一股神秘感。 提交于 2019-11-28 22:08:31
While creating sharing links for facebook, you can personalize a sharing link by doing something like : <a title='Share on Facebook' href='http://www.facebook.com/sharer.php?s=100 &p[title]=TITLE_HERE &p[summary]=TEXT_HERE &p[url]=URL_HERE &p[images][0]=URL_TO_IMAGE' target='_blank' > <img alt="Facebook" src="ICON_URL" /> </a> Is there a way to do something similar with Google+, instead of having to fill the meta tags in the header (because I need many sharing links in one page) You can use schema.org microdata for that. These are not tags made in the site's head, but instead properties you

Share raw resource via WhatsApp

我只是一个虾纸丫 提交于 2019-11-28 22:08:07
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 resources on sd card and then share them? File dest = Environment.getExternalStorageDirectory();

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

半世苍凉 提交于 2019-11-28 21:39:20
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 understand how it really works ... Above, you can find what I've done until now ... not so much ! On the C

android youtube: share a youtube video TO my app?

こ雲淡風輕ζ 提交于 2019-11-28 21:17:04
问题 The built in YouTube App for tablets has a sharing-option. For example: I watch a video in the YouTube app and click the button to share . Bluetooth, Googlemail, and Dropbox appear for me. I wonder how i can list my app there ? Which intent-filter has my app to have? How do i get the video url then? Any idea? Thanks. 回答1: This worked for me. Add this intent filter to your manifest file to make your application appear in the share list of the youtube application. <intent-filter> <action

Create Google Maps links based on coordinates

不打扰是莪最后的温柔 提交于 2019-11-28 16:59:43
问题 How can I create Google Maps links based on coordinates. Their new basic share urls contain a lot of parameters, for example - https://www.google.com/maps/place/Vetlanda,+Sweden/@57.4217311,15.0849255,13z/data=!3m1!4b1!4m2!3m1!1s0x465758d912d321b5:0x55675191e550be84?hl=en Any ideas? Not looking to embed but just to create external links that can be shared. 回答1: Why not http://www.google.com/maps/place/lat,lng I think this is the simplest way http://www.google.com/maps/place/49.46800006494457

Sharing to facebook, twitter via share intent android

寵の児 提交于 2019-11-28 16:45:44
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 though i had the facebook and twitter application installed in my device? I don't know if anybody still

Share link on Google+

旧巷老猫 提交于 2019-11-28 16:36:47
Is it possible to share/post to Google+ without using the +1 button? e.g. Like a normal tweet button works with a url link: http://twitter.com/share?url=httpetcetcetc tgkokk Yes, you can. https://plus.google.com/share?url=YOUR_URL_HERE Edit: It works only with eff.org . Edit: As of March 2012 it works on all sites. Documentation for this sharing method is available on the Google Developers site . New Google share link: http://plus.google.com/share?url=YOUR_URL For secure connection: https://plus.google.com/share?url=YOUR_URL For Wordpress: https://plus.google.com/share?url=<?php the_permalink(