How to remove all applications from android cache programmatically? - android

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.

Related

How to set my app as contacts default app in android programmatically

I have developed an android Contact application (To view, edit, delete and call contacts)
How can I set an app as default in android programmatically ?
please help me,
Thanks in Advance.
There's no notion of a "default contacts app", if your app can handle certain intents (for example adding a new contact) Android will show an app selector dialog to the user asking which app they choose to complete the action, the user can also select that app to be used automatically in the future.
If your app is also a Phone app, then there is a way to ask the user to make it the default Phone app, see: Replace default phone APP
If you're referring to the "Contacts" app launcher on the user's homescreen, there's no way to make it launch your own app, you need the user to manually remove the existing launcher and drag your app to their homescreen in its place.

App Links inside Custom Tabs in the same app

I am facing a problem where I'm loading some web pages in Custom Tabs, and I want to use App Links when going to a certain page to open the native app. From my investigation, it looks like if the page is open with Custom Tabs in the same application (same package name) as the settings for the App Links, it does not work.
To give you the real life example, I am using Custom Tabs for a "Sign up" flow, letting the user to enter his credentials in a web page, but when going to the next page where it should tell the user to check his email for the confirmation, I want to take the user to the native app, to a custom activity with the Android App Links.
Any suggestions of how to overcome this problem?
Found the problem in my case. If you run into the same problem, check that all your intent filers are verified on the domain.

Add to Calendar link from website to mobile app

Is there a way to create a link from a responsive website that would open and add an event to the app installed on a mobile phone or tablet?
For example, this event on a responsive website. Whenever the "Add to Calendar" button is clicked on a mobile device, the event needs to be added to an installed app, be it in iOS or Android. Also if there are numerous apps installed like Google Calendar, Outlook, and/or iCal, the device should show a prompt to the user asking what app should be used if there are no default app selected.
I could do this by generating an .ics file on click but that would mean more taps and navigation for a user. Any help or comments would be appreciated.
Thank you.

Tracking sharing on 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

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