'This is where we initialize NFC adapter.'

def nfc_init(self):

    global app
    app = App.get_running_app()
    activity.bind(on_new_intent=self.on_new_intent)
    self.j_context = context = PythonActivity.mActivity
    self.nfc_adapter = NfcAdapter.getDefaultAdapter(context)
    if (not self.nfc_adapter):
        return False
    self.nfc_pending_intent = PendingIntent.getActivity(context, 0, Intent(context, context.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0)
    self.ndef_detected = IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED)
    try:
        self.ndef_detected.addCategory(Intent.CATEGORY_DEFAULT)
        self.ndef_detected.addDataType('*/*')
        self.ndef_exchange_filters = [self.ndef_detected]
    except Exception as err:
        raise Exception(repr(err))
    return True
