Skip to main content

App Installation

Development Environment Setup

Before installing the Car2Go Pro app, you need to set up your development environment. Follow these steps carefully:

1. Flutter Installation

  1. Download Flutter SDK:

    • Visit Flutter Official Website
    • Download the latest Flutter SDK zip file
    • Extract to a location (e.g., C:\flutter)
    • Add Flutter to PATH:
      • Search for "Environment Variables"
      • Under "System Variables", edit "Path"
      • Add new entry: C:\flutter\bin
  2. Install Git:

2. Android Studio Installation

  1. Download Android Studio from Android Developer Website
  2. Run the installer (.exe file)
  3. Select all components during installation
  4. Complete the installation

3. Android SDK Setup

  1. Open Android Studio

  2. Go to Tools → SDK Manager

  3. In SDK Manager, you'll see several tabs. Install the following components:

    "SDK Platforms" tab:

    • Android 12.0 (API Level 31)
    • Android 11.0 (API Level 30) [Optional]

    "SDK Tools" tab:

    • Android SDK Build-Tools
    • Android SDK Command-line Tools
    • Android SDK Platform-Tools
    • Android Emulator
    • Android SDK Tools
    tip
    1. Click "Show Package Details" checkbox at bottom right to see all versions
    2. For Build-Tools, select the latest version (e.g., 33.0.0)
    3. Total download size might be around 1-2 GB
  4. Click "Apply" and accept the license agreements

SDK Location

You can find your Android SDK location at:

  • Windows: C:\Users\YourUsername\AppData\Local\Android\Sdk
  • macOS: ~/Library/Android/sdk
  • Linux: ~/Android/Sdk

4. Flutter Setup Verification

  1. Open Command Prompt
  2. Run:
    flutter doctor
    flutter doctor --android-licenses

5. IDE Setup

  1. Install Flutter Plugin:

    • Open Android Studio
    • Go to File → Settings → Plugins
    • Search for "Flutter"
    • Click Install and restart Android Studio
  2. Open Project:

    • Click File → Open
    • Navigate to your project folder
    • Click OK
    • Wait for project indexing to complete
  3. Configure Flutter SDK:

    • Go to File → Settings → Languages & Frameworks → Flutter
    • Set Flutter SDK path to where you installed Flutter
    • Click OK
  4. Configure Android SDK:

    • Go to File → Settings → Appearance & Behavior → System Settings → Android SDK
    • Ensure proper Android SDK is installed
    • Click OK

6. Create Android Virtual Device (AVD)

  1. Open Android Studio
  2. Click Tools → Device Manager
  3. Create Virtual Device
  4. Select Pixel 4 (or any other device)
  5. Download system image (API 31)
  6. Complete AVD creation

After completing these steps, you're ready to proceed with the Car2Go Pro app installation.

info

Note: Make sure you have at least 8GB RAM and 10GB free disk space for smooth development experience

App Installation Process

info

Note : This installation process applies for both user and driver app

Initial Project Setup

  1. Extract the project:

    • Unzip the downloaded project file to your desired location
    • Open Command Prompt or Terminal
    • Navigate to the extracted project directory using cd path/to/project
  2. Clean and Setup Project:

    # Check Flutter version and channel
    flutter --version

    # Run flutter doctor to ensure everything is ready
    flutter doctor

    # Clean the project to ensure fresh start
    flutter clean

    # Get all dependencies
    flutter pub get # Install dependencies
Troubleshooting Common Issues
  1. If flutter pub get fails:

    # Remove existing packages
    rm -rf pubspec.lock
    rm -rf .packages
    flutter clean
    flutter pub get
  2. If Android Studio doesn't recognize Flutter:

    flutter config --android-studio-dir="<path to Android Studio>"
  3. If PATH is not working:

    • Windows: Restart Command Prompt after PATH changes
    • Linux/macOS: Run source ~/.bashrc or source ~/.zshrc
  4. For permission issues on Linux:

    sudo chown -R $USER:$USER /path/to/flutter
  1. Check Project Structure:

    • Ensure all folders are properly extracted
    • Verify the following folders exist:
      • /android
      • /ios
      • /lib
      • /assets
  2. IDE Setup:

    • Open the project in Android Studio or VS Code
    • Wait for IDE to complete initial setup and indexing
    • Ensure no red underlines or error indicators in the project
tip

If you face any dependency issues, try the following:

  • Run flutter clean and then run flutter pub get again

Configuration Files Setup

App Settings Setup

  1. Backend API Setup:

    • Open lib/utils/constants/app-constants.dart
    • Find the API URL section
    • Change it to your server address:
    static const String API_BASE_URL = "https://your-backend-url.com";

    Where to change API URL

  2. Maps Setup in App:

    • Open lib/utils/constants/app-secret.dart
    • Add your Google Maps key:
    static const String GOOGLE_MAPS_API_KEY = "<GOOGLE-MAPS-API-KEY>";

    Where to add Maps key in app

Important Security Tips
  1. Never share your API keys with anyone
  2. Don't put keys on GitHub or other public places
  3. Always use HTTPS for API URLs

Running in Development Mode

After completing all the setup steps above, you can run the project in development mode. This mode is ideal for testing and development as it provides hot reload capabilities and debugging tools.

  1. Connect a Device:

    • Connect a physical device via USB with USB debugging enabled
    • Or start an Android/iOS emulator
  2. Open Terminal in Project Root:

    # Verify connected devices
    flutter devices

    # List emulators
    flutter emulators

    # Launch specific emulator (replace emulator-id)
    flutter emulators --launch <emulator-id>

    # Run on specific device when multiple connected
    flutter run -d <device-id or emulator-id>

    # Run the app in debug mode
    flutter run
  3. Development Mode Features in Terminal:

    • Press 'r' in terminal to hot reload
    • Press 'R' for hot restart
    • Press 'q' to quit
    • Press 'h' to display all commands
Development Tips
  • Enable USB debugging on your Android device:

    1. Go to Settings → About Phone
    2. Tap Build Number 7 times to enable Developer Options
    3. Go back to Settings → Developer Options
    4. Enable USB Debugging
  • For iPhone development:

    1. Open Xcode and sign in with Apple ID
    2. Trust your development certificate
    3. Trust your device in Xcode

VS Code Debug Steps:

a. Select Device:

  • Look at the bottom status bar
  • Click on "No Device" or device name
  • Select your emulator or connected device

b. Start Debugging:

  • Method 1: Click the "Run and Debug" icon in the left sidebar (or press Ctrl+Shift+D)
  • Method 2: Press F5 key
  • Method 3: Open command palette (Ctrl+Shift+P), type "Debug: Start Debugging"

c. Debug Controls:

  • Use the debug toolbar at the top:
    • ▶️ Continue/Pause
    • ⤵️ Step Over
    • ⬇️ Step Into
    • ⬆️ Step Out
    • 🔄 Hot Reload
    • 🔁 Hot Restart
    • ⏹️ Stop
VS Code Debug Tips
  • Set breakpoints by clicking left of line numbers
  • View variables in the Debug sidebar
  • Use Debug Console for logging
  • Install "Dart Debug Extension Pack" for enhanced debugging
  1. Common Development Commands:

    # Clean and rebuild
    flutter clean
    flutter pub get
    flutter run

    # Check for issues
    flutter analyze

    # Run tests if available
    flutter test
  2. Debugging Tools:

    • Use print statements for basic logging:
      print('Debug: ${variable.toString()}');
    • Use IDE debugging features (breakpoints, variable inspection)
Performance Tips
  • Keep DevTools open to monitor performance
  • Use Profile mode for performance testing:
    flutter run --profile
  • Check CPU and memory usage in DevTools

Release Build Instructions

Android Release Build - Complete Guide for Beginners

Step 1: Prerequisites Setup

Before starting, ensure you have:

  • Latest Flutter SDK installed
  • Android Studio installed
  • Java Development Kit (JDK) installed

Step 2: Configure App Details

  1. Open your Flutter project
  2. Navigate to android/app/build.gradle
  3. Update these important values:
    defaultConfig {
    applicationId "com.yourcompany.yourappname" // Your unique app ID
    minSdkVersion 23 // Minimum Android version support
    targetSdkVersion 34 // Target Android version
    versionCode 1 // Increment this for each release
    versionName "1.0.0" // Your app version
    }

Step 3: Create Keystore (One-time Setup)

  1. Open terminal/command prompt
  2. Generate keystore by running:
    keytool -genkey -v -keystore android/app/upload-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias upload
  3. Save your passwords safely!

Step 4: Configure Signing

  1. Create key.properties in android/ folder
  2. Add these lines:
    storePassword=your_keystore_password
    keyPassword=your_key_password
    keyAlias=upload
    storeFile=upload-keystore.jks

Step 5: Update Gradle Config

Add this to android/app/build.gradle:

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}

Step 6: Build Release Version

For Play Store (App Bundle):

flutter clean              # Clean previous builds
flutter pub get # Get dependencies
flutter build appbundle # Create app bundle

Find at: build/app/outputs/bundle/release/app-release.aab

For Direct APK Installation:

flutter clean            # Clean previous builds
flutter pub get # Get dependencies
flutter build apk # Create APK

Find at: build/app/outputs/flutter-apk/app-release.apk

Important Tips

  • Test release build: flutter install
  • Keep keystore file safe
  • Never share key.properties or keystore
  • Test on multiple Android devices
  • Start with internal testing on Play Console
  • Verify app icon and splash screen
Android Build Tips
  • Use internal testing track on Play Console first
  • Back up your keystore file - it's required for future updates
  • Test the release version thoroughly before publishing

Additional Resources

Official Documentation

info

Documentation links are regularly updated with latest best practices.