Category «Android Advanced Concepts»

Dimming the System Bars in Android

The system bars are screen areas dedicated to the display of notifications, communication of device status, and device navigation. Typically the system bars (which consist of the status and navigation bars, as shown in figure 1) are displayed concurrently with your app. Apps that display immersive content, such as movies or images, can temporarily dim …

Accessibility Testing Checklist in Android

Testing is an important part of making your application accessible to users with varying abilities. Following design and development guidelines for accessibility are important steps toward that goal, but testing for accessibility can uncover problems with user interaction that are not obvious during design and development. This accessibility testing checklist guides you through the important …

Developing Accessible Applications in Android

Android has several accessibility-focused features baked into the platform, which make it easy to optimize your application for those with visual or physical disabilities. However, it’s not always obvious what the correct optimizations are, or the easiest way to leverage the framework toward this purpose. This lesson shows you how to implement the strategies and …

Dragging and Scaling in Android

This lesson describes how to use touch gestures to drag and scale on-screen objects, using onTouchEvent() to intercept touch events. Drag an Object If you are targeting Android 3.0 or higher, you can use the built-in drag-and-drop event listeners withView.OnDragListener, as described in Drag and Drop. A common operation for a touch gesture is to …

Handling Multi-Touch Gestures in Android

A multi-touch gesture is when multiple pointers (fingers) touch the screen at the same time. This lesson describes how to detect gestures that involve multiple pointers. Track Multiple Pointers When multiple pointers touch the screen at the same time, the system generates the following touch events: ACTION_DOWN—For the first pointer that touches the screen. This …

Animating a Scroll Gesture in Android

In Android, scrolling is typically achieved by using the ScrollView class. Any standard layout that might extend beyond the bounds of its container should be nested in aScrollView to provide a scrollable view that’s managed by the framework. Implementing a custom scroller should only be necessary for special scenarios. This lesson describes such a scenario: …