White Balance Ebook
An application can include raw files as resources. Raw files your application might use include audio files, video files, and any other file formats you might need. All raw resource files should be included in the res raw directory. There are no rules or restrictions for formatting raw files (aside from the resource filenames rules discussed earlier). If you plan to include media file resources, you should consult the Android platform documentation to determine what media formats and encodings are supported on your application's target handsets. The same goes for any other file format you want to include as an application resource. If the file format you plan on using is not supported by the native Android system, your application will be required to do all file processing internally. To access a raw file resource programmatically, simply use the openRawResource() method. For example, the following code would create an InputStream object to access to the resource file res raw...
However, it is worthwhile to consider some differences. Android supports all these resources through XML files, bitmap files for images, and raw files (examples of which could include audio and video). Within the set of XML files, you'll find two types one gets compiled into binary format, and the other gets copied as is. The examples you have seen so far the string-resource XML files and the layout-resource XML files get compiled into binary format before becoming part of the installable package. You can also place raw XML files in the res xml subdirectory to have them compiled into binary format. But if you place files, including XML files, in the res raw directory instead, they don't get compiled into binary format. You must use explicit stream-based APIs to read these files. raw Noncompiled raw files
White balance Beginning with Android 2.0, the settings panel includes other advanced camera options built-in flash support, customisable scene modes (action mode, night mode, and so on), white balance, colour effects and macro focus mode. Phones running Android 2.0 or higher also have an integrated digital zoom capability for magnifying an image to as much as four times its original size, although, unlike a zoom lens, this doesn't capture any extra detail.
Raw files and XML are also supported through resources. Using the res raw and res xml directories, respectively, you can package these file types with your application and access them through either Resources.openRawResource(int id) or Resources.getXml(int id). Going past simple values for strings, colors, and dimensions and more involved but still straightforward structures for styles, arrays, raw files, and raw XML, the next type of resources we need to explore are animations.
In addition to any new string, color, and dimension resources you use within the layout for the help screen, you also need to add a new type of resource a raw file resource file. In this instance, you include a text file called res raw quizhelp.txt that includes a number of paragraphs of help text, which you will display in the main TextView control of the help screen. You can also include large bodies of text as string resources. This can be helpful for internationalization. Using a string resource also allows you to take advantage of the built-in support for some HTML-style tags. In this case, we've used a text file to demonstrate the use of raw file resources.
get set WhiteBalance Takes or returns a WHITE_BALANCE_* static string constant to describe the white balance of the scene being photographed. get set FocusMode Takes or returns a focus_mode_* static string constant to specify how the camera autofocus should attempt to focus the camera.
Android allows arbitrary files in arbitrary subdirectories, starting at the assets subdirectory. These are not really resources, but raw files. This directory, unlike the res subdirectory, allows an arbitrary depth of subdirectories. These files do not generate any resource IDs. You have to use a relative path name starting at and excluding assets.
Android also allows raw files in addition to raw XML files. These raw resources, placed in res raw, are arbitrary file resources such as audio, video, or text files that require localization or references through resource IDs. Unlike the raw XML files placed in res xml, these files are not compiled but moved to the application package as is. However, each file will have an identifier generated in R.java. If you were to place a text file at res raw test.txt, you would be able to read that file using the code in Listing 3-19.
Content Providers represent files as fully qualified URIs rather than as raw file blobs. To insert a file into a Content Provider, or access a saved file, use the Content Resolvers openOutputStream or openInputStream methods respectively. The process for storing a file is shown in Listing 7-17.
Among the filters included, FishEye and Polandroid offer subtle artiness, making your picture appear to have been shot with an extreme wide-angle lens or a traditional instant film camera. Other effects are more radical. You've probably got a fair idea what's going to happen if you choose the AndyWarholizer option. We got mixed results with this Pop Art effect, but had lots of fun playing. Images with hard, distinct outlines worked well, while fuzzy edges were less successful. The Nexus One's 3.7in AMOLED display has drawn a lot of attention, and for good reason the display is superb. You need to get a look at it in real life to see how text and photos pop. When you take the phone outdoors, however, you lose much of the display's visibility. This limitation will especially disappoint casual photographers who'd like to snap away with the 5Mp camera.
Point-and-shoot cameras come with either fixed focus or autofocus. Fixed-focus cameras are optimized to take a photo with the same focus usually from a couple of feet to infinity. They use the same aperture opening and shutter speed for every single picture. That means anything too close will be out of focus. This is the type of focus you get with disposable cameras, because it's cheap and doesn't require any sort of adjustment on the user's end. Autofocus cameras change the focus by using software and hardware adjustments. The biggest difference you'll notice as a user is that you can focus on things very near the camera lens, such as bar codes. It also means you'll have more out-of-focus pictures, since the autofocus might not always work quite as well as you'd hoped, but the overall picture quality will be better. Very few Android cameras come without autofocus. The HTC Tattoo is one of the few fixed-focus phones sold in the United States.
Android cameras generally have autofocus, but don't expect this to be perfect focus. This isn't a substitute for a single-lens reflex (SLR) camera. That said, you can get surprisingly good pictures from Android phones. You just have to keep a few things in mind. Most cameras come with a delay you'd think was way too long in a dedicated point-and-shoot. Use this to your advantage. Pressing the virtual button on your phone makes it shake, so you have a second or so to steady your hand. Anticipate the delay and hold your phone steady.
On the Nexus One, there's no way to adjust focus by pressing on the desired focal point, as there is on the iPhone. You can only choose between letting Android do the focusing with autofocus, and setting the camera to infinity mode. You can use digital zoom on phones that support it by pressing on the screen until the + and - buttons appear or, in Android 2.2, by pressing the zoom slide adjuster at the lower-right corner of the screen, as shown in Figure 9-2.
Default Android settings give you a few options for editing videos, such as cropping or rotating the picture, and you can adjust the white balance for certain lighting conditions. But what if you want to add an effect after you've already taken the photo or edit out red eye Fear not, there are tons of apps that allow you to edit photos directly from your phone. Nothing offers the same quality you'd get from a desktop photo-editing program, but you're using this with a phone camera, not the latest SLR.
Android supports string, bitmap, and many other types of resource. The syntax and format of each, and where they're stored, depends upon the type of object. In general, though, you create resources from three types of files XML files (everything but bitmaps and raw), bitmap files(for images) and Raw files (anything else, for example sound files, etc.). In fact, there are two different types of XML file as well, those that get compiled as-is into the package, and those that are used to generate resources by aapt. Here is a list of each resource type, the format of the file, a description of the file, and details of any XML files.
Zipalign is an archive alignment tool that provides important optimization to Android application (.apk) files. The purpose is to ensure that all uncompressed data starts with a particular alignment relative to the start of the file. Specifically, it causes all uncompressed data within the .apk, such as images or raw files, to be aligned on 4-byte boundaries. This allows all portions to be accessed directly with mmap() even if they contain binary data with alignment restrictions. The benefit is a reduction in the amount of RAM consumed when running the application.
The difference between resources and assets isn't much on the surface, but in general, you'll use resources to store your external content much more often than you'll use assets. The real difference is that anything placed in the resources directory will be easily accessible from your application from the r class, which is compiled by Android. Whereas, anything placed in the assets directory will maintain its raw file format and, in order to read it, you must use the AssetManager to read the file as a stream of bytes. So keeping files and data in resources (res ) makes them easily accessible.
As you have seen, Android has a filesystem that is based on Linux and supports mode-based permissions. There are several ways you can access this filesystem. You can create and read files from within applications, you can access raw files that are included as resources, and you can work with specially compiled custom XML files. In this section we will take a tour of each approach. If you want to include raw files with your application of any form, you can do so using the res raw resources location. We discussed resources in general in chapter 3, but we did not drill down into raw files there, so we could group this data storage and access approach with others here. When you place a file in the res raw location, it is not compiled by the platform but is available as a raw resource, as shown in listing 5.6. Listing 5.6 Accessing a noncompiled raw file from res raw The significance with raw resources is that they are not precompiled by the platform, and they can refer to any type of raw...
Photography Masterclass Official Download Link
The legit version of Photography Masterclass is not distributed through other stores. An email with the special link to download the ebook will be sent to you if you ordered this version.