# Android Project Setup (CodexVertex)

Follow these steps to set up the **Notification Listener App**.

## 1. Project Details
- **App Name:** `CodexVertex`
- **Package Name:** `com.arvindcodex.codexvertex`
- **Minimum SDK:** 21 (Lollipop) or higher

## 2. Android Manifest Permissions
Add the following to your `AndroidManifest.xml` under the `<application>` tag:

```xml
<service android:name=".NotificationService"
    android:label="CodexVertex Listener"
    android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"
    android:exported="true">
    <intent-filter>
        <action android:name="android.service.notification.NotificationListenerService" />
    </intent-filter>
</service>

<uses-permission android:name="android.permission.INTERNET" />
```

## 3. Requesting Notification Access
Launch this activity or use a button to request permission.
```java
// Check if permission is NOT granted
if (!Settings.Secure.getString(this.getContentResolver(), "enabled_notification_listeners").contains(getApplicationContext().getPackageName())) {
    Intent intent = new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS");
    startActivity(intent);
}
```

## 4. Testing & Validation
- Open the app and grant notification access.
- Make a Small UPI Payment (e.g., ₹1 to your linked UPI ID).
- Ensure a notification appears from Google Pay, PhonePe, or Paytm.
- Check Android Studio Logcat for "CodexVertex_Listener" tags.
- Verify the `transactions` table in your Supabase project.

## 5. Deployment Note
Make sure to replace `API_URL` in `NotificationService.java` with your actual hosting server address.
