Author Topic: Aquamail is not launched with NFC NDEF email  (Read 7224 times)

Kenarude

  • Newbie
  • *
  • Posts: 5
Aquamail is not launched with NFC NDEF email
« on: January 22, 2016, 05:34:35 pm »
Hello,

I have a NFC tag with an NDEF EMAIL message stored in it. When I use my smartphone (Samsung Android 4.4.2) with it the "e-mail application" listing do not propose AquaMail  (there is no default application assigned, GMAIL and EMAIL are listed only). What can I do to add AquaMail to this list.

Thanks in advance.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #1 on: January 22, 2016, 06:12:17 pm »
Re: I have a NFC tag with an NDEF EMAIL message stored in it.

Umm, what the hell are those *things*? :)

I found this in stock Email app's AndroidManifest.xml:


            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="mailto" />
            </intent-filter>


Assuming I copy/paste this into AquaMail's AndroidManifest, what else do I need to do (if anything) in the "message compose" code?

And please bear in mind that I have absolutely no idea what "NFC tag with an NDEF EMAIL message stored in it" is, so if you could explain it would be great.

( and did you really mean "EMAIL message" or "an email *address*" ? )
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/

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #2 on: January 22, 2016, 06:14:06 pm »
PS:

Would this be necessary too?

This is from stock Email app:

    <uses-permission android:name="android.permission.NFC"/>


Adding permissions is not good, users immediately start assuming that "this developer wants to spy on us" or "wants to destroy my phone".

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/

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #3 on: January 22, 2016, 06:23:21 pm »
Oh and one other thing:

How could I test this?
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/

Kenarude

  • Newbie
  • *
  • Posts: 5
Re: Aquamail is not launched with NFC NDEF email
« Reply #4 on: January 23, 2016, 12:40:05 am »
Hi,

Thank you for your quick answer. Sorry but I'm not very good in Android to make a very precise answer.

NFC is an acronym for Near Field Communication, it's a contactless communication between 2 devices (distant of few centimeters max). In Android the NFC stack is deployed under Android Beam and allow to read NFC tags or exchange data between phones (vcard, picture email, bluetooth pairing...). Of course you need a smartphone with NFC capability and an NFC tag (or another smartphone with NFC) to play (or test) with it. (exemple on youtube, search "How to use NFC on Android").
The NDEF message is a format for the exchanged information between 2 NFC devices, this is automatically managed by Android beam. (This format is defined by the NFC Forum, and implemented in android)

I think that you only need to add

 <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:scheme="mailto" />
 </intent-filter>

I don't think you need to add permission to NFC as your application is not driving the NFC but as I said I'm not good enough in Android to be sure.

I tried to open a .eml file also (previously saved from thunderbird) but my phone listed only GMAIL and EMAIL. I don't know if there is a generic way to declare the application as a mail client for android.
« Last Edit: January 23, 2016, 12:45:15 am by Kenarude »

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #5 on: January 24, 2016, 04:39:17 pm »
I will try adding the intent filter, please look for it in the next -dev version and let me know.

Re: EML -- AquaMail shows .eml attachments "inline" right inside the "parent" message, and its attachments too.
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/

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #6 on: January 24, 2016, 09:46:05 pm »
I made a special version with that NFC "stanza" in the manifest, please let me know if it works:

https://www.aqua-mail.com/download/AquaMail-market-1.6.1.0-dev3-nfc.apk

If it does, then I'll include the change in subsequent -dev builds.
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/

Kenarude

  • Newbie
  • *
  • Posts: 5
Re: Aquamail is not launched with NFC NDEF email
« Reply #7 on: January 25, 2016, 01:55:43 pm »
Hi,

I tested it on 3 different phones and this is working with NFC email.

Thank you.

For eml files I tested it by openning it via a file manager, but it seems not to be as simple as it because  I don't have the same reaction with the Samsung File Manager and ES Explorer.

Kenarude

  • Newbie
  • *
  • Posts: 5
Re: Aquamail is not launched with NFC NDEF email
« Reply #8 on: January 25, 2016, 03:48:43 pm »
Hi,

No, I didn't test it with another e-mail reader. This is not an issue for me, it was just a test because I thought that on Android the action to open an e-mail was generic. My intention was just to mention that the action to open a .eml file is not registered for AquaMail.

For the NFC e-mail, the "intent" is working correctly to propose AquaMail in the default action list to open e-mail from NFC, but the content is not extracted and displayed in the e-mail. I think that it needs more action in the code than the "intent".

Now that I understand better this part of Android, I think that this request should be moved to "features request". But I think they need to be parts of an e-mail client anyway (as GMAIL or EMAIL).

I would like to thank you for the great work you accomplish for this awesome application which replace completely the pre-installed ones.
« Last Edit: January 25, 2016, 04:05:32 pm by Kenarude »

pyler

  • Sr. Member
  • ****
  • Posts: 412
Re: Aquamail is not launched with NFC NDEF email
« Reply #9 on: January 26, 2016, 02:58:22 pm »
Not sure, AquaMail would have to "accept" eml files data scheme in manifest and parse it itself.
Do you want to use the latest AquaMail version?
Try AquaMail Updater!

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #10 on: January 26, 2016, 06:35:43 pm »
Re: NDEF

How can I test this? I don't happen to own any NFC tags.

I also searched Gmail / stock Email code for "NFC" and "NDEF" and came up with nothing other than what's there in the manifest.

I could add this hypothetical additional code -- if I could just find out what it's supposed to be.
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/

Kenarude

  • Newbie
  • *
  • Posts: 5
Re: Aquamail is not launched with NFC NDEF email
« Reply #11 on: January 27, 2016, 01:19:50 pm »
Hi,

Re: NDEF

How can I test this? I don't happen to own any NFC tags.

To test it, you'll need 2 smartphones with NFC, activate the NFC and Android Beam in the settings (Android 4.4.2 or higher is needed). On the 1st smartphone open an email and fill it (without sending it), hold the 2 devices back to back then if the 2 NFC antenna's are in the field, the 2 smartphones should vibrate and display a message ("tap to send over NFC", or something like that). If you tap on the first with the email, it should be loaded to the second one.

it also works with pictures, contact, ... .

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #12 on: January 29, 2016, 09:04:48 pm »
Re: If you tap on the first with the email, it should be loaded to the second one.

Whoa.

You're saying that somehow a message -- in the process of being composed -- should be transferred / copied from phone to phone?

Sounds like *a lot* more than what we originally discussed -- triggering on mailto: links coming from NFC tags (I presume)?
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/

agb

  • Newbie
  • *
  • Posts: 1
Re: Aquamail is not launched with NFC NDEF email
« Reply #13 on: March 08, 2016, 03:18:13 am »
Hi, found this thread so remove my message and write here.

This url

mailto:aaaa@ukr.net?subject=Hi&body=Test

Typed in Firefox browser composes new message in AquaMail.
But when android reads this line from nfc tag he cannot find what AquaMail can understand this link. And propose just gmail and standard mail apps.

As I understand any data from nfc tags or paired devices are urls or mime+data.

« Last Edit: March 08, 2016, 03:23:11 am by agb »

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Aquamail is not launched with NFC NDEF email
« Reply #14 on: March 08, 2016, 05:58:51 pm »
Please see the discussion above:

I don't know how I can test this ( don't own any NFC smart tags or whatever they're called, http://www.sonymobile.com/global-en/products/accessories/smarttags-nt3 ).

What @Kenarude described above seems to be for something else.

If you could explain how to test this scenario, I would take a look. So far this is the blocker.
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/