Skip to content

Latest commit

 

History

History
310 lines (243 loc) · 7.14 KB

File metadata and controls

310 lines (243 loc) · 7.14 KB

📱 Android Setup Guide

Complete guide to using Universal Code Validator on Android devices.

🎯 Why Use This on Android?

  • ✅ Code on-the-go with your mobile device
  • ✅ Analyze Python projects anywhere, anytime
  • ✅ Learn code quality best practices
  • ✅ Perfect for students and mobile developers
  • ✅ No internet required (works offline!)

📲 Installation Options

Option 1: Pydroid 3 (Recommended for Beginners)

Step 1: Install Pydroid 3

Step 2: Download the Validator

  1. Open your browser on Android
  2. Go to: https://github.com/goinboxme/universal-code-validator
  3. Click on UNIVERSAL_CODE_VALIDATOR_V3.py
  4. Click "Raw" button
  5. Long press and "Save page as..." or copy the URL
  6. Download to your device (e.g., /storage/emulated/0/Download/)

Step 3: Open in Pydroid 3

  1. Open Pydroid 3
  2. Tap the folder icon (📁)
  3. Navigate to your download location
  4. Open UNIVERSAL_CODE_VALIDATOR_V3.py

Step 4: Run It!

  1. Tap the ▶️ (Play) button
  2. Follow the interactive prompts
  3. Type . and press Enter to scan current folder
  4. Done! 🎉

Option 2: Termux (For Advanced Users)

Step 1: Install Termux

  • Download from F-Droid (recommended)
  • Or from Google Play Store

Step 2: Install Python

# Update packages
pkg update && pkg upgrade

# Install Python
pkg install python

# Install git (optional, for cloning)
pkg install git

Step 3: Download the Validator

Method A: Using git (recommended)

cd ~/storage/downloads
git clone https://github.com/goinboxme/universal-code-validator.git
cd universal-code-validator

Method B: Direct download

cd ~/storage/downloads
curl -O https://raw.githubusercontent.com/goinboxme/universal-code-validator/main/UNIVERSAL_CODE_VALIDATOR_V3.py

Step 4: Run It!

python UNIVERSAL_CODE_VALIDATOR_V3.py

🎮 How to Use (Android)

Basic Workflow

  1. Put your Python files in a folder

    /storage/emulated/0/MyPythonProjects/
    ├── script1.py
    ├── script2.py
    └── UNIVERSAL_CODE_VALIDATOR_V3.py
    
  2. Navigate to that folder (in Termux)

    cd /storage/emulated/0/MyPythonProjects
  3. Run the validator

    python UNIVERSAL_CODE_VALIDATOR_V3.py
  4. Choose what to scan

    Enter file or directory path (or '.' for current): .
    
    • Type . → Scans all Python files in current folder
    • Type script1.py → Scans only that file
    • Leave blank → Same as . (scans current folder)
  5. Wait for analysis

    🔍 Scanning for Python files in: .
    📁 Found 10 Python file(s)
    
    [1/10] Analyzing: script1.py
        🎯 Detected Role: SCRIPT
        ✅ No issues found
        📊 Maintainability: 75.0/100
    ...
    
  6. View results

    • Console output shows summary
    • HTML report saved in same folder
    • JSON report also generated

📊 Viewing HTML Reports on Android

Method 1: File Manager

  1. Open your file manager
  2. Navigate to the folder
  3. Tap on code_analysis_YYYYMMDD_HHMMSS.html
  4. Choose your browser to open it

Method 2: Termux (using termux-open)

# Install termux-api (if not installed)
pkg install termux-api

# Open HTML in browser
termux-open code_analysis_*.html

Method 3: Pydroid 3

  1. In Pydroid file browser
  2. Long press the HTML file
  3. Select "Open with..."
  4. Choose your browser

💡 Tips for Android Users

Storage Access in Termux

# Grant storage permission
termux-setup-storage

# Access your phone's storage
cd ~/storage/downloads   # Downloads folder
cd ~/storage/dcim        # Camera photos
cd ~/storage/shared      # Shared storage

Quick Access Alias (Termux)

Add this to ~/.bashrc:

alias validate='python ~/storage/downloads/UNIVERSAL_CODE_VALIDATOR_V3.py'

Then you can just type:

validate

Scanning Multiple Projects

# Scan project 1
cd /storage/emulated/0/Project1
python path/to/UNIVERSAL_CODE_VALIDATOR_V3.py .

# Scan project 2
cd /storage/emulated/0/Project2
python path/to/UNIVERSAL_CODE_VALIDATOR_V3.py .

Batch Analysis Script

Create a check_all.sh:

#!/bin/bash
for dir in /storage/emulated/0/MyProjects/*/; do
    echo "Analyzing $dir"
    cd "$dir"
    python /path/to/UNIVERSAL_CODE_VALIDATOR_V3.py .
done

🔧 Troubleshooting

"Permission denied" error

# In Termux
termux-setup-storage
# Tap "Allow" when prompted

"Python not found" (Pydroid 3)

  • Make sure Pydroid 3 is fully installed
  • Try reinstalling from Play Store

"File not found"

# Check current directory
pwd

# List files
ls -la

# Navigate to correct folder
cd /storage/emulated/0/YourFolder

Reports not opening

  • Make sure you have a browser installed
  • Try downloading a different file manager
  • Copy HTML content to an online HTML viewer

Slow on large projects

  • This is normal for complex codebases
  • Android devices may take longer than desktops
  • Consider analyzing smaller chunks

📚 Common Android File Paths

/storage/emulated/0/              → Main storage
/storage/emulated/0/Download/     → Downloads
/storage/emulated/0/Documents/    → Documents
/storage/emulated/0/DCIM/         → Camera
/data/user/0/ru.iiec.pydroid3/    → Pydroid 3 internal
~/storage/                        → Termux storage shortcuts

🎓 Learning Tips

Start Small

# Create a test file first
echo 'print("Hello")' > test.py

# Analyze it
python UNIVERSAL_CODE_VALIDATOR_V3.py test.py

Progressive Learning

  1. Week 1: Analyze simple scripts
  2. Week 2: Fix HIGH priority issues
  3. Week 3: Improve maintainability scores
  4. Week 4: Tackle CRITICAL issues

Practice Exercises

# Create intentionally bad code
# bad_example.py
def very_long_function_name_that_does_too_many_things():
    if True:
        if True:
            if True:
                if True:
                    if True:
                        pass  # Too much nesting!

# Run validator
python UNIVERSAL_CODE_VALIDATOR_V3.py bad_example.py

# See what issues are found
# Practice fixing them!

🌟 Best Practices for Mobile Coding

  1. Keep files organized in clear folder structures
  2. Run validator frequently - before committing code
  3. Use the HTML reports for detailed analysis
  4. Learn from issues - read the suggestions
  5. Start with INFO/LOW severity issues for practice
  6. Progress to CRITICAL issues as you improve

📞 Support

Having issues on Android?

  1. Check this guide first
  2. Search existing GitHub Issues
  3. Create a new issue with:
    • Android version
    • Pydroid 3 / Termux version
    • Python version (python --version)
    • Screenshot of error
    • What you tried

⭐ Success Stories

Share your experience! Have you:

  • Fixed code quality issues on your phone?
  • Learned Python best practices?
  • Improved your coding habits?

Star the repo and leave feedback! 🌟


Happy Mobile Coding! 📱💻✨