This guide will help you set up and start using Card Advisor AI in under 10 minutes.
Before you begin, ensure you have:
- Android Studio (Narwhal 2025.1.2 or later) - Download here
- Node.js (v16 or later) - Download here
- Android device or emulator (Android 7.0+)
- Google Gemini API Key - Get free key
- USB cable (for device installation)
-
Visit: Google AI Studio
-
Sign in with your Google account
-
Click "Create API Key"
-
Copy the key (starts with
AIza...) -
Save it somewhere safe (you'll need it later)
💡 Note: Free tier includes 1,500 requests/day - more than enough!
# Navigate to project directory
cd /Users/dmungamuri/AndroidStudioProjects/cardadvisorapp
# Install Capacitor CLI globally (if not already installed)
npm install -g @capacitor/cli
# Copy web assets to Android
npx cap copy androidExpected output:
✔ Copying web assets from www to android/app/src/main/assets/public in 3ms
✔ Creating capacitor.config.json in android/app/src/main/assets in 0.5ms
✔ copy android in 6ms
Verify files are in place:
android/app/src/main/assets/public/index.html ← Should exist
android/app/src/main/assets/capacitor.config.json ← Should exist
# From project root
open -a "Android Studio" ./android- Launch Android Studio
- File → Open
- Navigate to:
/Users/dmungamuri/AndroidStudioProjects/cardadvisorapp/android - Click "Open"
android folder, NOT the root cardadvisorapp folder!
-
Wait for Gradle sync to complete (status bar bottom)
-
Build APK:
- Build → Build Bundle(s) / APK(s) → Build APK(s)
-
Wait for build (1-2 minutes on first build)
-
Success notification will appear:
APK(s) generated successfully for 1 module: Module 'app': locate or analyze the APK -
Click "locate" to find the APK
-
APK location:
android/app/build/outputs/apk/debug/app-debug.apk
cd android
./gradlew assembleDebugAPK will be at: android/app/build/outputs/apk/debug/app-debug.apk
- Settings → About phone
- Tap "Build number" 7 times
- Developer options will appear in Settings
- Settings → Developer options
- Toggle "USB debugging" ON
- Confirm the popup
- Connect phone to computer via USB
- Authorize computer (popup on phone)
- In Android Studio: Click green
▶️ Run button - Select your device from dropdown
- App installs and launches
-
Locate APK:
android/app/build/outputs/apk/debug/app-debug.apk -
Upload to Google Drive
-
Share link with yourself or just keep it in your Drive
- Open Google Drive on your phone
- Find app-debug.apk
- Tap to download
- You may see warning - "This type of file can harm your device"
- Tap "Download anyway"
- Open notification or Files app
- Tap app-debug.apk
- Chrome/Files warning: "Install unknown apps"
- Tap "Settings"
- Toggle "Allow from this source" ON
- Tap back, then Install
- Open when installation completes
# Ensure device is connected and authorized
adb devices
# Install APK
adb install android/app/build/outputs/apk/debug/app-debug.apk
# If already installed, use -r to replace
adb install -r android/app/build/outputs/apk/debug/app-debug.apk- Tap Card Advisor AI icon on your phone
- Grant permissions if asked (only INTERNET)
-
Tap hamburger menu (☰) in top-left
-
Tap "Settings"
-
Paste your Gemini API key
- The key you got from Step 1
- Input is masked (type="password") for security
-
Tap "Save API Key"
-
Success notification appears
-
Open menu (☰) → My Cards
-
Enter exact card name in text field:
Examples (use exact names): - HDFC Millennia Credit Card - SBI Cashback Credit Card - ICICI Amazon Pay Credit Card - Axis Magnus Credit Card - AMEX Platinum Travel Credit Card -
Tap "Fetch & Save Card Rules"
-
Wait 4-8 seconds (loading indicator shows)
-
AI fetches comprehensive rules from bank website:
- Base reward rates
- 70+ spending categories
- Movie tickets (BookMyShow offers)
- Dining & food delivery
- Travel benefits (lounge, insurance)
- Grocery rewards
- Fuel surcharge waivers
- OTT subscriptions
- Utilities & bills
- And much more!
-
Card appears in your portfolio below
-
Repeat for all your cards
-
Tap the purple eye icon (👁️) on any card
-
Scrollable modal opens with complete rules
-
Scroll through all the benefits
-
Optional: Tap "Reload Rules" to refresh from bank website
-
Close by tapping "Close" button or outside modal
-
Open menu (☰) → AI Advisor
-
Describe your purchase:
Examples: - "Buying ₹5,000 groceries at BigBasket" - "Booking flight tickets for ₹15,000" - "Shopping on Amazon for ₹3,000" - "Paying electricity bill of ₹2,500" - "Dining at restaurant for ₹1,200" -
Tap "Get Best Card Suggestion"
-
AI analyzes all your cards (takes 3-6 seconds)
-
Get detailed recommendation:
- 💳 Best card to use
- 💰 Expected reward amount
- 📊 Calculation breakdown
- 🔄 Alternative cards (if close)
-
Usage stats appear as toast (auto-dismisses):
✓ 1 request • 2,450 tokens Prompt: 1,200 • Response: 1,250
✅ Do:
- Use exact bank/card name
- Include "Credit Card" in name
- Example: "HDFC Millennia Credit Card"
❌ Don't:
- Use abbreviations ("HDFC Mill")
- Add numbers ("Card 1")
- Use nicknames ("My HDFC")
✅ Do:
- Be specific about amount
- Mention merchant/category
- Example: "₹5,000 at BigBasket"
❌ Don't:
- Be vague ("some shopping")
- Skip amount
- Example: "buying stuff"
When to Refresh:
- Bank announces new offers
- Quarterly benefit changes
- Devaluation notices
- You notice outdated info
How to Refresh:
- From list: Tap 🔄 icon on card
- From modal: Tap "Reload Rules" button
Problem: Opened wrong Android folder
Solution:
- Close Android Studio
- File → Open
- Navigate to:
/Users/dmungamuri/AndroidStudioProjects/cardadvisorapp/android - Select android folder, not root folder
- Click "Open"
Problem: Web assets not copied to Android
Solution:
cd /Users/dmungamuri/AndroidStudioProjects/cardadvisorapp
npx cap copy android
# Rebuild in Android StudioSymptoms: "Failed to fetch rules", "API error"
Solutions:
-
Verify key format:
- Should start with
AIza - Length: ~39 characters
- No spaces or line breaks
- Should start with
-
Check API status:
- Visit Google AI Studio
- Try your key in the playground
- Ensure Gemini API is enabled
-
Clear and re-enter:
- Menu → Settings
- Delete current key
- Paste again carefully
- Save
-
Generate new key:
- If old key doesn't work
- Create new one at Google AI Studio
- Use the new key
Problem: Too many requests too fast
Solution:
- Wait 60 seconds
- App automatically retries
- Check quota at Google AI Studio
- Free tier: 15 requests/minute, 1,500/day
Problem: "Install blocked" or "Unknown sources"
Solution:
- Settings → Security
- Toggle "Unknown sources" ON
- OR:
- Settings → Apps → Chrome/Files
- Toggle "Install unknown apps" ON
Problem: Gradle sync errors, build errors
Solutions:
-
Clean project:
cd android ./gradlew clean -
Invalidate caches:
- File → Invalidate Caches
- Check all boxes
- Invalidate and Restart
-
Re-sync Gradle:
- File → Sync Project with Gradle Files
-
Update Gradle (if prompted):
- Click "Update" in notification
Issue: Header/menu hidden behind status bar
Already fixed! Safe area insets applied.
If still seeing issue:
# Ensure you have latest code
cd /Users/dmungamuri/AndroidStudioProjects/cardadvisorapp
git pull origin main
npx cap copy android
# RebuildAlready fixed! AI now explicitly fetches 70+ categories.
If still missing:
- Refresh card rules (tap 🔄 icon)
- Wait for AI to re-fetch from bank website
- Check modal view (tap 👁️) - scroll through all sections
Now you can:
- ✅ Add more cards to your portfolio
- ✅ Get recommendations for every purchase
- ✅ Maximize rewards on all spending
- ✅ Track API usage via toast notifications
- ✅ Keep rules updated with refresh buttons
- View full documentation: README.md
- Understand architecture: ARCHITECTURE.md
- Check GitHub: Repository
- Re-read this guide - Most issues covered here
- Check main README - Detailed feature explanations
- Use Chrome DevTools -
chrome://inspectfor debugging - Check console logs - See what's happening
- Open GitHub issue - Report bugs or request features
Happy spending & maximizing rewards! 💳✨