support pre JELLY_BEAN ndef
be more OO
Merge pull request #620 from emdete/p0

P0