Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,24 @@ The table below catalogs the samples and applications available in this reposito
| Sample App | Description | Directory |
| :--- | :--- | :--- |
| **Android AI Sample Catalog** <br><br> ![Android AI Sample Catalog](https://developer.android.com/static/ai/assets/images/ai_catalog_screenshot_1440.png) | A standalone showcase application containing multiple standalone, self-contained samples demonstrating various Gemini integration capabilities (hybrid inference, chat, multimodal, summarization, writing assistance, etc.) on Android. | [ai-sample-catalog/](ai-sample-catalog/) |
| **Jetpacker (Coming Soon)** | A sample showing Jetpacker integration and AI-guided capabilities for Android development. | *To be added soon* |
| **Jetpacker** <br><br> ![Jetpacker Home Screen](jetpacker/screenshots/home.png) | A complete travel planner application leveraging on-device ML Kit AI (for summaries, speech transcription, expense receipt parsing, translation fallback) and cloud-based Firebase AI logic to manage trips, itinerary events, reviews, and bookings. | [jetpacker/](jetpacker/) |

---

## 🛠️ Getting Started

To explore or run a specific sample, navigate to its respective directory and follow the setup instructions inside its local `README.md`.

For example, to run the Android AI Sample Catalog:
1. Open the [ai-sample-catalog/](ai-sample-catalog/) directory in Android Studio.\n2. Follow the Firebase project configuration instructions detailed in the [ai-sample-catalog/README.md](ai-sample-catalog/README.md).
### Running the Android AI Sample Catalog
1. Open the [ai-sample-catalog/](ai-sample-catalog/) directory in Android Studio.
2. Follow the Firebase project configuration instructions detailed in the [ai-sample-catalog/README.md](ai-sample-catalog/README.md).
3. Build and run the `app` configuration.

### Running Jetpacker
1. Open the [jetpacker/android/](jetpacker/android/) directory in Android Studio.
2. Follow the Firebase project and local properties setup instructions in [jetpacker/README.md](jetpacker/README.md).
3. Build and run the `:app` configuration.

---

## 🤝 Contributions and Feedback
Expand Down
6 changes: 6 additions & 0 deletions jetpacker/.agents/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Code Style & Formatting Constraints

## Avoid Fully Qualified Class Names (FQCN)
When writing or modifying Kotlin, Java, or Compose files:
1. **Always Use Imports**: Never write inline Fully Qualified Class Names (e.g., `com.example.jetpacker.core.flags.FeatureFlags`, `java.time.Instant`) in function bodies, parameter lists, or property definitions.
2. **Explicit File-Level Imports**: Add explicit `import` statements at the top of the file for all referenced types, classes, and utilities.
152 changes: 152 additions & 0 deletions jetpacker/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: JetPacker CI

on:
push:
branches: [ main, main2 ]
pull_request:
branches: [ main, main2 ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-24-04-c3-standard-4
defaults:
run:
working-directory: android

steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up JDK 17
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a
with:
distribution: 'zulu'
java-version: '17'

- name: Cache Android SDK
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25
with:
path: /usr/local/lib/android/sdk
key: ${{ runner.os }}-android-sdk
restore-keys: |
${{ runner.os }}-android-sdk

- name: Setup Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699

- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92
with:
cache-overwrite-existing: true

- name: Make gradlew executable
run: chmod +x gradlew

- name: Run Unit Tests
run: ./gradlew test --build-cache --stacktrace

- name: Upload Test Reports
if: always()
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with:
name: unit-test-reports
path: "**/build/reports/tests/test*/"

screenshot-tests:
name: Run Screenshot Tests
runs-on: ubuntu-24-04-c3-standard-4
defaults:
run:
working-directory: android

steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up JDK 17
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a
with:
distribution: 'zulu'
java-version: '17'

- name: Cache Android SDK
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25
with:
path: /usr/local/lib/android/sdk
key: ${{ runner.os }}-android-sdk
restore-keys: |
${{ runner.os }}-android-sdk

- name: Setup Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699

- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92
with:
cache-overwrite-existing: true

- name: Make gradlew executable
run: chmod +x gradlew

- name: Run Screenshot Tests
run: ./gradlew validateDebugScreenshotTest --build-cache --stacktrace

- name: Upload Screenshot Test Reports
if: always()
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with:
name: screenshot-test-reports
path: |
**/build/reports/screenshotTest/
**/build/outputs/screenshotTest-results/
**/build/test-results/validateDebugScreenshotTest/

build-apk:
name: Build Debug APK
runs-on: ubuntu-24-04-c3-standard-4
defaults:
run:
working-directory: android

steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0

- name: Set up JDK 17
uses: actions/setup-java@0f481fcb613427c0f801b606911222b5b6f3083a
with:
distribution: 'zulu'
java-version: '17'

- name: Cache Android SDK
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25
with:
path: /usr/local/lib/android/sdk
key: ${{ runner.os }}-android-sdk
restore-keys: |
${{ runner.os }}-android-sdk

- name: Setup Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699

- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f131e8634966bd73d06cc69884922b02e6faf92
with:
cache-overwrite-existing: true

- name: Make gradlew executable
run: chmod +x gradlew

- name: Build Debug APK
run: ./gradlew assembleDebug --build-cache --stacktrace

- name: Upload Debug APK
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with:
name: jetpacker-debug-apk
path: android/app/build/outputs/apk/debug/*.apk
28 changes: 28 additions & 0 deletions jetpacker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Built artifacts
**/build/

# Local configuration file (sdk path, etc)
local.properties

# Google Services configuration (contains credentials)
**/google-services.json

# Log Files
*.log

# Android Studio local configuration
.idea/
*.iml

# Gradle files
.gradle/

# Backup files
*.bak
*~

# Exported versions
export/

# Generated third-party notices
THIRD_PARTY_NOTICES
16 changes: 16 additions & 0 deletions jetpacker/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Code of Conduct

## Our Pledge

We are committed to providing a friendly, safe, and welcoming environment for all community members, developers, and users of this sample project.

## Community Standards

When interacting with this project (such as viewing code, discussing samples, or reference work):
* Be respectful, friendly, and professional.
* Focus on constructive discussions.
* Respect differing opinions and viewpoints.

## Scope

We pledge to maintain a safe, welcoming space for anyone who interacts with our samples or contributes to the project.
48 changes: 48 additions & 0 deletions jetpacker/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing to JetPacker

We'd love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles.

## Contributor License Agreements

Please fill out either the individual or corporate Contributor License Agreement (CLA).

* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).

Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.

***Note***: Only original source code from you and other people who have signed the CLA can be accepted into the main repository.

## Contributing Code

We welcome pull requests for bug fixes and small improvements. If you want to contribute a new feature or make a significant change, please open an issue first to discuss it with the maintainers.

To submit a contribution:
1. Fork the repository.
2. Create a new branch for your changes (`git checkout -b feature/my-new-feature`).
3. Make your changes and ensure they follow the project's code style and guidelines.
4. Run all tests to make sure everything still works.
5. Commit your changes with a clear commit message.
6. Push to your fork and submit a pull request to the `main` branch.

## Community Guidelines

This project follows the [Google Open Source Community Guidelines](https://opensource.google/conduct/).

## Setting Up the Development Environment

If you wish to run, explore, or modify the code locally:

### Prerequisites
1. **Android Studio**: Make sure you have the latest version of Android Studio.
2. **Android SDK**: Android SDK with API Level 36.
3. **Java Development Kit (JDK)**: JDK 17 is used for compile and target compatibility.

### Building the Project
1. Clone the repository:
```bash
git clone https://github.com/android/ai-samples.git
```
2. Open the project in Android Studio.
3. Gradle will automatically sync and resolve dependencies.
4. Run the `:app` module on an emulator or connected device.
Loading
Loading