# FtosNew Project Overview and Recommendations

This document outlines the recent work performed on the `FtosNew` project and provides recommendations for effective testing and performance monitoring using Android Studio.

## Recent Work (FtosNew)

The project has undergone significant configuration and code changes to resolve licensing issues and prepare for modern AIR packaging.

### Geolocation Strategy Shift
- **Distriqt Transition:** Switched geolocation logic from the native `flash.sensors.Geolocation` to the Distriqt Location ANE.
- **ANE Preferred:** The `com.distriqt.Location` ANE is now the preferred location method.
- **Implementation:** Updated `com.Locate` and `Ftos.mxml` to handle Distriqt location events and permissions.

### Packaging and Configuration
- **AIR Package (Ftos.air):** Successfully packaged the project into a `.air` file using `adt`.
- **Signing:** Created a self-signed certificate (`cert.p12`) for the packaging process.
- **Descriptor Fixes:** 
    - Resolved `Ftos-app.xml` validation errors.
    - Set correct `<content>` to `Ftos.swf`.
    - Cleaned up duplicate `<extensionID>` entries.
    - Replaced placeholder values with valid test IDs for AdMob and URL schemes.

### Dependency Management
- **APM Integration:** Aligned project dependencies with `project.apm` and confirmed the `ane` and `apm_packages` directories are correctly populated.
- **Resource Conflict Mitigation:** Identified resource conflicts in the `Helpshift` ANE during Android builds, providing a roadmap for future mobile-specific fixes.

---

## Android Studio Recommendations

For effective testing of the generated Android APKs on Windows 10+, the following tools and practices are recommended.

### 1. Recommended Simulator: Android Virtual Device (AVD)
The official Android Studio emulator is the most accurate for testing.
- **Setup:** Use a "System Image" that includes **Google Play Services**, as many Distriqt ANEs (Ads, Firebase) require them.
- **Hardware Profile:** Create a device profile matching your target hardware (e.g., Pixel 7) to test UI responsiveness and "Drawer" layout logic.

### 2. Monitoring and Statistics
To collect run statistics and debug effectively:

- **Logcat (Real-time Logs):**
  Monitor ActionScript `trace()` output and system errors.
  ```powershell
  adb logcat *:S air.com.aamg.Ftos:V
  ```
- **Android Profiler:**
  Use the **Profiler** tab in Android Studio to track:
  - **CPU Usage:** Identify lag during transitions.
  - **Memory:** Monitor if ANEs (like `NativeWebView`) are leaking memory.
  - **Network:** Verify cloud storage and API calls.
- **Dumpsys (Raw Data):**
  Query specific metrics via ADB:
  ```powershell
  adb shell dumpsys meminfo air.com.aamg.Ftos
  ```

### 3. Debugging ANEs
Since the project relies heavily on Native Extensions:
- If an ANE fails to initialize, check Logcat for `Could not find class` or `Resource not found` errors.
- Use **Bug Reports** (Emulator Extended Controls > Bug Report) to capture a full diagnostic snapshot if the app crashes unexpectedly.

---
*Created on: 2026-04-15*
