Book Image

Android Development Tools for Eclipse

By : Khirulnizam Abd Rahman, Sanjay Shah
Book Image

Android Development Tools for Eclipse

By: Khirulnizam Abd Rahman, Sanjay Shah

Overview of this book

<p>The increase in Android's popularity with every passing day cannot be understated. This has resulted in a large programmer base willing to contribute to its success. Eclipse has a powerful IDE and has been adopted widely by programmers across the globe. The focus of ADT is to use existing familiar territory and ease development of Android applications. In this sense, ADT provides a one stop solution for Android application development.</p><p>Android Development Tools for Eclipse is a step-by-step guide that provides you with hands-on, practical, and to the point discussion and steps for using Eclipse tools for developing, debugging, and signing Android applications for distribution. It also teaches you to incorporate advertisements to monetize your applications. Every concept and its usage has been demonstrated in this book by implementing them via real world applications.</p><p></p><p>Android Development Tools for Eclipse starts with the installation of ADT, and then discusses important tools before guiding you through Android application development from scratch, demonstrating different concepts and implementation before finally helping you distribute your applications in the Android market. You will start the development of your first application, explore project structure, and add different widgets including multimedia ones.</p><p></p><p>You will learn everything about developing, debugging, testing, distributing, and monetizing your Android application using Eclipse ADT.</p>
Table of Contents (10 chapters)
9
Index

Using wrap_content and match_parent

In order to cater to the need of a variety of android devices available in the market, the application needs to be compatible to different screen sizes. For example, a layout should adapt to different screen sizes, and the corresponding views should also resize accordingly. To ensure that we make use of wrap_content and match_parent for width and height of view components refer to the following:

  • wrap_content: It ensures that the width and height of the view is set to the minimum size required to fit the content
  • match_parent: Before API level 8, it was known as fill_parent and it ensures the component expands to match the size of its parent view

Therefore, use of these attributes affirms our views to use the space required and expands to fill the available space. We have made use of these in the DistanceConverter application for components in layout file. Following is a small code snippet from activity_main.xml, our previous application to demonstrate its...