Sometimes we want to set default application for some certain actions.(Just like building associations) Following figure shows the dialog of setting default app for audio player.
You can use
Default App Manager or change the setting manually.(refer
here for
more
information)
Following figures show the UI of Default App Manager.
Recently I came up with an idea about how to set default app for various categories via Tasker.
After looking up information and doing several tests, I can make it through now. Hereinafter I will show you how.
Note that you can't set default app in the background silently in Android.
You can callout the dialog of setting default app for various categories after sending specific intent parameters to com.android.internal.app.ResolverActivity. Intents are messages of android applications somehow. You can send intents via the “Send Intent” action directly or “Run Shell” action with specific commands. I suggest you’d better use the “Run Shell” action, because some intents may need some specific limits of authority.(Don’t forget “Run Shell” action have option of using root while “Send Intent” just act as usual) Here we go!
<app.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.apk" -t "application/vnd.android.package-archive" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<audio.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.mp3" -t "audio/*" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<audiostream.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "http:///null.mp3" -t "audio/*" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<video.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.mp4" -t "video/*" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<videostream.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "http:///null.mp4" -t "video/*" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<image.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.jpg" -t "image/*" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<image.GetContent.Resolver>
Run Shell [ Command:am start -a android.intent.action.GET_CONTENT -d "file:///null.jpg" -t "image/*" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<image.Crop.Resolver>
Run Shell [ Command:am start -a com.android.camera.action.CROP -d "file:///null.jpg" -t "image/*" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<browser.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "http://null.com" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<calender.Edit.Resolver>
Run Shell [ Command:am start -a android.intent.action.EDIT -t "vnd.android.cursor.item/event" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<email.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "mailto:" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<epub.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.epub" -t "application/epub+zip" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<mobi.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.mobi" -t "application/x-mobipocket-ebook" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<doc.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.doc" -t "application/msword" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<docx.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.docx" -t "application/vnd.openxmlformats-officedocument.wordprocessingml.document" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<ppt.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.ppt" -t "application/vnd.ms-powerpoint" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<pptx.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.pptx" -t "application/vnd.openxmlformats-officedocument.presentationml.presentation" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<xls.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.xls" -t "application/vnd.ms-excel" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<xlsx.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.xlsx" -t "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<pdf.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.pdf" -t "application/pdf" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<txt.View.Resolver>
Run Shell [ Command:am start -a android.intent.action.VIEW -d "file:///null.txt" -t "text/plain" -n "android/com.android.internal.app.ResolverActivity" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
<launcher.Main.Resolver>
Send Intent [ Action:android.intent.action.MAIN Cat:Home Mime Type: Data: Extra: Extra: Package:android Class:com.android.internal.app.ResolverActivity Target:Activity ]
You can make a scene to list every one of the “resolver” task above showing as an icon. Every icon is bind to specific task to perform. Then you can set default app for specific categories when the correspondent icon is taped.
Following figure shows a simple UI of my creation.
Note:
1. AFAIK, you can’t retrieve the default app name for specific categories
via Tasker.
2. You can try
this tip, if you want to "Control which app is the default for an action (root only)".