Scroll Essential Android 2.3 Manual de usuario Pagina 21

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 47
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 20
CHAPTER 4
Android Wear Demand
By Michael Hahn, January 2015
The Demand context is one of the core functions for Android Wear. A demand is displayed as a large icon, typically
when you swipe a displayed suggestion (notification). You tap on an icon to perform the desired demand.
When new email arrives for example, you swipe to the left to scroll through the demand icons, such as open, reply,
and archive. You can create custom icons for your app as well. This section explains how to code your own wearable
demand that handles a voice reply.
4.1 First Android Wear Demand
If you have not already done so, Create a Project. The new project wizard in Android Studio creates a project with
two main activities, one for the handheld device and another for the wearable. To create your first demand, add code
in the handheld activity only, located in the “mobile” branch of the project hierarchy. The software preinstalled on a
wearable device or emulator handles the task of displaying notifications and handling demands on the wearable side.
4.1.1 Add Build Dependencies
Add build dependencies for the wearable support package to the build.gradle (Module:mobile) file in Gradle Scripts
folder, if necessary.
dependencies {
compile fileTree(dir: ’libs’, include: [’
*
.jar’])
wearApp project(’:wear’)
compile ’com.android.support:appcompat-v7:21.+’
compile ’com.google.android.gms:play-services:6.5.+’
}
17
Vista de pagina 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 46 47

Comentarios a estos manuales

Sin comentarios