Unit2 - Subjective Questions

CSE227 • Practice Questions with Detailed Answers

1

Explain the fundamental role of the Canvas object in Android's custom drawing framework. How does it interact with a Bitmap to render graphics on the screen?

2

Describe the purpose of the Paint object in Android's Canvas drawing. Elaborate on at least three key properties of Paint that significantly affect the appearance of drawn graphics.

3

Explain the role of the onDraw() method in a custom View and the steps involved in requesting a redraw. What is the significance of calling super.onDraw(canvas)?

4

Describe the four primary types of transformations that can be applied to a Canvas and explain how each affects subsequent drawing operations. Provide a practical example where a combination of two transformations would be useful.

5

Explain the importance and usage of canvas.save() and canvas.restore() methods when performing complex drawing operations involving transformations or clipping.

6

Compare and contrast Android's View Animation (Tween Animation) with Property Animation. Discuss their core differences, advantages, and disadvantages, and provide scenarios where one might be preferred over the other.

7

Differentiate between ValueAnimator and ObjectAnimator in Android's Property Animation framework. When would you choose one over the other?

8

Explain the role of an Interpolator in Android animations. Describe how AccelerateInterpolator and BounceInterpolator differ in their effect on an animation's progress.

9

What is the purpose of AnimatorSet in Android's Property Animation framework? Describe how it can be used to coordinate multiple animations sequentially and simultaneously.

10

Explain what Drawable Animation is and when it is typically used in Android development. Provide a brief example of how it is configured.

11

Describe the core concept and components of the Android Transitions Framework (introduced in API 19). Explain how Scene and TransitionManager work together to animate changes in a UI layout.

12

Describe the functionality of the ChangeBounds transition. Provide a scenario where it would be particularly useful in animating layout changes.

13

Explain the concept of Shared Element Transitions between Activities or Fragments. Outline the key steps required to implement a basic shared element transition for an ImageView between two Activities.

14

Briefly explain when and why you might consider creating a custom Transition in the Android Transitions Framework instead of relying on the built-in transitions.

15

Discuss the concept of hardware acceleration in Android's drawing pipeline, specifically how it affects Canvas operations. What are some considerations or potential issues when hardware acceleration is enabled for custom drawing?

16

Outline the basic steps involved in creating a custom View in Android that performs its own drawing using the Canvas.

17

Explain the utility of the Path object in Android's Canvas drawing. How can you combine lines, arcs, and curves to create complex shapes using a Path?

18

Discuss the advantages and disadvantages of defining animations in XML (res/anim/ or res/animator/) versus programmatically in Java/Kotlin code. When would you prefer one approach over the other?

19

Identify and explain at least three key performance considerations or best practices when implementing animations in Android to ensure a smooth user experience.

20

Explain the purpose of the PathMeasure class in Android graphics. Describe a scenario where PathMeasure would be particularly useful for creating dynamic visual effects.