Developer SDK

Android examples

Install the SDK · View source on GitHub ↗

embed/src/main/res/layout/activity_main.xml

xml
<?xml version="1.0" encoding="utf-8"?>
<!-- The one screen: Start, the status fields with the client and installation IDs, Stop, the licenses and the next step. -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/app_name"
            android:textAppearance="@android:style/TextAppearance.Material.Headline" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/intro"
            android:textAppearance="@android:style/TextAppearance.Material.Body1" />

        <Button
            android:id="@+id/start"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/start" />

        <TextView
            android:id="@+id/problem"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:textAppearance="@android:style/TextAppearance.Material.Body1"
            android:textColor="@android:color/holo_red_dark"
            android:visibility="gone" />

        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:shrinkColumns="1">

            <TableRow android:paddingVertical="4dp">

                <TextView
                    android:paddingStart="0dp"
                    android:paddingEnd="16dp"
                    android:text="@string/status_label"
                    android:textAppearance="@android:style/TextAppearance.Material.Body2" />

                <TextView
                    android:id="@+id/status_value"
                    android:textAppearance="@android:style/TextAppearance.Material.Body1" />
            </TableRow>

            <TableRow android:paddingVertical="4dp">

                <TextView
                    android:paddingStart="0dp"
                    android:paddingEnd="16dp"
                    android:text="@string/data_month_label"
                    android:textAppearance="@android:style/TextAppearance.Material.Body2" />

                <TextView
                    android:id="@+id/data_month_value"
                    android:textAppearance="@android:style/TextAppearance.Material.Body1" />
            </TableRow>

            <TableRow android:paddingVertical="4dp">

                <TextView
                    android:paddingStart="0dp"
                    android:paddingEnd="16dp"
                    android:text="@string/data_total_label"
                    android:textAppearance="@android:style/TextAppearance.Material.Body2" />

                <TextView
                    android:id="@+id/data_total_value"
                    android:textAppearance="@android:style/TextAppearance.Material.Body1" />
            </TableRow>

            <TableRow android:paddingVertical="4dp">

                <TextView
                    android:paddingStart="0dp"
                    android:paddingEnd="16dp"
                    android:text="@string/client_id_label"
                    android:textAppearance="@android:style/TextAppearance.Material.Body2" />

                <TextView
                    android:id="@+id/client_id_value"
                    android:textAppearance="@android:style/TextAppearance.Material.Body1"
                    android:textIsSelectable="true" />
            </TableRow>

            <TableRow android:paddingVertical="4dp">

                <TextView
                    android:paddingStart="0dp"
                    android:paddingEnd="16dp"
                    android:text="@string/installation_id_label"
                    android:textAppearance="@android:style/TextAppearance.Material.Body2" />

                <TextView
                    android:id="@+id/installation_id_value"
                    android:textAppearance="@android:style/TextAppearance.Material.Body1"
                    android:textIsSelectable="true" />
            </TableRow>
        </TableLayout>

        <Button
            android:id="@+id/stop"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:enabled="false"
            android:text="@string/stop" />

        <Button
            android:id="@+id/licenses"
            style="@android:style/Widget.Material.Button.Borderless.Colored"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:text="@string/licenses" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/next_steps"
            android:textAppearance="@android:style/TextAppearance.Material.Body1" />

        <TextView
            android:id="@+id/sdk_version"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="24dp"
            android:textAppearance="@android:style/TextAppearance.Material.Caption" />
    </LinearLayout>
</ScrollView>