GlanceTileService

abstract class GlanceTileService : TileService


TileService which can consume a Glance composition, convert it to a Wear Tile, and provide it to the system. You must implement the Content function to provide your Tile layout, for example:

class MyTile: GlanceTileService() {
@Composable
@GlanceComposable
override fun Content {
Text("Hello World!")
}
}

You must also register ComposeTileService instances in your manifest to allow the system to discover them. Your service must include an intent filter for the action androidx.wear.tiles.action.BIND_TILE_PROVIDER, and require the permission com.google.android.wearable.permission.BIND_TILE_PROVIDER.

Summary

Public constructors

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Public functions

abstract Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

suspend T
<T : Any?> getTileState()

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open IBinder?
onBind(intent: Intent)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
onStart(intent: Intent?, startId: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

suspend T
<T : Any?> updateTileState(updateState: suspend (T) -> T)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Protected functions

final ListenableFuture<ResourceBuilders.Resources>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

final ListenableFuture<TileBuilders.Tile>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Public properties

open GlanceStateDefinition<*>?

This property is deprecated. glance-wear-tiles is deprecated and will be removed

open TimelineMode

This property is deprecated. glance-wear-tiles is deprecated and will be removed

Inherited functions

From android.content.Context
open Boolean
bindIsolatedService(
    p0: Intent,
    p1: Context.BindServiceFlags,
    p2: String,
    p3: Executor,
    p4: ServiceConnection
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

ColorStateList

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Drawable?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

String

This function is deprecated. glance-wear-tiles is deprecated and will be removed

String
getString(p0: Int, vararg p1: Any)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

T
<T : Any> getSystemService(p0: Class<T>)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

CharSequence
getText(p0: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

TypedArray

This function is deprecated. glance-wear-tiles is deprecated and will be removed

TypedArray

This function is deprecated. glance-wear-tiles is deprecated and will be removed

TypedArray

This function is deprecated. glance-wear-tiles is deprecated and will be removed

TypedArray
obtainStyledAttributes(p0: AttributeSet?, p1: IntArray, p2: Int, p3: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

From android.content.ContextWrapper
open Boolean
bindIsolatedService(
    p0: Intent,
    p1: Int,
    p2: String,
    p3: Executor,
    p4: ServiceConnection
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean
bindService(
    p0: Intent,
    p1: ServiceConnection,
    p2: Context.BindServiceFlags
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean
bindService(
    p0: Intent,
    p1: Context.BindServiceFlags,
    p2: Executor,
    p3: ServiceConnection
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean
bindService(p0: Intent, p1: Int, p2: Executor, p3: ServiceConnection)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean
bindServiceAsUser(
    p0: Intent,
    p1: ServiceConnection,
    p2: Context.BindServiceFlags,
    p3: UserHandle
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open IntArray

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open IntArray

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int
checkContentUriPermissionFull(p0: Uri, p1: Int, p2: Int, p3: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int
checkPermission(p0: String, p1: Int, p2: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int
checkUriPermission(p0: Uri, p1: Int, p2: Int, p3: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int
checkUriPermission(p0: Uri?, p1: String?, p2: String?, p3: Int, p4: Int, p5: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open IntArray
checkUriPermissions(p0: MutableList<Uri>, p1: Int, p2: Int, p3: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. Deprecated in Java

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context
createWindowContext(p0: Display, p1: Int, p2: Bundle?)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Array<String>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
enforcePermission(p0: String, p1: Int, p2: Int, p3: String?)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
enforceUriPermission(p0: Uri, p1: Int, p2: Int, p3: Int, p4: String)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
enforceUriPermission(
    p0: Uri?,
    p1: String?,
    p2: String?,
    p3: Int,
    p4: Int,
    p5: Int,
    p6: String?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Array<String>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open ApplicationInfo

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open AssetManager

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open AttributionSource

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open String?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Context

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open ClassLoader

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open ContentResolver

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File
getDir(p0: String, p1: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Display?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Array<File>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Array<File>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Array<File>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Executor

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Looper

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open File

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Array<File>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open String

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open String

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open PackageManager

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open String

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open String

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open ContextParams?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Resources

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open SharedPreferences

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Any

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open String?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Resources.Theme

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Drawable

This function is deprecated. Deprecated in Java

open Int

This function is deprecated. Deprecated in Java

open Int

This function is deprecated. Deprecated in Java

open Unit
grantUriPermission(p0: String, p1: Uri, p2: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open FileInputStream

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open FileOutputStream

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open SQLiteDatabase

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open SQLiteDatabase
openOrCreateDatabase(
    p0: String,
    p1: Int,
    p2: SQLiteDatabase.CursorFactory,
    p3: DatabaseErrorHandler?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Drawable

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Intent?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Intent?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Intent?
registerReceiver(
    p0: BroadcastReceiver?,
    p1: IntentFilter,
    p2: String?,
    p3: Handler?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Intent?
registerReceiver(
    p0: BroadcastReceiver?,
    p1: IntentFilter,
    p2: String?,
    p3: Handler?,
    p4: Int
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
revokeUriPermission(p0: String, p1: Uri, p2: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
sendBroadcast(p0: Intent, p1: String?, p2: Bundle?)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: BroadcastReceiver?,
    p3: Handler?,
    p4: Int,
    p5: String?,
    p6: Bundle?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: Bundle?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: String?,
    p2: String?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
sendOrderedBroadcast(
    p0: Intent,
    p1: Int,
    p2: String?,
    p3: String?,
    p4: BroadcastReceiver?,
    p5: Handler?,
    p6: String?,
    p7: Bundle?,
    p8: Bundle?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
sendOrderedBroadcastAsUser(
    p0: Intent,
    p1: UserHandle,
    p2: String?,
    p3: BroadcastReceiver?,
    p4: Handler?,
    p5: Int,
    p6: String?,
    p7: Bundle?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit
sendStickyOrderedBroadcast(
    p0: Intent,
    p1: BroadcastReceiver?,
    p2: Handler?,
    p3: Int,
    p4: String?,
    p5: Bundle?
)

This function is deprecated. Deprecated in Java

open Unit
sendStickyOrderedBroadcastAsUser(
    p0: Intent,
    p1: UserHandle,
    p2: BroadcastReceiver?,
    p3: Handler?,
    p4: Int,
    p5: String?,
    p6: Bundle?
)

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open ComponentName?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
startIntentSender(p0: IntentSender, p1: Intent?, p2: Int, p3: Int, p4: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
startIntentSender(
    p0: IntentSender,
    p1: Intent?,
    p2: Int,
    p3: Int,
    p4: Int,
    p5: Bundle?
)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open ComponentName?

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

From android.app.Service
open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Application

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Int

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated.

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Int
onStartCommand(p0: Intent, p1: Int, p2: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit
onTimeout(p0: Int, p1: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Unit
startForeground(p0: Int, p1: Notification, p2: Int)

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Unit

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Boolean

This function is deprecated. glance-wear-tiles is deprecated and will be removed

From androidx.wear.tiles.TileService
open ListenableFuture<Void>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated. glance-wear-tiles is deprecated and will be removed

open Unit

This function is deprecated.

use onRecentInteractionEventsAsync.

open Unit

This function is deprecated.

use onRecentInteractionEventsAsync.

open ListenableFuture<ResourceBuilders.Resources>

This function is deprecated. glance-wear-tiles is deprecated and will be removed

Public constructors

GlanceTileService

Added in 1.0.0-alpha07
Deprecated in 1.0.0-alpha07
GlanceTileService(
    errorUiLayout: LayoutElementBuilders.LayoutElement? = errorUiLayout()
)
Parameters
errorUiLayout: LayoutElementBuilders.LayoutElement? = errorUiLayout()

If not null and an error occurs within this glance wear tile, the tile is updated with an error UI using the provided layout.

Public functions

Content

Added in 1.0.0-alpha07
Deprecated in 1.0.0-alpha07
@Composable
@GlanceComposable
abstract fun Content(): Unit

Override this method to set the layout to use in your Tile.

getTileState

suspend fun <T : Any?> getTileState(): T

Retrieve the state of the wear tile provided by this service

onBind

open fun onBind(intent: Intent): IBinder?

onCreate

open fun onCreate(): Unit

onDestroy

open fun onDestroy(): Unit

onStart

Added in 1.0.0-alpha07
Deprecated in 1.0.0-alpha07
open fun onStart(intent: Intent?, startId: Int): Unit

updateTileState

suspend fun <T : Any?> updateTileState(updateState: suspend (T) -> T): T

Update the state of the wear tile provided by this service

Protected functions

onResourcesRequest

Added in 1.0.0-alpha07
Deprecated in 1.0.0-alpha07
protected final fun onResourcesRequest(requestParams: RequestBuilders.ResourcesRequest): ListenableFuture<ResourceBuilders.Resources>

Called by the system to fetch a resources bundle from this GlanceTileService.

Note that this call exists due to this class extending TileService; this should not be called directly.

onTileRemoveEvent

@CallSuper
protected open fun onTileRemoveEvent(requestParams: EventBuilders.TileRemoveEvent): Unit

Called when a tile provided by this Tile Provider is removed from the carousel.

Note that this is called from your app's main thread, which is usually also the UI thread.

Parameters
requestParams: EventBuilders.TileRemoveEvent

Parameters about the request. See TileRemoveEvent for more info.

onTileRequest

Added in 1.0.0-alpha07
Deprecated in 1.0.0-alpha07
protected final fun onTileRequest(requestParams: RequestBuilders.TileRequest): ListenableFuture<TileBuilders.Tile>

Called by the system to fetch a tile from this GlanceTileService.

Note that this call exists due to this class extending TileService; this should not be called directly.

Public properties

stateDefinition

Added in 1.0.0-alpha07
Deprecated in 1.0.0-alpha07
open val stateDefinitionGlanceStateDefinition<*>?

Data store for tile data specific to this service

timelineMode

Added in 1.0.0-alpha07
Deprecated in 1.0.0-alpha07
open val timelineModeTimelineMode

Defines the handling of timeline