A comprehensive Android application demonstrating Near Field Communication (NFC) technology for secure mobile payments. This app showcases multiple payment methods including NFC, UPI, and Card payments with enhanced security features and user experience optimizations.
- NFC Payment: Tap-to-pay functionality with NFC-enabled cards
- UPI Payment: Integration with UPI payment system
- Card Payment: Credit/Debit card processing with OTP verification
- PIN Authentication: 4-digit PIN (2580) for NFC payments
- Transaction Limits: βΉ10,000 maximum transaction limit
- Session Timeout: 5-minute security timeout
- Real-time Validation: Instant field validation with visual feedback
- Card Type Detection: Automatic detection of Visa, Mastercard, and RuPay
- Haptic Feedback: Tactile responses for all interactions
- Sound Effects: Audio feedback for different actions
- Auto-Focus: Smart field navigation and keyboard management
- Swipe Gestures: Navigate with intuitive swipe controls
- Swipe Right: Quick payment
- Swipe Left: Clear cart
- Swipe Up/Down: Show gesture hints
- Add fruits (Apple βΉ50, Banana βΉ30, Orange βΉ40)
- Real-time total calculation
- Cart management with clear functionality
- Language: Kotlin
- Platform: Android (API 21+)
- Architecture: Activity-based with modern Android practices
- NFC: Android NFC API integration
- UI: Material Design components
- Validation: Real-time form validation
- Security: PIN-based authentication, session management
- Android Studio Arctic Fox or later
- Android device with NFC capability
- Minimum SDK: API 21 (Android 5.0)
- Target SDK: API 33 (Android 13)
-
Clone the repository
git clone https://github.com/kg-0805/NFC-Application.git cd NFC-Application -
Open in Android Studio
- Launch Android Studio
- Select "Open an existing project"
- Navigate to the cloned directory
-
Build and Run
- Connect your Android device or start an emulator
- Click "Run" or press Shift+F10
- Add items to cart by tapping fruit buttons
- View real-time total calculation
- Clear cart using swipe left or clear button
- Tap "PAY NOW" or swipe right
- Select "NFC Payment"
- Tap NFC card when prompted
- Enter PIN: 2580
- Payment processing and confirmation
- Select "Card Payment"
- Enter card details with real-time validation
- Enter OTP: 111111 or 222222
- Payment confirmation
- Select "UPI Payment"
- Choose UPI app (simulated)
- Approve payment in UPI app
- Return to app for confirmation
- PIN Protection: NFC payments require 4-digit PIN
- Session Management: Auto-logout after 5 minutes
- Transaction Limits: Built-in spending limits
- Input Validation: Real-time form validation
- Error Handling: Comprehensive error management
- Haptic Feedback: Vibration on all interactions
- Sound Effects: Audio cues for actions
- Auto-Focus: Smart field navigation
- Gesture Controls: Swipe-based navigation
- Visual Feedback: Immediate validation indicators
- NFC PIN: 2580
- Card OTP: 111111 or 222222
- Valid Card Numbers: Start with 4 (Visa), 5 (Mastercard), 60/65/81/82 (RuPay)
- Use NFC tags with "PAY" message
- Or simulate NFC tap in app
- Test with different card types
app/
βββ src/main/
β βββ java/com/example/nfcpaydemo/
β β βββ MainActivity.kt # Main shopping interface
β β βββ PaymentOptionsActivity.kt # Payment method selection
β β βββ NFCPaymentActivity.kt # NFC payment processing
β β βββ CardPaymentActivity.kt # Card payment form
β β βββ UPIPaymentActivity.kt # UPI payment simulation
β βββ res/
β β βββ layout/ # UI layouts
β β βββ drawable/ # Icons and graphics
β β βββ values/ # Colors, strings, styles
β β βββ xml/ # NFC tech filters
β βββ AndroidManifest.xml # App configuration
- Shopping β Add items to cart
- Payment Selection β Choose payment method
- Authentication β PIN/OTP verification
- Processing β Secure payment processing
- Confirmation β Success/failure feedback
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
kartik Gupta
- GitHub: @/Kartik Gupta
- LinkedIn: Kartik Gupta
- Android NFC documentation
- Material Design guidelines
- UPI payment standards
- Security best practices for mobile payments
If you have any questions or issues, please open an issue on GitHub or contact the maintainer.
Note: This is a demonstration app for educational purposes. Do not use in production without proper security audits and compliance checks.














