Re: Change Default Application

661 views
Skip to first unread message

TomL

unread,
Dec 21, 2012, 8:44:53 AM12/21/12
to tas...@googlegroups.com
TLDR: maybe, if you have root and SecureSettings plugin.

Here's one way to do it.

Apps register when they're installed information about what kind of mimetypes they can be used for.  So, browser apps, when you install them, tell the system that they can be used to open urls.

When you click on an url, if you have a default app defined for a mimetype, then that app will be launched.  If you don't currently have a default app selected, then you get the system dialog where you get to choose an app to open, with an option to make that the default app.  If there's only one app that's registered for that mimetype, then even if you didn't select it as your default app, then it''ll launch that app.

So, the trick is to disable (freeze) the other browsers apps, so that the one browser you want is the only browser left enabled on your phone.  If you have root, and have the Secure Settings plugin, then look at the Secure Settings Root Action > Package State.  

Does that make sense?

Tom



On Friday, December 21, 2012 4:24:32 AM UTC-5, Thomas Toumpoulis wrote:
Is there any way to change the default application for opening URLs through Tasker?

(What I want to do is open URLs with Opera Mini while I 'm on mobile network and with Chrome while I 'm on WiFi.)

Richard Davis

unread,
Dec 21, 2012, 8:47:29 AM12/21/12
to tas...@googlegroups.com

> Is there any way to change the default application for opening URLs through Tasker?

Did you try just 'load app' with the URL in the data field?
This does not work for my browser but it is worth a shot....

Rich..

Message has been deleted
Message has been deleted

Thomas Toumpoulis

unread,
Dec 21, 2012, 9:54:08 AM12/21/12
to tas...@googlegroups.com
Sorry for the deleted posts. First time using Google Groups...

@Tom
Just tested it and it actually works!

But I would like to only set the app as the default rather than disabling the rest. That 's because I have also installed Chrome (for the syncing features) and Phone 2 Google Chrome which also handles URLs.

So if anyone comes up with a better solution, I 'd be glad to hear it.

Richard Davis

unread,
Dec 21, 2012, 10:27:55 AM12/21/12
to tas...@googlegroups.com

> But I would like to only set the app as the default rather than disabling the rest. That 's because I have also installed Chrome (for the syncing features) and Phone 2 Google Chrome which also handles URLs.

You can disregard my earlier suggestion, I misunderstood our post. For some reason the second half was in very fine print on the bottom..

Any way.. android makes difficult enough to try to change a default without tasker, I can't imagine tasker being able to directly change a default app..

I guess you would have to elaborate on why Toms brilliant solution would not work for you.  You stated that you want to change the default browser depending on wifi/mobile data so when and how would you like to choose another browser to open your URLs?  I can not imagine tasker would not be able to do this for you..

I would think with this work around you could make your own browser picker which would certainly be easier to use that the android method..

I would actually use this my self for other reasons but I am not rooted :(

Rich..

Thomas Toumpoulis

unread,
Dec 21, 2012, 10:47:00 AM12/21/12
to tas...@googlegroups.com
Any way.. android makes difficult enough to try to change a default without tasker, I can't imagine tasker being able to directly change a default app..
There is an app that does that, but it's not tasker-compatible.
 
I guess you would have to elaborate on why Toms brilliant solution would not work for you.  You stated that you want to change the default browser depending on wifi/mobile data so when and how would you like to choose another browser to open your URLs?  I can not imagine tasker would not be able to do this for you.. 
I would think with this work around you could make your own browser picker which would certainly be easier to use that the android method..
Actually I want:
On WiFi > Default App "Internet"
On Mobile Network > Default App "Opera mini"
But on the same time I want all the browsers enabled.


I just contacted Secure Settings dev and he informed me that the "setting default app" feature is already on his list. So I 'm probably going to wait for this.

GermainZ

unread,
Dec 21, 2012, 10:51:59 AM12/21/12
to tas...@googlegroups.com
Take a look at this.
Either use intents (not sure if that can be done) to do it or use java/sl4a.


On Friday, December 21, 2012 11:24:32 AM UTC+2, Thomas Toumpoulis wrote:
Is there any way to change the default application for opening URLs through Tasker?

TomL

unread,
Dec 21, 2012, 10:52:29 AM12/21/12
to tas...@googlegroups.com
You only have to disable apps sometimes, the rest of the time you can have all the apps enabled.

Let's say you have 3 url handling apps. App1 is the one you use the most, the one you want left as default.  App2 you use when you're outdoors, away from wifi.  And App3 is another app you use rarely too.

State 1: for when you want any url  to launch App1. You achieve this by having all url-handling apps enabled. Your phone will be in this state most of the time.

State 2: when you want to force an url to use App2.  You achieve this state by disabling App1 and App3.

The amount of time your phone spends in State1 versus State2 is proportional to how frequently you want to use App2 vs App1.


PS: By the way, the Package Status feature of SecureSettings is marked as "careful, use at own risk".  I would recommend installing TitaniumBackup, as it can disable(freeze) and reenable (thaw) packages too.

I think it's safe to muck with disabling browser apps, but certainly you can get into a world of hurt if you don't know what you're doing.  I've heard of people uninstalling all their Home Launchers and getting locked out of their phones.  

 
Tom

GermainZ

unread,
Dec 21, 2012, 10:57:48 AM12/21/12
to tas...@googlegroups.com
I'm fairly certain they both use the same method, Titanium Backup just doesn't tell you it's dangerous.
Plus, the risk is only there when doing it to system apps.

Also, this method won't work for the OP. He wants to set the default app while being able to change at any time.

TomL

unread,
Dec 21, 2012, 10:58:05 AM12/21/12
to tas...@googlegroups.com
What's the name of the app that can change defaults?

I would be wary of any app that has the ability to silently change handler defaults.  Google took that ability away from their api (addPreferredActivity) probably because it was a security risk.  Any app that can quietly alter default handlers can allow man in the middle attacks to steal passwords or other sensitive user data.

Tom

GermainZ

unread,
Dec 21, 2012, 11:03:23 AM12/21/12
to tas...@googlegroups.com

Thomas Toumpoulis

unread,
Dec 21, 2012, 11:07:17 AM12/21/12
to tas...@googlegroups.com
I would be wary of any app that has the ability to silently change handler defaults.  Google took that ability away from their api (addPreferredActivity) probably because it was a security risk.  Any app that can quietly alter default handlers can allow man in the middle attacks to steal passwords or other sensitive user data.
 
https://market.android.com/details?id=com.appiator.defaultappmanager

Tom is probably right. This is the app I was talking about, but what it does is clear the defaults and trigger the android's method of selecting an app.

GermainZ

unread,
Dec 21, 2012, 11:13:01 AM12/21/12
to tas...@googlegroups.com
You can do that using Tasker.
Message has been deleted

TomL

unread,
Dec 21, 2012, 11:20:00 AM12/21/12
to tas...@googlegroups.com
Ah, I've actually paid for the pro version of that app.  Very nice app. Yes, Tasker can clear an app's default handling if you select the app from the list, but Tasker won't show you a list of all registered app handlers, which Default App Manager will.  Worth the few bucks.

The only other way to achieve the effect you want without the hoop jumping of other-app-disabling is to find the intent used to launch that app's activity, and to pass in your url as part of the data field.  Tasker can do this, if you can find the app's intent activity syntax.  Use Tasker > Action > Load App.  Select Opera.  In the Data field of the Load App dialog, type in "http://www.google.com".  This, for me on GB, launches Opera to that url even though I have another browser registered as the default url handler.

Which is what Rich originally suggested at the top of this thread. :)

Tom

Richard Davis

unread,
Dec 21, 2012, 8:41:34 PM12/21/12
to tas...@googlegroups.com

> You can do that using Tasker.

>> Tom is probably right. This is the app I was talking about, but what it does is clear the defaults and trigger the android's method of selecting an app.

How would you go about clearing the defaults with tasker .. I can't seem to figure it out....

Thanks,    Rich..

TomL

unread,
Dec 21, 2012, 8:47:37 PM12/21/12
to tas...@googlegroups.com
You need root, and SecureSettings.

Plugins > SecureSettings > Root Actions > Package Options. Choose an app from list, then select the action: Clear app defaults.

Tom

Richard Davis

unread,
Dec 21, 2012, 8:56:35 PM12/21/12
to tas...@googlegroups.com

> You need root, and SecureSettings.

Ahh, that is why I could not find it..

Thanks Tom.....

TomL

unread,
Dec 21, 2012, 10:52:08 PM12/21/12
to tas...@googlegroups.com
Root your phone when you're able to. The Android Experience is night/day with root. :)

Tom

Thomas Toumpoulis

unread,
Dec 26, 2012, 11:00:45 AM12/26/12
to tas...@googlegroups.com
On Friday, December 21, 2012 6:20:00 PM UTC+2, TomL wrote:
Ah, I've actually paid for the pro version of that app.  Very nice app. Yes, Tasker can clear an app's default handling if you select the app from the list, but Tasker won't show you a list of all registered app handlers, which Default App Manager will.  Worth the few bucks.

My solution for now is the following:
Clear app defaults.
Open url.
Use d-pad input to select default browser.
Exit the app.

Adam Lopresto

unread,
Dec 28, 2012, 12:02:18 PM12/28/12
to tas...@googlegroups.com
Another approach would be to create an app that itself registers as a URL handler, then passes the URL to a defined Tasker task. Then you set that always as your default, and let Tasker handle what real app to pass it to. Downside is that you'd actually need to do some programming (or get someone else to do it), but it would go pretty smoothly from there.
Reply all
Reply to author
Forward
0 new messages