What means vnd.android (vnd.android.cursor.dir)?
Where can I find full list and description about this types?
I found this page http://en.wikipedia.org/wiki/Internet_media_type but this is not a complete list. Please give any link of full media type list.
Advance Thanks
The vnd. prefix on a MIME type is a "vendor prefix", meaning that it is not an official IETF MIME type.
vnd.android.cursor.dir is part of a faux MIME type used for database-style ContentProviders in Android, specifically for Uri values that map to what logically would be considered "tables" or "views" (collections of content). For example, the AOSP Contacts application has activities that will respond to a MIME type of vnd.android.cursor.dir/contact. You can find various other uses of vnd.android by filling that into the search field in the Android developer documentation.
Where can I find full list and description about this types?
There is none that I am aware of. Vendor-prefixed MIME types can be used or defined by anyone.
Related
After several searches online, I couldn't find a place that could tell me every existent MIME type for different types of media in Android applications.
Here are the ones I know that exist and work:
For Text
"text/plain"
For Image
"image/jpeg"
"image/bmp"
"image/gif"
"image/jpg"
"image/png"
For Video
"video/wav"
"video/mp4"
These are the ones I have and know that work, I am lacking several for video and sound type files. Does anyone know a place where every Android MIME type is described or have you guys ever used another MIME type for these different types of media?
EDIT:
I am using this in an application that monitors SMS and MMS, and in the MMS, the type manages the content inside it. The code I have runs for every version above 8.
I did some search these days.
maybe you shoud read these links.
MediaStore supported MIME type is here: http://androidxref.com/4.4.4_r1/xref/frameworks/base/media/java/android/media/MediaFile.java#174
And there is also a API URLConnection.getFileNameMap()
And its inner side is here: http://androidxref.com/4.4.4_r1/xref/libcore/luni/src/main/java/libcore/net/MimeUtils.java
I couldn't find a place that could tell me every existent mime type for different types of media in android applications
There are over a million applications on the Play Store, plus others elsewhere (e.g., pre-installed on devices, Amazon AppStore for Android). A given device will have some combination of these apps. A given user will have access to some subset of the apps on the device, if the user is running in an Android 4.3+ restricted profile on a tablet.
Hence, there is no way to know, at compile time, what MIME types a given Android device can support for things like ACTION_VIEW activity requests. The OS itself supports no such MIME types -- they are all provided by applications.
Here are the ones I know that exist and work:
Some devices may have apps pre-installed that support those MIME types. text/plain is the least likely of your set to be supported "out of the box".
You can use existing mapping in Android (java version)
String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext.toLowerCase());
I know I'm late to the party, but I found a full list of mime types here:
https://android.googlesource.com/platform/external/mime-support/+/9817b71a54a2ee8b691c1dfa937c0f9b16b3473c/mime.types
Which MIME types does Android support out of the box?
Since that's your immediate question, let's answer that first (though it's not exactly the right question for your MMS usecase).
To know the MIME types supported by Android itself (not considering additional apps), you can use this process:
Consult the list Supported media formats from the official Android documentation.
For each media format and each of its possible container formats, find the associated MIME types from the official IANA Media Types list.
Since there are some unregistered MIME types in use in practice, including by Android, additionally consult the list of MIME types known to the Android platform to convert the supported media formats. For example, the Matroska video container format (.mkv files) appears only in that list, not in the IANA list.
Which MIME types might you encounter in MMS?
tell me every existent mime type for different types of media in android applications. […] I am using this in an application that monitors SMS and MMS and in the MMS type manages the content inside it.
For your case, the MMS standard will tell you what MIME types can be used for its content. And it seems that, like e-mail, MMS does not restrict what MIME types its content can be. For example, one supplier of MMS solutions tells that it will simply pass content with unknown MIME types to the network carrier:
If the format is not listed below that means it still gets accepted on the API, but […] it may get delivered to the carrier or may not depending on the size of the content. (source)
Since applications can define their own MIME types, including types starting with prs. and x. that cannot be registered at IANA, you cannot know beforehand which MIME types you will encounter.
So for practical purposes, it is the safest approach if your application can deal with all MIME types supported by the Android platform by default – see above for the list. And then handle everything else (added by apps) in a generic manner.
can NFC tags readers, especially on Android, open a webpage stored on the tag after being scanned?
I don't want to store a URL, I want to store a webpage in plain text and have that render after it is scanned. Is this supported?
<html><body>No signal? Bookmark this page!<img src="http://bit.ly/example"/>Test Image</img></body></html>
The above example is only 106 bytes, so can fit on most NFC tags, would this open in a webpage or can there be certain instructions to render it as a webpage?
If you set the MIME type of the tag to text/html, it is possible that this will be rendered in browsers set up to read NFC tags containing that MIME type. Whether there are any such browsers, I cannot say. The AOSP Browser app does not support this -- the only NFC tags it supports are ones with http or https schemes for URLs, based on the current contents of its manifest.
Yes you can store a web page on an NFC tag - in fact you could store anything. That does not mean that it is a good idea. If you do not decide on the tags to be used, html is a bad idea. Rather store an URL and get the data online. Or store the data in a more compact format.
EDITED ADDITIONAL INFO:
The Android Developer site at this link:
https://developer.android.com/guide/topics/connectivity/nfc/nfc
contains a wealth of information which, upon reading, explains why this particular approach is challenging, but also inspires a while heap of other alternative ideas, methods, ways and means... I strongly recommend checking it out!!!
********** End Of Edit ************
ORIGINAL ANSWER:
I have experimented with the very same, and created a custom NDEF message of MIME type text/html, with a fully coded HTML document as text in the data field of said MIME type ( & all standard tags such as & & so on). I have not had any luck with having the page rendered in a browser window. Usually, on scanning the NFC chip, it just returns a new-tag response showing my MIME "text/html" prefix, and completely omits the display of even the associated HTML encoding!
It's very frustrating..
However - in going to try again, as I understand that a recent release of Chrome Browser has a flag for experimental NFC features that can be activated.
In the Chrome Browser, navigate to chrome://chrome-urls and choose the flags link (or just go straight to chrome://flags ), then in the search bar type NFC. When the two or so options are presented, change the flags from default to enabled.
Now, I know that this then allows websites to interact with data on NFC tags, and allows you to script the content fields as variables, etc etc etc, but I DON'T know if it will solve our "render MIME type text/html record as web page directly" problem.
I will test it out and let you know...
I had a similar thought to you and was investigating this idea. However android by default do not have an app that can recognize such tag by default... not even android chrome.
But what I did end up doing to explore this was to create an NFC tag project that can generate a tag with a mime record of text/html or text/html+gzip (FYI: text/html+gzip technically is not an officially registered mime record type, however I think it still keeps to the normal semantic of other mime record that combines a format + compression). It's located at https://github.com/mofosyne/js-ndef-html-tag to generate a tag.
As for viewing it, I've created an experimental android app where I have also placed an intent hook for both text/html or text/html+gzip so that any NFC tag with such content will automatically open up https://github.com/mofosyne/NFCMessageBoard and display the tag's html content.
However ideally you would push android to add native support for viewing html tags directly.
Until then, the official answer is no you cannot.
I have to do an application in NFC. My tag return NFC-V, so I cast it in NfcV. And I have to extract some information, and the method getResponseFlags seems contains what I need. But I didn't find any documentation that explains me how read the returned byte. I suppose it is a bitwise of several properties, but in witch order and witch information, it is no where explains.
Where I can get information about this?
PS: I have already searched Google with lot of request, I have also looked in source code and in javadoc, I have also read some PDF about ISO 15693 (NFC-V), but nothing says me for example the bit 5 means "is Afi Locked" (Its just an example, probably not the truth)
You need the ISO15639-3 spec (note the '3') - that one details the required commands & defines the responses, including the bitmasks for the relevant fields.
The response-flags returned by only contain an error-flag (bit 0), and a flag to indicate if there are extensions to the protocol (bit 4). To get information about DSFID, AFI, etc you'll need to use the 'Get System Information' command ('2B')
To get the spec you'll need to pay the ISO organisation 150CHF :-(, but a bit of googleing should find you alternative sources.
Note that RFID-manufacturers can add extra commands to the protocol. For those you'll have to consult the datasheets.
I'm trying to define two different file extension mappings and two different mime-type IntentFilters in my manifest file but I can't seem to get them all to work; one works and others don't, etc.
How does one define multiple pathPatterns in the manifest? Should/can all mime-types and pathPatterns be defined in a single IntentFilter? Should they be different filters? I can't find any examples that show multiple, distinct mappings.
I have settled on grouping similar definitions together into distinct Intent Filters. For example, grouping the same pathPattern with different schemes (http, https, file) into one Intent Filter and defining another Intent Filter for a different pathPattern with the same set of schemes. I haven't encountered any specific guidelines or documentation about this so I've gone with my own aesthetic preference.
The source of my difficulties appears to have been the limited functionality of pathPattern. After seeing the .* explanation in the documentation, I had hoped pathPattern would accept other regex syntax but in practice it appears .* really is the only option for any kind of flexibility.
Also, the often cited method for defining a file-type filter has a bug/limitation that I have not been able to find a way around or an explanation for: pathPattern=".*\\.xyz" will work for "MyFile.xyz" but NOT for "My.File.xyz". I have since posted another question about this specific issue.
Naming Android mime-types/Uris:
The sample notepad application uses:
"vnd.android.cursor.dir/vnd.google.note"
"vnd.android.cursor.item/vnd.google.note"
Let's say I want create my own application with three datatypes that should be stored in the database, how should I name my uris?
Should all content uris start with vnd.android.cursor.dir and vnd.android.cursor.item before the slash?
It doesn't really matter. AFAIK there is no naming convention for it. Use whatever you like, just make them UNIQUE.
Mime Types:
You should always make your MIME types start with vnd.android.cursor.item for a single record, or vnd.android.cursor.dir/ for multiple items, followed by your custom vender specific name definition:
vnd.android.cursor.dir/vnd.custom.name
As recommended by the Android documentation found here