# RRO Example

Here are steps to create an RRO app:

1. Setting up the Android project: First, create a new Android project in Android Studio. Name it something like "MySystemUIOverlay".
2. Configuring the manifest file:

```xml
<!-- AndroidManifest.xml -->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mysystemuioverlay">
    
    <application
        android:hasCode="false"
        android:icon="@android:drawable/ic_menu_compass"
        android:label="My SystemUI Overlay">
        
        <overlay
            android:targetPackage="com.android.systemui"
            android:isStatic="true"
            android:priority="1" />
    </application>
</manifest>

<!-- Explanation:
     - package: Unique identifier for your overlay
     - android:hasCode="false": Indicates this app has no Java code
     - android:targetPackage: Specifies which app this overlay is for
     - android:isStatic="true": Overlay is compiled into the system
     - android:priority: Determines order if multiple overlays target the same resource -->
```

3. Creating resource files: Let's create a few example resource files to demonstrate different types of overlays.

```xml
<!-- res/values/colors.xml -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Override the accent color of the system -->
    <color name="system_accent_color">#FF4081</color>
    
    <!-- Override the primary color of the system -->
    <color name="system_primary_color">#3F51B5</color>
</resources>
```

```xml
<!-- res/values/dimens.xml -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Override the status bar height -->
    <dimen name="status_bar_height">28dp</dimen>
    
    <!-- Override the quick settings tile size -->
    <dimen name="qs_tile_height">84dp</dimen>
</resources>
```

```xml
<!-- res/values/strings.xml -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- Override a system string -->
    <string name="global_action_restart">Reboot Device</string>
</resources>
```

4. Building the RRO APK: Use Android Studio to build your project. This will generate an APK file.
5. Installing the RRO APK: You can install the APK using adb:

```sh
adb shell cmd overlay enable com.example.mysystemuioverlay
```

To see the changes, you may need to restart SystemUI or reboot your device:

```sh
adb shell stop; adb shell start  # Restart SystemUI
```

Or

```sh
adb reboot  # Reboot device
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.tejpratapsingh.com/android-tips/theming/theming/rro/rro-example.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
