Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add app to "Share via" list for camera picture on Android

Tags:

I am building an app that starts when a user takes a picture using their build-in Android camera, then taps the Share button, then chooses my app as the sharer, which is expecting an incoming path to the picture that was just taken, which it uses for processing.

Question: how do I add an option to the "Share via" list that points to my app? Right now there are options like Facebook, Email, Messages, Twitter, Picasa, and I want to add my app w/ an icon.

I'm stuck! And, Google'ing for this is not easy, as "android add to share via list camera" yields a lot of results. I'm building the app with AppInventor (AI), but, AI does not allow developers to edit the Share via list, so maybe this will have to be a separate mini app that just adds to the list...? Hopefully not, because it'd be great to have just 1 app for users to download/install.

like image 699
Ian Davis Avatar asked Jan 12 '11 14:01

Ian Davis


People also ask

How do I add apps to share via?

If your Android device has Android 11 or 10, you can pin an app by long-pressing on the app, and the option to pin that app should appear. Once you're done with the first app, repeat the process for other apps you want to pin, and you're good to go.

How do I change share options on Android?

Choose who can share content with youFrom the top of your screen, swipe down. Tap Nearby Share . If you can't find Nearby Share , from the top of the screen, swipe down twice and tap Edit . Then drag Nearby Share to your Quick Settings.


1 Answers

Functions like the "share via" in Android work with broadcast intents. The app creates this intent and the system reports all the activities that can execute that (twitter, fb...) You specify what an activity can do by means of intent filters.

In your case I searched for "android camera share intent" and found generally that the intent filter looks like this:

<intent-filter>     <action android:name="android.intent.action.SEND" />     <category android:name="android.intent.category.DEFAULT" />     <data android:mimeType="image/*" /> </intent-filter> 

(not sure about the data section)

I don't know if camera app uses a specific content provider, anyway your app should be able to manage at least the URI scheme that app uses.

like image 114
bigstones Avatar answered Sep 23 '22 01:09

bigstones