ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Mobile Application Development 1
    COMP4124
    Progress0 / 33 topics
    Topics
    1. Mobiles Application Development Platform2. HTML5 for Mobiles3. Android OS: Architecture, Framework and Application Development4. iOS: Architecture, Framework5. Application Development with Windows Mobile6. Eclipse7. Fragments8. Calling Built-in Applications using Intents9. Displaying Notifications10. Components of a Screen11. Adapting to Display Orientation12. Managing Changes to Screen Orientation13. Utilizing the Action Bar14. Creating the User Interface15. Listening for UI Notifications16. Views17. User Preferences18. Persisting & Sharing Data19. Sending SMS Messages20. Getting Feedback21. Sending E-mail22. Displaying Maps23. Consuming Web Services Using HTTP24. Web Services: Accessing and Creating25. Threading26. Publishing Android Applications27. Deployment on App Stores28. Mobile Programming Languages29. Challenges with Mobility and Wireless Communication30. Location-aware Applications31. Performance/Power Tradeoffs32. Mobile Platform Constraints33. Emerging Technologies
    COMP4124›Android OS: Architecture, Framework and Application Development
    Mobile Application Development 1Topic 3 of 33

    Android OS: Architecture, Framework and Application Development

    7 minread
    1,125words
    Intermediatelevel

    Android OS: Architecture, Framework, and Application Development

    Android is an open-source mobile operating system developed by Google, primarily used for smartphones and tablets. It is based on the Linux kernel and offers a rich application framework that allows developers to create innovative applications. Understanding Android's architecture, framework, and the process of application development is crucial for anyone interested in building Android apps.


    1. Android OS Architecture

    Android’s architecture is organized into multiple layers, each with its own function. The structure ensures that the system is modular and flexible, allowing for seamless development and operation of apps.

    The Android architecture is commonly represented in the following layers:

    A. Linux Kernel

    • The Linux Kernel is the base layer of the Android OS. It is responsible for managing low-level hardware operations, including memory management, process management, security, and device drivers. While Android itself is not based on the traditional Linux desktop system, it relies on the Linux kernel for core services like networking, audio, and power management.

    B. Hardware Abstraction Layer (HAL)

    • The HAL provides a standard interface to interact with the hardware. It acts as a bridge between the device hardware and the upper layers of the Android OS.
    • HAL allows Android to work on a wide range of devices and hardware configurations without changing the OS core. For example, it helps Android communicate with sensors, cameras, GPS, etc.

    C. Android Runtime (ART)

    • The Android Runtime (ART) is the environment where Android apps run. ART replaces the older Dalvik runtime in newer versions of Android (starting from Android 5.0 Lollipop).
    • ART compiles the bytecode of Android apps into native machine code for better performance and memory efficiency. It uses an ahead-of-time (AOT) compilation process to optimize app execution.
    • ART also manages app memory and provides garbage collection to free up unused memory.

    D. Libraries

    • The Libraries layer includes a collection of C/C++ libraries that are used to perform key tasks such as graphics rendering, media playback, database management, and web browsing. Some important libraries include:
      • WebKit for web browsing.
      • SQLite for database storage.
      • OpenGL ES for graphics rendering.
      • Surface Manager for managing display buffers.

    E. Application Framework

    • The Application Framework provides higher-level services that help developers create Android apps. It is made up of several essential components:
      • Activity Manager: Manages app lifecycle and activities.
      • Window Manager: Handles UI screen windows and interactions.
      • Content Providers: Facilitate data sharing between applications.
      • Resource Manager: Manages various resources like strings, colors, and images.
      • Location Manager: Provides location-based services using GPS or network.
      • Notification Manager: Handles app notifications.

    F. Applications

    • The Applications layer is where user-facing apps and system apps reside, such as the home screen, dialer, camera app, messaging, and all third-party apps that users install from the Google Play Store.

    2. Android Framework

    The Android Framework is a set of APIs (Application Programming Interfaces) that allow developers to interact with the Android system's underlying services. It provides tools for creating user interfaces, managing data, handling events, and communicating with the hardware.

    Key Components of the Android Framework:

    1. Activities and Services:

      • Activity: An activity is a single screen with a user interface. It represents a task or action in an app (like a photo gallery or a settings screen).
      • Service: A service runs in the background and performs long-running operations (like playing music or downloading files) without interacting with the user interface.
    2. Content Providers:

      • Content providers allow apps to share data with other apps in a secure and standardized manner. For example, a photo-sharing app can provide access to images for other apps using a content provider.
    3. Broadcast Receivers:

      • Broadcast receivers listen for system-wide broadcast messages (like Wi-Fi state changes, incoming SMS, or app updates). They allow apps to respond to specific system events or user actions.
    4. Intents:

      • Intents are messages used to request actions from other components, such as starting an activity or sending data to another app. Intents help Android apps communicate with each other.
    5. Views and ViewGroups:

      • Views are UI components like buttons, text fields, and images that users interact with.
      • ViewGroups are containers that organize and arrange views in a layout. Examples include LinearLayout and RelativeLayout.
    6. Resources:

      • Android apps use resources like strings, images, colors, and layout files. These resources are stored separately from the application code to make it easier to support different screen sizes, orientations, and languages.

    3. Android Application Development

    Developing Android applications involves a series of steps, from setting up the development environment to building, testing, and publishing the app.

    A. Setting Up the Development Environment

    • Android Studio: The official IDE (Integrated Development Environment) for Android development. It provides tools for writing code, designing UI, debugging, and testing apps.
    • Java/Kotlin: Android development can be done using Java (traditionally) or Kotlin (the newer, preferred language). Kotlin is more concise and modern compared to Java, offering better performance and easier syntax.

    B. Building the User Interface

    • Android applications use XML (Extensible Markup Language) to define the layout of the UI.
    • Layouts are defined in XML files, which include elements like TextView, Button, ImageView, and other UI components.
    • Developers use a Graphical Layout Editor in Android Studio to visually design the UI or manually code it in XML.

    C. Writing Application Logic

    • Activities define the screen flow of the app. Each screen in an app is represented by an activity.
    • Event Handling: Android apps handle user interactions (like clicks or gestures) through event listeners and callbacks, such as onClick() for buttons or onTouch() for touch events.

    D. Managing Data

    • Android provides several ways to manage and store data:
      • SQLite: A lightweight relational database for storing app data locally.
      • SharedPreferences: A simple key-value store for saving small amounts of data like user preferences.
      • Content Providers: For sharing data between different apps.
      • Files: You can also use files to store data locally.

    E. Debugging and Testing

    • Android Studio includes built-in debugging tools for testing app behavior, inspecting the UI, and analyzing performance.
    • Unit tests and UI tests can be written to verify app functionality and ensure everything works as expected.

    F. Publishing the App

    • After building the app, developers can package it into an APK (Android Package) file.
    • The APK can then be published on the Google Play Store or distributed directly to users.

    Conclusion

    Android’s architecture is designed to be flexible, allowing developers to create powerful and efficient applications. Understanding its layers—from the Linux kernel to the application framework—is crucial for building high-quality apps. The Android framework provides developers with everything they need to design user interfaces, manage data, handle events, and interact with hardware. With the proper tools and knowledge, developers can create Android applications that work across different devices, offering users a rich and engaging experience.

    Previous topic 2
    HTML5 for Mobiles
    Next topic 4
    iOS: Architecture, Framework

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time7 min
      Word count1,125
      Code examples0
      DifficultyIntermediate