concept access in category android

This is an excerpt from Manning's book Android in Action, Third Edition.
Qualcomm’s BREW environment—BREW stands for Binary Runtime Environment for Wireless. For a high-volume example of BREW technology, consider Verizon’s Get It Now-capable devices, which run on this platform. The challenge for software developers who want to gain access to this market is that the bar to get an application on this platform is high, because everything is managed by the mobile operator, with expensive testing and revenue-sharing fee structures. The upside to this platform is that the mobile operator collects the money and disburses it to the developer after the sale, and often these sales recur monthly. Just about everything else is a challenge to the software developer. Android’s open application environment is more accessible than BREW.
The majority of the material presented in this book is concerned with employing various capabilities of the Android SDK. At this point, however, you’re going to see how to take advantage of an Android device’s hardware. Specifically, we’ll look at connecting an Android device to remote devices via a Bluetooth wireless connection, as well as reading and interpreting values from a hardware-based orientation sensor. This chapter combines these two hardware-related topics in a sample program that exercises control over a robot constructed from the popular LEGO Mindstorms NXT. The Mindstorms NXT robot supports a communications protocol known as Direct Commands,[1] allowing it to be controlled by a remote device. This is the one chapter of the book where you’ll want to have access to a physical Android device with version 2 or later of the operating system—the simulator alone isn’t adequate for exercising the Bluetooth and sensor functionality.

This is an excerpt from Manning's book Android in Practice.
Supporting applications, the Android platform includes a framework to run them in. The application framework provides a tightly integrated part of the platform SDK and APIs that allow for high-level interaction with the system from within applications. When your application needs access to hardware sensors, network data, the state of interface elements, or many other things, it gets to that information through the application framework. We’ll learn more about the SDK and the application framework in section 1.6.
AssetManager provides access to multimedia resources that are part of your application. Its API leverages Java I/O APIs. You can get a handle on the ResourceManager easily from any Context object
. Then you can use it to access an individual file or a directory. In listing 11.3, we use it to get a listing of all of the files in the audio directory
. Now we can iterate over those files without having to know the names of each file at compile time. For each file, we can get a java.io.FileDescriptor
that can be used as a source for the MediaPlayer
, instead of using a resource identifier as we saw in listing 11.2. Now you might be wondering exactly what files will be loaded by the code in the listing 11.3. Figure 11.3 shows this structure.
You want to allow a user to use your application to take a picture using one of the cameras on their Android device. You then want to access this picture to use it as part of your application. You want to let the user take full advantage of their device’s capabilities. This may include access to a front-facing camera (if the device has one), or special photo-taking features such as panoramic photo capturing, flash photography, and so on.
. Then you can use it to access an individual file or a directory. In
. Now we can iterate over those files without having to know the names of each file at compile time. For each file, we can get a java.io.FileDescriptor
that can be used as a source for the MediaPlayer
, instead of using a resource identifier as we saw in