Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 2 MCQs Advanced Graphics

CSE227 — Advanced Android App Development 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Canvas Easy

    What is the primary purpose of the Canvas class in Android?

  2. Question 2 of 60 Canvas Easy

    Which class is used to specify the color, style, and font for drawing on a Canvas?

  3. Question 3 of 60 Canvas Easy

    Which Canvas method would you use to draw a circle?

  4. Question 4 of 60 Canvas Easy

    What is the purpose of the onDraw(Canvas canvas) method in a custom View?

  5. Question 5 of 60 Canvas Easy

    If you want to draw only the outline of a rectangle, which Paint.Style should you use?

  6. Question 6 of 60 Canvas Easy

    Which method is used to draw text on a Canvas?

  7. Question 7 of 60 Canvas Easy

    To draw a straight line between two points on a Canvas, which method is used?

  8. Question 8 of 60 Animations Easy

    What are the two main animation systems available in Android?

  9. Question 9 of 60 Animations Easy

    Which type of animation actually modifies the properties of the target object, allowing it to respond to clicks at its new location?

  10. Question 10 of 60 Animations Easy

    In which resource directory are XML files for View Animations (tween animations) typically stored?

  11. Question 11 of 60 Animations Easy

    What is the role of an Interpolator in Android animations?

  12. Question 12 of 60 Animations Easy

    Which class is the simplest way to animate a View's property, such as alpha or rotation, by name?

  13. Question 13 of 60 Animations Easy

    What is the primary function of the ValueAnimator class?

  14. Question 14 of 60 Animations Easy

    What does the <alpha> XML tag represent in a View Animation file?

  15. Question 15 of 60 Transitions Easy

    What is the main purpose of the Android Transition framework?

  16. Question 16 of 60 Transitions Easy

    In the Transition framework, what does a Scene represent?

  17. Question 17 of 60 Transitions Easy

    Which predefined Transition is specifically designed to animate the appearance and disappearance of views?

  18. Question 18 of 60 Transitions Easy

    Which method is called to begin the animation from the current layout to a new Scene?

  19. Question 19 of 60 Transitions Easy

    What is a "Shared Element Transition" primarily used for?

  20. Question 20 of 60 Transitions Easy

    Which transition class automatically animates changes to a view's position and size?

  21. Question 21 of 60 Canvas Medium

    In a custom View, you want to draw a circle, rotate the coordinate system by 45 degrees, and then draw a square centered at the same point as the circle. What will be the final visual outcome?

  22. Question 22 of 60 Canvas Medium

    You are implementing a custom drawing View. To apply a complex transformation (e.g., a rotation followed by a translation) and then revert to the original state for subsequent drawing operations, which pair of Canvas methods is most efficient?

  23. Question 23 of 60 Animations Medium

    What is the primary difference between a ValueAnimator and an ObjectAnimator?

  24. Question 24 of 60 Transitions Medium

    To create a shared element transition between two Activities, ActivityA and ActivityB, which XML attribute is essential for linking the shared views?

  25. Question 25 of 60 Canvas Medium

    Consider the following code in onDraw(Canvas canvas):
    java
    paint.setColor(Color.BLUE);
    canvas.translate(100, 100);
    canvas.drawRect(0, 0, 50, 50, paint);

    paint.setColor(Color.RED);
    canvas.scale(2, 2, 0, 0); // Scale around the current origin's (0,0) point
    canvas.drawRect(0, 0, 25, 25, paint);

    What is the final appearance on the screen?

  26. Question 26 of 60 Animations Medium

    You want to animate a custom view's property named cornerRadius using ObjectAnimator. The custom view class does not have a setCornerRadius(float radius) method. What will happen when you try to run the animation?

  27. Question 27 of 60 Transitions Medium

    What is the primary purpose of the TransitionManager.beginDelayedTransition(ViewGroup root) method?

  28. Question 28 of 60 Animations Medium

    You use a LinearInterpolator for an animation. How does this affect the animation's rate of change over time?

  29. Question 29 of 60 Canvas Medium

    What is the main performance-related reason to avoid object allocations inside the onDraw() method of a custom View?

  30. Question 30 of 60 Transitions Medium

    When creating a custom Transition, which two methods are the most critical to override to define the transition's behavior?

  31. Question 31 of 60 Animations Medium

    How does a Property Animation (e.g., ObjectAnimator) differ from a View Animation in terms of its effect on the animated View?

  32. Question 32 of 60 Canvas Medium

    You need to draw a shape that is the intersection of a circle and a rectangle. Which Canvas method would be most suitable for this task?

  33. Question 33 of 60 Animations Medium

    You want to run three animations simultaneously: fade in a TextView, scale up an ImageView, and move a Button. Which component is best suited for coordinating these animations?

  34. Question 34 of 60 Transitions Medium

    In the Material Design transition framework, what is the purpose of the Explode transition?

  35. Question 35 of 60 Canvas Medium

    To draw a quadratic Bézier curve on a Canvas, your Path object needs a starting point, an end point, and one other point. What is the role of this third point?

  36. Question 36 of 60 Animations Medium

    You want to animate a background color change from red to blue smoothly. Which class would you typically use with a ValueAnimator or ObjectAnimator to ensure correct color interpolation?

  37. Question 37 of 60 Transitions Medium

    You are using TransitionManager.beginDelayedTransition() to animate a layout change, but you want one specific ImageView to remain static. How can you achieve this?

  38. Question 38 of 60 Animations Medium

    What is the purpose of a Keyframe in a property animation?

  39. Question 39 of 60 Transitions Medium

    You are implementing a Fragment transaction and want the exiting fragment to slide to the left and the entering fragment to slide in from the right. Which method would you use on the FragmentTransaction to achieve this?

  40. Question 40 of 60 Canvas Medium

    You are drawing text on a Canvas and want it to be perfectly centered horizontally at a specific x-coordinate. Which Paint setting is crucial for this?

  41. Question 41 of 60 Canvas Hard

    You are implementing a custom View where you need to draw a shape and then apply a PorterDuff.Mode.XOR blend mode to a semi-transparent overlay. To ensure the blend mode only affects the specific shape and not the entire View background, which Canvas operation is most appropriate and why?

  42. Question 42 of 60 Canvas Hard

    Consider the following Matrix operations applied sequentially: matrix.setScale(2, 2); matrix.postTranslate(50, 0); matrix.preRotate(90);. If this matrix is applied to a point at (10, 20), what will be the final transformed coordinates? Remember the transformation formula is .

  43. Question 43 of 60 Animations Hard

    You are creating a custom Interpolator to model a bounce effect. The desired behavior is that the animation overshoots to 1.2, then settles back to 1.0. Which getInterpolation(float input) implementation would best produce this effect near the end of the animation?

  44. Question 44 of 60 Transitions Hard

    You are implementing a custom Transition to animate a TextView's color from a start color to an end color. In which lifecycle methods of the Transition class must you capture the color values, and which method is responsible for creating the Animator?

  45. Question 45 of 60 Animations Hard

    An AnimatorSet is configured as follows: Animator a, b, c, d; ... AnimatorSet set = new AnimatorSet(); set.play(a).with(b); set.play(c).after(a); set.play(d).after(b); What is the execution order of these animators?

  46. Question 46 of 60 Canvas Hard

    When drawing a complex Path with many curves and lines on a hardware-accelerated Canvas, which of the following operations is most likely to cause a significant performance drop or force a fallback to software rendering?

  47. Question 47 of 60 Transitions Hard

    In a shared element transition between a RecyclerView (Fragment A) and a detail view (Fragment B), you notice flickering or incorrect positioning. The item in the RecyclerView is temporarily replaced with the detail view before the transition ends. What is a likely cause and solution?

  48. Question 48 of 60 Animations Hard

    You need to animate a custom object property, Circle.centerPoint, which is a PointF. The property does not have a public setter setCenterPoint(PointF). Which combination of animator and helper class is the most efficient and avoids reflection?

  49. Question 49 of 60 MotionLayout Hard

    In a MotionLayout scene, you want a view to move along a circular arc path instead of a straight line between the start and end ConstraintSets. Which KeyFrameSet attribute is best suited for this?

  50. Question 50 of 60 Canvas Hard

    You use canvas.clipPath(myPath) to create a non-rectangular clipping region. Afterwards, you apply a rotation to the canvas with canvas.rotate(45). What is the result of subsequent drawing operations?

  51. Question 51 of 60 Animations Hard

    You are using a SpringAnimation to create a physics-based movement. You want the animation to be very bouncy and overshoot its final position significantly, oscillating multiple times before settling. Which combination of stiffness and dampingRatio should you use?

  52. Question 52 of 60 Transitions Hard

    What is the primary purpose of the TransitionValues object in the Android Transition Framework, and what is a common mistake when using its values Map?

  53. Question 53 of 60 Canvas Hard

    You're creating a ComposeShader to combine a BitmapShader (a texture) and a LinearGradient shader. If you use new ComposeShader(bitmapShader, linearGradient, PorterDuff.Mode.MULTIPLY), what will the visual outcome be?

  54. Question 54 of 60 Animations Hard

    When using ObjectAnimator to animate a custom view property, you notice jank and skipped frames. The animation is simple, animating a single float property. Profiling shows significant time spent in Method.invoke(). What is the most effective way to optimize this animation without rewriting it to use ValueAnimator?

  55. Question 55 of 60 Transitions Hard

    You are using TransitionManager.beginDelayedTransition with a ChangeBounds transition to animate a View's change in layout parameters. However, you want the View's children to move with their parent but not resize during the transition. How can you achieve this?

  56. Question 56 of 60 Canvas Hard

    In your onDraw, you have a loop that draws 1,000 small, overlapping, semi-transparent circles. The performance is poor. Which change would likely provide the biggest performance improvement when hardware acceleration is enabled?

  57. Question 57 of 60 Animations Hard

    You need to create a PathInterpolator that makes an animation start fast, slow down dramatically in the middle, and then speed up again at the end. How would you define the control points (x1, y1) and (x2, y2) for its underlying cubic Bezier curve?

  58. Question 58 of 60 Transitions Hard

    You are using MotionLayout and want to trigger an animation based on a custom event, not just user swipes or layout changes. For example, you want to transition to the 'end' state when a network request completes. How would you programmatically trigger this transition?

  59. Question 59 of 60 Canvas Hard

    You are drawing text on a Canvas. You need to ensure the exact vertical center of the text (from the top of the ascender to the bottom of the descender) is aligned with a specific y-coordinate, cy. Given a Paint object, how do you calculate the correct y value for the canvas.drawText call?

  60. Question 60 of 60 Animations Hard

    You create a ValueAnimator that animates from 0 to 1 over 10 seconds. You set its repeat mode to REVERSE and repeat count to INFINITE. After 25 seconds, you call animator.getAnimatedValue(). Assuming a linear interpolator, what will the returned value be?

That's unit 2

Answer a few questions and your score shows up here.