Ebook Android user interface development: Part 2

(BQ) Part 2 book "Android user interface development" has contents: Animating widgets and layouts, designing content centric activities, styling android applications, building an application theme. | 6 Validating and Handling Input Data Unfortunately, the validation and handling of input in an application is often an afterthought in the design process. These should be at the forefront of your thoughts during the second round of drafts for the user interface. A touchscreen device offers many more opportunities to streamline the capturing of data from the user, in many cases removing the need for sanitation or validation, while at the same time massively improving the user's experience with the application. Android provides an excellent toolset to capture many different types of data from the user, while also providing loose coupling between your application components in the form of Intent structures. By using several smaller Activity classes to capture data, while at the same time abstracting the functionality to capture different types of input, you'll be able to more easily reuse the input capturing Activity classes, not just within the application, but in other applications as well. Further, by registering the Activity correctly, you'll allow other applications to override, or make use of your Activity implementation, allowing the users to select their preferred capturing mechanism. Dealing with undesirable input Often applications require specific types of input from their users. An application captures input from its user in order for the user to tell it something about the world. This could be anything, from what the user is looking for (that is, a search term), to something about the users themselves (that is, their age). In most of these cases, the users can be guided in the way they give the input using mechanisms, such as an auto-completion box. However, if a user can give you "undesirable" input, then somewhere along the line one of them will. Validating and Handling Input Data Undesirable input can be anything ranging from text where a number is expected, through to a search term that yields no results. In both cases, you need to do three .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
92    195    3    05-05-2024
34    412    6    05-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.