בדף הזה מוסבר איך להגדיר את סביבת הפיתוח כדי להשתמש ב-Glance. אפשר להוריד את הגרסה האחרונה שזמינה מדף הגרסה.
מוסיפים את התלות הספציפית ב-Glance למודול של האפליקציה בהתאם לסוג ה-Glance שרוצים ליצור.
dependencies {
   // For AppWidgets support
   implementation "androidx.glance:glance-appwidget:1.1.1"
   // For interop APIs with Material 3
   implementation "androidx.glance:glance-material3:1.1.1"
   // For interop APIs with Material 2
   implementation "androidx.glance:glance-material:1.1.1"
}
הפעלת קומפיילר של Compose
כדי לוודא שהקומפיילר של Compose זמין ל-Glance, מגדירים את האפשרויות הבאות:
android {
   buildFeatures {
      compose true
   }
   composeOptions {
      kotlinCompilerExtensionVersion = "1.5.15"
   }
   kotlinOptions {
      jvmTarget = "1.8"
   }
}