Master Android from first principles and begin the journey toward your own successful Android applications!
Dear Reader,
First, welcome to the world of Android! We’re entering a new era of mobile application development, one marked by open platforms and open source, to take ‘walled gardens’ and make them green houses for any and all to participate in. Android is relatively easy for developers, and I believe that this innovation will help generate a large ecosystem of developers and consumers within a very short time. This means that budding developers such as yourself will have many opportunities to design and build your own applications and you’ll have a huge and hungry customer base.
Second, welcome to the book! Its purpose is to start you on your way with building Android applications, and to help you master the learning curve. Android is already a rich framework, comparable in many ways to the richness Android of desktop Java environments. This means that there is a lot of cool stuff for you to pick up along your journey in order to create the slickest, most useful apps Android you can imagine.
The source code for the code samples in this book is all available from the Apress site, so you can stay as hands-on and practical as you like while I introduce you to the core of Android, and invite you to experiment with the various classes and APIs we’ll be looking at. By the time you’ve finished this book, you’ll be creating your own Android applications and asking yourself what your next great application will be…!
Enjoy!
Mark Murphy
Hunting Season
Hunting Season
There are two types of search in Android: local and global. Local search searches within the current application; global search searches the Web via Google’s search engine. You can initiate either type of search in a variety of ways, including the following:
• You can call onSearchRequested()
from a button or menu choice, which will initiate a local search (unless you override this method in your activity).
• You can directly call startSearch()
to initiate a local or global search, including optionally supplying a search string to use as a starting point.
• You can elect to have keyboard entry kick off a search via setDefaultKeyMode()
, for either local search (setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL)
) or global search (setDefaultKeyMode(DEFAULT_KEYS_SEARCH_GLOBAL)
).
In either case, the search appears as a set of UI components across the top of the screen, with your activity blurred underneath it (see Figures 36-1 and 36-2).
Figure 36-1. The Android local search pop-up
Figure 36-2. The Android global search pop-up, showing a drop-down with previous searches