Tracking sharing on Android - android

I'm working on an app which has a share button. On click of share i'll show the standard share screen like below,
I want to know, if it is possible to track if user click on this screen. For example, if user clicks on facebook, i want to know that user selected facebook for sharing.

I want to know, if it is possible to track if user click on this screen
No, unless you create your own chooser activity.
For example, if user clicks on facebook, i want to know that user selected facebook for sharing.
That is only possible if you create your own chooser activity, rather than use the system-supplied one. You can create such an activity using PackageManager and queryIntentActivities().

From this dialog this is not possible. It is possible to put this sharing into the actionbar with a ShareActionProvider.
With ActionBarSherlock this will work on all devices down to Android 2.2. Now you can check wich app was chosen for tracking. Have a look at the ShareActionProviderSample from Actionbarsherlock

Related

get post event from share dialog

Hi I have functionality in my app where I have to do some code on event when user shares my app.
So basically on tap share icon androids default share indent will open which will show installed apps through which user can share(e.g whatsapp, Facebook, gmail) then user will select any of the above app and then once he shares app i need that event of sharing post.
Please help me to achieve this functionality.

How to share image from my app on Facebook

I want to allow users to share image from my app on Facebook. Say I already have an image (i.e. file path). How do I go about letting a user share it on Facebook? Basically I want the user to agree once. Then from there on, whenever the user takes a certain action in my app, share a particular image on Facebook on behave of the user. Notice that the image is to be shared automatically without the user having to take action each time; so the Facebook sharing is incidental to some other action in my app. I am looking at the Facebook documentations. It is not clear which path to take to accomplish what I need. So thanks for any guidance.
Again, the user agrees once and goes on her merry way. Then the app, each time a user takes a certain action, share an image on Facebook.
UPDATE
Here is the path I have identified for sharing a photo on behalf of a user
Setting up your app to use Open Graph
Creating an Open Graph Story
Posting with API calls
The problem with this approach is that, at least in the sample project, the user has to click on Share each time. But I don't want the user to have to click on share each time. I want them to give me permission once. And then from there the app shares for them automatically.
Trial and error is expensive here as it is a lot to implement just to see if it were what I was looking to do: Which is why I am asking here, hoping someone here has done this in the past and don't mind sharing their experience.
You should ask the user for the publish_actions permission, and then use Request.newUploadPhotoRequest to publish a photo. https://developers.facebook.com/docs/reference/android/current/class/Request/#newUploadPhotoRequest
You need uses-permission Facebook, try this; https://developers.facebook.com/docs/android/getting-started
After you do this, you need to take method onClick and send the picture directly for facebook, but for this, is necessary the login of user's.

How to remove all applications from android cache programmatically?

Please I need some help with this.
What I want is to remove all apps from cache when, for example, press a button.
Let's say that I have opened Whatsapp, Gmail , Fb and my Custom App. When pressed a button from my custom app, I want to clean all the apps that I opened before (Whatsapp, Gmail, Fb).
Is it possible?
Thanks.

Is it possible to change apps icons in share dialog using createChooser?

I use createChooser() to allow user to share photo. When user clicks Share button, dialog with applications appears. What I want is to have a dialog with installed applications to share (like Gmail, BT, Email, Facebook, etc) but with my custom icons.
Is it possible to change those applications icons and set my own icons?
Thanks!
Only by making your own chooser, using PackageManager and queryIntentActivities() to get the available options, and rendering the results how you wish.

open another browser in spite of default browser

hiii..i m developing an app in which as user click on a link it should prompt the user to open link in myAppbrowser (which i will create) or default browser(like activity chooser do).
as user click on default browser app prompt again that, 'this page cant open in default browser'.
after that the browser which i make should run...
how to implement this....plz help me
Depends.
If the user clicks on your link, from one of the browsers (which aren't made by yourself), then no: It's not possible for security reasons. Android is designd to have the user choose which app he want's to use to open a certain Link (better term would be: Intent).
If the user clicks on a link in a WebView you created, then it may be possible to intercept that link and create a custom selection screen (or directly send it to your App without asking for a choice). I've forgot which method of WebView you need to override to intercept link clicks, have seen it somewhere here on Stackoverflow, just don't have the link atm.

Categories

Resources