An open API service indexing awesome lists of open source software.

https://github.com/kg-0805/nfc-application

A comprehensive Android demo app showcasing NFC, UPI, and Card payment methods with PIN security, haptic feedback, swipe gestures, and real-time validation. Built with Kotlin and Material Design.
https://github.com/kg-0805/nfc-application

android android-development android-nfc card-payment demo-app hacktoberfest haptic-feedback kotlin material-design mobile-app mobile-payment nfc payment payment-demo payment-gateway pin-authentication real-time-validation secure-payments swipe-gestures upi

Last synced: 22 days ago
JSON representation

A comprehensive Android demo app showcasing NFC, UPI, and Card payment methods with PIN security, haptic feedback, swipe gestures, and real-time validation. Built with Kotlin and Material Design.

Awesome Lists containing this project

README

          

# NFC Pay Demo ๐Ÿ“ฑ๐Ÿ’ณ

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.

## ๐Ÿš€ Features

### Payment Methods
- **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

### Security & Validation
- **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

### User Experience Enhancements
- **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

### Shopping Cart
- Add fruits (Apple โ‚น50, Banana โ‚น30, Orange โ‚น40)
- Real-time total calculation
- Cart management with clear functionality

## ๐Ÿ“ฑ Screenshots

### Main App Flow





### NFC Payment Flow








### UPI Payment Flow





### Card Payment Flow







## ๐Ÿ› ๏ธ Technical Stack

- **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

## ๐Ÿ“‹ Prerequisites

- Android Studio Arctic Fox or later
- Android device with NFC capability
- Minimum SDK: API 21 (Android 5.0)
- Target SDK: API 33 (Android 13)

## ๐Ÿ”ง Installation

1. **Clone the repository**
```bash
git clone https://github.com/kg-0805/NFC-Application.git
cd NFC-Application
```

2. **Open in Android Studio**
- Launch Android Studio
- Select "Open an existing project"
- Navigate to the cloned directory

3. **Build and Run**
- Connect your Android device or start an emulator
- Click "Run" or press Shift+F10

## ๐Ÿ“– Usage

### Shopping
1. Add items to cart by tapping fruit buttons
2. View real-time total calculation
3. Clear cart using swipe left or clear button

### NFC Payment
1. Tap "PAY NOW" or swipe right
2. Select "NFC Payment"
3. Tap NFC card when prompted
4. Enter PIN: **2580**
5. Payment processing and confirmation

### Card Payment
1. Select "Card Payment"
2. Enter card details with real-time validation
3. Enter OTP: **111111** or **222222**
4. Payment confirmation

### UPI Payment
1. Select "UPI Payment"
2. Choose UPI app (simulated)
3. Approve payment in UPI app
4. Return to app for confirmation

## ๐Ÿ” Security Features

- **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

## ๐ŸŽจ User Experience

- **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

## ๐Ÿงช Testing

### Test Credentials
- **NFC PIN**: 2580
- **Card OTP**: 111111 or 222222
- **Valid Card Numbers**: Start with 4 (Visa), 5 (Mastercard), 60/65/81/82 (RuPay)

### NFC Testing
1. Use NFC tags with "PAY" message
2. Or simulate NFC tap in app
3. Test with different card types

## ๐Ÿ“ Project Structure

```
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
```

## ๐Ÿ”„ Payment Flow

1. **Shopping** โ†’ Add items to cart
2. **Payment Selection** โ†’ Choose payment method
3. **Authentication** โ†’ PIN/OTP verification
4. **Processing** โ†’ Secure payment processing
5. **Confirmation** โ†’ Success/failure feedback

## ๐Ÿ›ก๏ธ Permissions

```xml

```

## ๐Ÿค Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit changes (`git commit -m 'Add AmazingFeature'`)
4. Push to branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ‘จ๐Ÿ’ป Author

**kartik Gupta**
- GitHub: [@/Kartik Gupta](https://github.com/kg-0805)
- LinkedIn: [Kartik Gupta](https://linkedin.com/in/kg-0805)

## ๐Ÿ™ Acknowledgments

- Android NFC documentation
- Material Design guidelines
- UPI payment standards
- Security best practices for mobile payments

## ๐Ÿ“ž Support

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.