70 likes | 187 Views
CSS290 : Apps on Mobile Devices. Lecture 4: Tasks + Working with Images. Today: Concepts. Reading: Chapter 4 (Skip XNA Discussions)) Focus of TextBox Get/Lose Focus Images as resource in project Enter image as a stream from URI Images in projects vs. images in the environment
E N D
CSS290: Apps on Mobile Devices Lecture 4: Tasks + Working with Images
Today: Concepts • Reading: Chapter 4 (Skip XNA Discussions)) • Focus of TextBox • Get/Lose Focus • Images as resource in project • Enter image as a stream from URI • Images in projects vs. images in the environment • Camera and PhotoChooser Tasks • For fun: • Working with Phone Vibrate • Working with images and camera on the phone
TextBox Focus Events • TextChangeEvent • Invoked once per character input • In focus: • What should the behavior be? • Start editing: what is your expectation? (selected text?) • Out of focus: • Have the final input
System Resources • Images of a project vs. Photos on the phone • What is the difference? • How to load either? • The Image GUI element • Capable of displaying an image • The BitmapImage utility • Source from project environment (URI) • URI – Uniform Resource Identifier (a name) • Source from online (if you have wifi, or 3G connection) • Relative vs. Absolute URI
Tasks: Threads?! • Activating a “Task” from our App • The Camera Task and PhotoChooserTask • Function calls that may fail! • Try/Catch
Exercise • Add touch volume control to our simple audio playback App • Due beginning of next class
References • More on Tasks (with return value) and Launchers (start an App): • http://msdn.microsoft.com/en-us/library/ff428753%28v=VS.92%29.aspx