Android NFC Application

Mobile Applications

Project Overview

Android NFC Application

This robust and high-performing Android application was designed to modernize student attendance tracking in a higher education institution. Leveraging the built-in hardware capabilities of smartphone NFC chips, it allows instant reading of secure student ID cards and synchronizes attendance data with a centralized database via a secure REST API.

The application implements an offline-first architecture to ensure continuous access control even in areas with weak network coverage, caching scans locally and automatically syncing them once a stable connection is restored.

Technical Details

Technologies Used

Android Java NFC Retrofit 2 REST API SQLite Room Database Material Design

Project Duration

4 months (September - December 2022)

Challenges and Solutions

The technical challenges resolved in this project include:

  • Implementing Foreground Dispatch to intercept NFC tags with highest priority and decode NDEF data streams quickly.
  • Developing a highly resilient asynchronous two-way synchronization engine utilizing SQLite and Retrofit.
  • Securing data transfers and applying local encryption to cached identifiers on ID cards to prevent spoofing or cloning.

Code Examples

NFC Foreground Dispatch in Activity

@Override
protected void onResume() {
    super.onResume();
    Intent intent = new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_MUTABLE);
    IntentFilter[] filters = new IntentFilter[]{new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED)};
    String[][] techList = new String[][]{new String[]{Ndef.class.getName()}};
    nfcAdapter.enableForegroundDispatch(this, pendingIntent, filters, techList);
}

Enabling foreground dispatch to ensure our application receives priority when handling NFC scans.

Project Gallery

NFC Reader Application interface

Conclusion and Results

The NFC application has been successfully deployed and is actively used daily by over 50 teachers and administrators. It reduced student registration time by 75% compared to classic manual methods while entirely eliminating manual input errors.

Back to Projects