14.01.2013 Views

Android™ Application Development - Bahar Ali Khan

Android™ Application Development - Bahar Ali Khan

Android™ Application Development - Bahar Ali Khan

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11: Advanced Android <strong>Development</strong><br />

398<br />

}<br />

float vertical = _event.getY();<br />

float horizontal = _event.getX();<br />

// TODO: Process trackball movement.<br />

return false;<br />

Summary<br />

This fi nal chapter has served as a catch-all for some of the more complex Android features that were<br />

glossed over in earlier chapters.<br />

You learned more about Android’s security mechanisms, in particular, examining the permissions<br />

mechanism used to control access to Content Providers, Services, Activities, Intent Receivers, and<br />

broadcast Intents.<br />

You explored the possibilities of interprocess communication using the Android Interface Defi nition<br />

Language to create rich interfaces between application components.<br />

Much of the last part of the chapter focused on the Canvas class, as some of the more complex features<br />

available in the 2D drawing library were exposed. This included an examination of the drawing primitives<br />

available and a closer look at the possibilities of the Paint class.<br />

You learned to use transparency and create gradient Shaders before looking at Mask Filters, Color Filters,<br />

and Path Effects. You also learned how to use hardware acceleration on 2D canvas-based Views, as well<br />

as some Canvas drawing best-practice techniques.<br />

You were then introduced to the SurfaceView — a graphical control that lets you render graphics onto<br />

a surface from a background thread. This led to an introduction of rendering 3D graphics using the<br />

OpenGL ES framework and using the Surface View to provide live camera previews.<br />

Finally, you learned the details for providing interactivity within your Activities and View by listening<br />

for and interpreting touch screen, track ball, and key press events.<br />

In particular, you learned:<br />

❑ Some of the possibilities of using the Internet as a data source, or processing middle tier, to keep<br />

your applications lightweight and information-rich.<br />

❑ How to animate Views and ViewGroups using tweened animations.<br />

❑ How to create frame-by-frame animations.<br />

❑ Which drawing primitives you can use to draw on a canvas.<br />

❑ How to get the most out of the Paint object using translucency, Shaders, Mask Filters, Color<br />

Filters, and Path Effects.<br />

❑ Some of the best-practice techniques for drawing on the canvas.<br />

❑<br />

That you can apply hardware acceleration to 2D graphics drawing.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!