pt1 Flashcards
What is the purpose of the ‘src’ folder in an Android project structure?
Contains your stub Activity file and all other source code files
The stub Activity file is stored at src/your/package/ActivityName.java.
What types of files are stored in the ‘res’ folder?
Application resources, such as:
* Drawable files
* Layout files
* String values
* Animation files
What is the function of the ‘mipmap’ folder?
Allows inclusion of different versions of the app’s launcher icon optimized for each screen density.
What does the ‘assets’ folder contain?
Arbitrary raw asset files.
What is the difference between the ‘assets’ directory and the ‘asset’ folder?
Access method differs.
What do the ‘menu’ folder XML files define?
Application menus.
What is the purpose of the ‘AndroidManifest.xml’ file?
Describes the nature of the application and each of its components.
What are the two ‘build.gradle’ files used for?
Level project config and Level module config.
What does ProGuard do?
Optimizes and obfuscates your code.
What is the first step to build an Android application?
Start Android Studio.
What is a common good practice when naming the main activity?
Name it ‘MainActivity’.
What is the purpose of the ‘Activity’ component in Android?
Focuses on a single thing a user can do with a visual user interface.
True or False: Services in Android have a visual interface.
False.
What are Broadcast Receivers used for?
Receive and react to broadcast announcements.
What class do you extend to create a Broadcast Receiver?
BroadcastReceiver.
What is the role of Content Providers in Android?
Allow data exchange between applications.
What class do you extend to create a Content Provider?
ContentProvider.
Fill in the blank: Activities are the ______ component of most applications.
basic
What method is used to make a View or ViewGroup visible in an Activity?
Activity.setContentView()
What can you do with existing services in Android?
Bind to them and control their operation.
What are examples of broadcasts that a Broadcast Receiver might handle?
Low battery, power connected, shutdown, time zone changed.
What is the only way to transfer data between applications in Android?
Using Content Providers.
What object do other applications use to access data from a Content Provider?
ContentResolver.
What is an Activity in Android?
An application component that represents one window and one hierarchy of views.