-
Notifications
You must be signed in to change notification settings - Fork 24
Android_Project Structure
Let's go over the Android project structure, we'll start with how the Android Studio is setting up the project structure to give us a clean overview of the important files within our projects.
As already mentioned, Android Studio will set the Android Project View as the default view when you initially create a project. This view shows a flattened version of your project's structure that provides quick access to the key source files of Android projects and helps you work with the new Gradle-based build system. The Android project view:
- Groups the build files for all modules at the top level of the project hierarchy.
- Shows the most important source directories at the top level of the module hierarchy.
- Groups all the manifest files for each module.
- Shows resource files from all Gradle source sets.
- Groups resource files for different locales, orientations, and screen types in a single group per resource type.
If the Android Project View is not enabled by default in your Android Studio, you can enable it by clicking Project and selecting Android, as shown in the image below.
The Android project view shows all the build files at the top level of the project hierarchy under Gradle Scripts. Each project module appears as a folder at the top level of the project hierarchy and contains these three elements at the top level:
-
java/
- Source files for the module. -
manifests/
- Manifest files for the module. -
res/
- Resource files for the module.
Below you can see the difference in normal Project View (left), and the Android Project View (right). Note that Android Project View doesn't represent the structure of the project on disk itself.
App components are the essential building blocks of an Android app. Each component is a different point through which the system can enter your app. Not all components are actual entry points for the user and some depend on each other, but each one exists as its own entity and plays a specific role—each one is a unique building block that helps define your app's overall behavior.
There are four different types of app components. Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed.
Here are the four types of app components:
- Activities - An activity represents a single screen with a user interface. The activities work together to form a cohesive user experience in an app, however each one is independent of the others. As such, a different app can start any one of these activities, if your app allows it.
- Services - A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface.
- Content Providers - A content provider manages a shared set of app data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your app can access. Through the content provider, other apps can query or even modify the data, if the content provider allows it. Content providers are also useful for reading and writing data that is private to your app and not shared.
- Broadcast Receivers - A broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the system — for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Apps can also initiate broadcasts. Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs.
A unique aspect of the Android system design is that any app can start another app’s component.
http://developer.android.com/guide/components/fundamentals.html#Manifest
http://developer.android.com/guide/components/fundamentals.html#Resources
http://developer.android.com/tools/building/configuring-gradle.html
- Android
- Getting Started
- Project Structure
- Gradle
- Menu
- Theming
- Login Screen
- Menu & Navigation
- Importing Library From GitHub
- Creating Reusable Layouts
- Adding New Icons
- Profile Screen
- Chat Screen
- Contacts Screen
- Pending Invites Screen
- Settings Screen
- Add Library Dependency
- Discover Users Screen
- Splash Screen
- Auth0
- Authentication Logic
- Profile Screen Logic
- Send Feedback
- Authenticated to Firebase via Auth0
- Saving User Info to Firebase
- Storing User Connection Info to Firebase
- Calculating Distance Between Users
- Chat Logic
- Handling Device Rotation
- Android Other
- Ionic
- Getting Started
- Project Structure
- Menu
- Theming
- Login Screen
- Adding Images
- Creating Reusable Layouts
- Adding New Icons
- Profile Screen
- Contact Screen
- Elastic Textarea
- Chat Bubble
- Chat Screen
- Contacts Screen
- Pending Invites Screen
- Settings Screen
- Discover Users Screen
- Splash Screen
- Animations
- Auth0
- Storing User Data
- Profile Screen Logic
- Send Feedback
- Update to Ionic RC0
- Reimplemented Auth0 with Ionic RC0
- Authenticated to Firebase via Auth0
- Saving User Info to Firebase
- Storing User Connection Info to Firebase
- Calculating Distance Between Users
- Chat Logic
- Handling Device Rotation
- Ionic Other
- Version Updating
- Cordova
- Other
- Messaging