Android Application Development

Here you have the best Android ATC AND-401 practice exam questions

  • You have 109 total questions to study from
  • Each page has 5 questions, making a total of 22 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on November 21, 2024
Question 1 of 109

What Activity method you use to retrieve a reference to an Android view by using the id attribute of a resource XML?

    Correct Answer: B

    The findViewById(int id) method is the correct method to retrieve a reference to a view using the id attribute in an Android resource XML. This method looks for a view with the specified ID and returns it if found. The method signature takes an integer as its parameter, which represents the id attribute of the view.

Question 2 of 109

Which of the following is not an Android component (i.e. a point from which the system can enter your application)?

    Correct Answer: C

    The four main types of Android components are Activities, Services, Content Providers, and Broadcast Receivers. These components are crucial entry points for the system and applications to interact with each other. A Layout, on the other hand, is not an entry point; it is a resource defining the UI structure of an interface. Therefore, Layout is not considered an Android component through which the system can enter your application.

Question 3 of 109

During an Activity life-cycle, what is the first callback method invoked by the system?

    Correct Answer: C

    The first callback method invoked by the system during an Activity's lifecycle is onCreate(). This is where the activity is first created. In this method, the activity does all the initialization needed, such as setting up the user interface and setting up any necessary data structures.

Question 4 of 109

Which configuration file holds the permission to use the internet?

    Correct Answer: D

    The configuration file that holds the permission to use the internet is the Manifest file. In Android development, the AndroidManifest.xml file is used to declare permissions like INTERNET, which are necessary for the app to access the internet. Layout files, property files, and Java source files do not serve the function of declaring application permissions.

Question 5 of 109

What does the following line of code achieve?

Intent intent = new Intent(FirstActivity.this, SecondActivity.class );

    Correct Answer: C

    The line of code in question 'Intent intent = new Intent(FirstActivity.this, SecondActivity.class);' creates an explicit intent. An explicit intent specifies the exact component inside the app that should be launched. In this case, it indicates that the activity 'SecondActivity' should be launched from 'FirstActivity'. Options C and D are indeed identical, so either would be correct.