Author Topic: Re: Default Send From Account  (Read 5823 times)

this_is_nascar

  • Jr. Member
  • **
  • Posts: 92
Re: Default Send From Account
« on: September 14, 2015, 03:46:10 am »
Rather than starting a new thread, I'll post here, since it's a similar subject.

How do I set AM as the default mail client?  Right now, the other apps are opening the stock Android email app when calling to the mail app.

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Re: Default Send From Account
« Reply #1 on: September 14, 2015, 05:12:35 am »
You should follow these instructions:
http://www.tomsguide.com/us/change-default-android-apps,news-21280.html
Do it for the current default app for emails.
(Note, that that app might be under "All" tab within the app manager [rather than under "downloaded"].)

PS. BTW, your question is very different from the rest of this thread.
« Last Edit: September 14, 2015, 05:19:59 am by StR »

this_is_nascar

  • Jr. Member
  • **
  • Posts: 92
Re: Re: Default Send From Account
« Reply #2 on: September 14, 2015, 01:38:13 pm »
Thanks and sorry.  Guess I should have started a new thread.  That's not the cause as it's greyed out under the email app.

I love AM, by the way.  Only sorry that I didn't try it sooner.  Keep up the great work.

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Re: Default Send From Account
« Reply #3 on: September 14, 2015, 04:12:23 pm »
No problem..
It's  strange that it didn't work for you.
What happens now when you click on the "mailto" link in a web browser ? (I assume that's what you are referring to). Does it go directly to your stock browser? (I.e. without showing anything before that (e.g. chooser)?
You can easily check that on any webpage with a "send email" (mailto: ) link.


Just in case, check if Gmail app has a default set as above,  and if it is, clear that.
I've seen some people reporting that somehow that was the case, but I don't understand how that would work... (although some android phones have gmail as a stock app).

crashdamage

  • Newbie
  • *
  • Posts: 43
Re: Re: Default Send From Account
« Reply #4 on: September 14, 2015, 05:25:31 pm »
Go to:
Settings > Apps > All > Select the stock email app > Force stop > Clear defaults > Disable.

Next time there is a call for an email app, select AquaMail and tap on Always.  You're set.

Android since v1.0. Linux since 2001

Android since v1.0.  Linux since 2001.

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Re: Default Send From Account
« Reply #5 on: September 14, 2015, 09:03:48 pm »
Go to:
Settings > Apps > All > Select the stock email app > Force stop > Clear defaults > Disable.

(S)He wrote:
That's not the cause as it's greyed out under the email app.
Unless he looked in the wrong place, - that would mean the app is not set as default for ACTION_SEND (triggered by "mailto") intent.
Something doesn't match...
« Last Edit: September 14, 2015, 11:07:45 pm by StR »

this_is_nascar

  • Jr. Member
  • **
  • Posts: 92
Re: Re: Default Send From Account
« Reply #6 on: September 15, 2015, 01:19:07 am »
"Clear defaults" is dimmed-out on both the stock E-Mail app and the G-Mail app.  Yes, when I would click on a link from a webpage that is used to send an email to someone, the stock Android E-Mail app is executing, not AM, without any option to pick either.

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Re: Default Send From Account
« Reply #7 on: September 15, 2015, 11:26:26 pm »
@this_is_nascar
Sorry, I have not idea how you do get your stock e-mail app automatically started on "ACTION_SEND" intent even though it is not set as a default app to start.

The only possible scenario that I can think of is that there is some "super-smart" app that sits in between (and is set as a default for this intent) and then seamlessly passes the control to the stock app. I don't know if such apps exist.
But if you installed some special smart-app manager, check if it has any default association for mail.

Once you found that default app, you clear its "default association".

From what I understand, there is no easy and reliable way in Android to determine what is the default app for an intent, even by righting a program (See e.g. these threads:
https://groups.google.com/forum/#!topic/android-developers/UkfP70MtjGA
http://stackoverflow.com/questions/15546414/how-to-get-default-home-application )
There is this way for which one would need to write a program:
http://stackoverflow.com/questions/4675405/android-intent-defaults-detect-and-clear
Unfortunately, I do not find an app that would do this job for you.

If you have a custom ROM, there might be something in it that changes all this functionality.

Rather than these, I am out of ideas. Sorry...
Maybe Kostya (the Aquamail author) will have some other ideas when he is back from vacation (after Sept. 18).


PS.
Presumably, there is one more possibility.
If you are using a Firefox, and your e-mail action happens from it, then this suggestion might solve your problem:
Quote
Go to about:config (yes, it works on mobile).

Here search for browser.download.preferred.aplication and you'll find the offending preferences. You can use the "reset" button to remove them.
(Found here: https://support.mozilla.org/en-US/questions/985982 )

However, I just tried, and in the latest FF, it doesn't seem to work that way, -- it uses the Android schema for the default intents. But if you have an older FF, that might solve it for you.



this_is_nascar

  • Jr. Member
  • **
  • Posts: 92
Re: Re: Default Send From Account
« Reply #8 on: September 16, 2015, 12:41:07 am »
Thx.  I'll try some more things and attempt your suggestions.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Re: Default Send From Account
« Reply #9 on: September 16, 2015, 11:06:31 pm »
Hmmm...

This is the relevant stanza from Aqua's manifest. Pretty standard stuff:

Code: [Select]
        <activity
            android:name=".ui.NewMessageActivity"
            android:label="@string/new_message_activity_new"
            android:theme="@style/AquaMailTheme.Dark.Launch" >
            <intent-filter android:label="@string/app_name" >
                <action android:name="android.intent.action.VIEW" />
                <action android:name="android.intent.action.SENDTO" />

                <data android:scheme="mailto" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
            <intent-filter android:label="@string/app_name" >
                <action android:name="android.intent.action.SEND" />

                <data android:mimeType="*/*" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <intent-filter android:label="@string/app_name" >
                <action android:name="android.intent.action.SEND_MULTIPLE" />

                <data android:mimeType="*/*" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

And this one is from K9 Mail as a sanity check:

Code: [Select]
        <activity
            android:name=".activity.MessageCompose"
            android:configChanges="locale"
            android:enabled="false"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.SENDTO"/>
                <data android:scheme="mailto"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND"/>
                <data android:mimeType="*/*"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE"/>
                <data android:mimeType="*/*"/>
                <category android:name="android.intent.category.DEFAULT"/>
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <data android:scheme="mailto"/>

                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
            </intent-filter>
        </activity>

Not seeing much difference (except for K9's is disabled initially until there are accounts, and they sort of cheat on orientation changes...)
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/

StR

  • Hero Member
  • *****
  • Posts: 1558
Re: Default Send From Account
« Reply #10 on: September 18, 2015, 12:38:48 am »
Kostya,

Let me share some thoughts on this issue. Your posting of the excerpt from Aquamail manifest got me thinking.

Here is the scenario how what this_is_nascar described can happen. Namely, how in the absence of the default association set for any mail-related intent in the stock client, the stock client is the only one that is called.

1. This can happen if the stock email client is the only one that has the announced attributes that match those used in the "call" by another app.

2. This attributes are not limited by just the intent. An app can add other parameters (e.g. Type).

I see that what is present in the stock email app manifest (Android 4.1.2 here) and absent in Aquamail and Gmail apps is the following:
<data mimeType="application/eml"/>
<data mimeType="message/rfc822"/>

It is under
Code: [Select]
<activity name="com.android.email.activity.MessageFileView">
  <intent-filter label="@string/app_name">
    <action name="android.intent.action.VIEW">
    <data mimeType="application/eml"/>
    <data mimeType="message/rfc822"/>
     <category name="android.intent.category.DEFAULT"/>
   </intent-filter>
 </activity>

So, I am not sure how it would affect the action for android.intent.action.SENDTO  or any other SEND* intents. But that seems to be a distinct feature of the stock email manifest, compared to Aquamail and Gmail.
My knowledge of Android, or rather the lack of such does not allow me to complete/check this hypothesis, but I think if you looked at the stock email manifest and read this discussion about using type: http://stackoverflow.com/questions/2197741/how-can-i-send-emails-from-my-android-application
it would give sufficient information for you to conclude.

I suspect the browser that this user is using, in addition to the intent might be specifying the mime-type, and that leads to opening the stock email due to the lack of any other app that declared that mime type.
If that's the case, I don't know if you want to change anything in Aquamail, but at least it might provide you something interesting to think about. ;)

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Default Send From Account
« Reply #11 on: September 18, 2015, 11:42:50 pm »
That stanza is for viewing .eml files -- note the mimeType specs there.

The OP's issue must be caused by something else, although sadly, I can't imagine what...
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/