• Breaking News

    [Android][timeline][#f39c12]

    Tuesday, September 1, 2020

    The internals of Android Stack Architecture - Article Android Dev

    The internals of Android Stack Architecture - Article Android Dev


    The internals of Android Stack Architecture - Article

    Posted: 01 Sep 2020 07:21 AM PDT

    The internals of Android Stack Architecture - Article

    Table of Contents

    • Early Days of Android
    • Android Stack
    • Linux Kernel
    • Secure Element
    • Hardware abstraction layer
    • Native Libraries
    • Runtime
    • Framework
    • Apps
    • References

    Understanding the internals of Android Stack Architecture and how it relates to Linux blog post aims to be the starting point for developers to get familiar and have an overview of core components in the Android Stack Architecture.

    Early Days of Android

    Founded in 2003, Android Inc, in the early days began as an operating system for Digital Cameras. Due to the low market for Digital Cameras, the Android Inc teams' intentions slowly diverted to Mobile Devices. Becoming the rivals of then Symbian and Windows Mobile.

    Acquired by Google in 2005, the development team worked on an Operating System based on Linux Kernel in shadows until the unveil of Open Handset Alliance in 2007.

    https://preview.redd.it/wjoa0sysojk51.png?width=1280&format=png&auto=webp&s=fd78d0546420b115f5f32acad6c093bfc4688f81

    Android Stack

    By Google, Android is described officially as an open-source,Linux-based software stack created for a wide array of devices and form factors.

    The graphical user interface environment, middlewares, libraries, APIs... sitting on top of Linux Kernel and shell binaries are Software Stack Layers that make the bulk of Android and which makes it much more than a variation of the Linux system.

    https://preview.redd.it/jcmf41nuojk51.png?width=1280&format=png&auto=webp&s=3cf4d97d8a32277f6ec8faf1634a3ec6e9e87b98

    Linux Kernel

    Android's Kernel is based on the Long Term Support (LTS) branches of the Linux Kernel.

    The kernel provides drivers for filesystem access, process management, hardware, networking.

    The Android Kernel differs from vanilla Linux Kernel due to the differences called as Androidisms

    Some of the notable Androidisms added to Kernel are IPC Binder, Wavelocks, Low-Memory Killer, Dalvik, and Android Runtime, Anonymous Shared Memory (ashmem), Alarm, paranoid network, RAM console, Physical memory (pmem), Sync driver, Timed Output, and GPIO, memory and logging enhancements.

    Android utilizes many unused/less-popular features in desktop distributions of Linux such as control groups, Low Memory Killer Daemon, Security-Enhanced Linux (SELinux), and open source projects like a racoon for VPN, mdns for network service discovery, and many more.

    https://preview.redd.it/j2cq9uhxojk51.png?width=1280&format=png&auto=webp&s=ec4bc88f683efe190610532db27e9b3e83f781e3

    Secure Element

    To provide better security, some devices have an embedded Secure Element (SE), which is dedicated, separate tamper-resistant hardware to store cryptographic data.

    Hardware abstraction layer

    Android runs on TV, Mobile, Refrigerator and almost everywhere that the underlying hardware may greatly differ in its' scope and support.

    To solve this the Android stack typically relies on shared libraries provided by manufacturers to interact with hardware.

    Android relies on what can be considered a Hardware Abstraction Layer (HAL), although the interface, behavior, and function of abstracted hardware components differ greatly from type to type.

    The idea of GPS, sensor, TV, camera, audio, input media components and other components behavior is defined by HAL and how it should behave in Android.

    The vendors are still not allowed to make unnecessary modifications so as to not fail the Compatibility Test Suite, Vendor Test Suite.

    https://preview.redd.it/3xx6e0z0pjk51.png?width=1280&format=png&auto=webp&s=a190299b4aba07053e67fd2df69e66222582b4ea

    Native Libraries

    The native libraries layer is responsible for providing support for the core features.

    The WebKit Web rendering engine, Audio Manager, LIBC, Secure Sockets Layer (SSL), FreeType for rendering fonts, Media, OpenGL ES graphics API, SQLite database, Surface Manager.

    https://preview.redd.it/hmiokov4pjk51.png?width=1280&format=png&auto=webp&s=e40d6a952df4d26ed3e9e2951dd3ed98d4c9c652

    Runtime

    Before Android 4.4, each Android app would run on its own virtual machine, which is called "Dalvik" which got superseded by the Android RunTime (ART).In Android 4.4, along with Dalvik, Google experimentally introduced a new Android Runtime called "ART" which still today remains the standard.

    ART introduces ahead-of-time (AOT) compilation, which can improve app performance.

    App runs and launches faster on ART than Dalvik because DEX bytecode gets translated into machine code during installation which means no compilation during runtime and thus seemingly faster!

    Because Dalvik requires extra memory for Just-in-time code cache, an app occupies a smaller memory footprint when it runs on ART."

    https://preview.redd.it/x8b29li6pjk51.png?width=1280&format=png&auto=webp&s=028cf01c7fa5b66d7b926a1434a697530941457b

    Framework

    The Android application creation process is provided by Application frameworks/libraries which allows developers to use the higher-level Kotlin or Java language, rather than low-level C/C++.

    The framework includes the basic blocks for building Android applications such as Content Provider, Activity Manager, Location Manager, View System, Package Manager, Notification Manager, Resource Manager, Telephony Manager, Window Manager.

    Android frameworks are divided into separate namespaces using the Java package naming and according to their functionality.

    Packages in the android.* namespace is available for use by developers.

    Packages in com.android.* are internal.

    Android also supports most of the standard Java runtime packages in the java.* namespace.

    https://preview.redd.it/9vhtlhu8pjk51.png?width=1280&format=png&auto=webp&s=feab2c94bfda06af4c0ae0ac051cd1d1772feccc

    Apps

    The topmost layer in the Android Stack is the Applications layer which can be categorized into System apps and user-installed apps.

    System apps cannot be uninstalled or changed by users and are read-only in production devices. System apps are included in the OS image, mounted as /system

    User-installed apps can be uninstalled at will. Each application lives in a dedicated security sandbox and cannot affect other applications or access their data.

    User-installed apps are installed on a dedicated read-write partition, mounted as /data that host user data.

    https://preview.redd.it/09tg4sv9pjk51.png?width=1280&format=png&auto=webp&s=8a75bf2267c51eba9d18628a7dc7a4b1727f7db3

    References

    https://developer.android.com/guide/platform

    https://source.android.com

    https://en.wikipedia.org/wiki/Android_(operating_system))

    https://software.intel.com/content/www/us/en/develop/blogs/art-vs-dalvik-introducing-the-new-android-x86-runtime.html

    Android Internals::A Confectioner's Cookbook

    Android Security Internals: An In-Depth Guide to Android's Security Architecture

    Embedded Android: Porting, Extending, and Customizing

    by androiddevnotes on GitHub

    🐣

    submitted by /u/jiayounokim
    [link] [comments]

    I created this simple app that will notify you of any new releases to the current Android Jetpack libraries. You can also browse and bookmark specific libraries you're interested in for easier tracking. It's on GitHub and Play Store. [link in comments]

    Posted: 01 Sep 2020 12:43 PM PDT

    Suspend. Appealed - no conditions/Warnings. 2 years passed. Suspended again for exactly samereason.

    Posted: 01 Sep 2020 12:52 PM PDT

    I'm small Indie Dev.

    Quite a while ago I've created tiny puzzle game, 3M Downloads, star 4.5 rating. Created Ad-Free PRO version. Pro verson suspended the day repetitive content policy was introduced. Successfully appealed - thanks reddit! https://www.reddit.com/r/androiddev/comments/91x2ow/got_my_app_suspended_for_repetitive_content/ - and reinstated without any further warnings from Google Policy Team.

    Pro version got suspended again today for the same reason... no prior warnings, no nothing - just suspend and strike. I would happily removed pro version from listing, not making any money anyway - it's really for loyal users who dislike ads, but even removed app could be suspended (+strike on top) ... catch 22

    OK Google. Appealed again quoting my previous successful appeal case number.

    submitted by /u/4aka
    [link] [comments]

    Smaller APKs with resource optimization - Jake Wharton

    Posted: 01 Sep 2020 06:31 AM PDT

    Understanding the Android APK build process, the execution environment, and code compilation.

    Posted: 01 Sep 2020 12:30 PM PDT

    How to emulate scanning NFC on Android Studio?

    Posted: 01 Sep 2020 12:34 PM PDT

    I usually test apps on my physical device, it doesn't support NFC, so now i'm trying to make a NFC Card reader to read cards codes, but i can't test it and android studio doesn't support NFC too, any solution please?

    submitted by /u/mrelhadj
    [link] [comments]

    Should I mock Presenter in UI Test

    Posted: 01 Sep 2020 12:17 PM PDT

    I just started exploring UI test (instrumented test) for android. However, I'm still haven't decided whether I should mock the Presenter or mock the model layer instead.

    Currently, I have this in my mind:

    1. If using espresso, then it should be an integration test. Thus mocking the model layer.
    2. If using robolectric, then it should be a unit test for views. Thus mock the presenter layer.
    submitted by /u/abangfadli
    [link] [comments]

    Structural Class Redefinition and Apply Changes

    Posted: 01 Sep 2020 11:04 AM PDT

    How to Implement a PDF Viewer in Your App Using PdfRenderer and ViewPager2

    Posted: 01 Sep 2020 12:22 AM PDT

    [Help] Android Studio 4.0.1 - constantly code reviewing/indexing

    Posted: 01 Sep 2020 11:10 AM PDT

    Hi everyone,

    for an app, I've already written a nice backend and now want to program the app communicating with it.

    But I have the following issue:

    • Code review happens on every click anywhere or button press, looping indefinitely.
    • I see "indexing" flashing constantly
    • My UI elements get disabled and enabled constantly during the infinite loop, because of some background task running
    • It says "2 processes" running (flashing too)
    • This all happens about 2-3 times per second

    What I've tried:

    • Installing on SSD
    • Reinstalling in general
    • Invalidating caches and restarting
    • Creating a new, empty project

    It just happens no matter what and the last threads I've seen are from 2019 just saying "invalidate your caches".

    Any idea why this happens?

    submitted by /u/GravitaryCOM
    [link] [comments]

    How to store this data?

    Posted: 01 Sep 2020 02:41 PM PDT

    Hi everyone,

    I am working on building a workout log app and I am brainstorming now. My app will have a list of exercises suggestions, around 200 different exercises. I want my app to start and have access to this data right away, I was wondering what's the best practice to store such data? Thanks.

    submitted by /u/16bumblebee
    [link] [comments]

    Update widget from API

    Posted: 01 Sep 2020 10:22 AM PDT

    Hi,

    currently I work on a weather app. For this I will make a widget also, which shows the current weather for the first selected city. The weather data comes from OpenWeatherMaps API.

    What is the best practice to update the widget instances from API?

    I would like to show for the users always the latest updated weather.

    Thanks.

    Inspire Coding

    submitted by /u/inspire_coding
    [link] [comments]

    Dagger Hilt ready for production yet?

    Posted: 01 Sep 2020 10:16 AM PDT

    I've seen a ton of posts about migrating to Hilt and the how much easier it is to use for android DI than dagger android or plain dagger. Is it ready to try and make the push for this in my company yet? I know the library is in alpha so likely not, but I'm not sure what's remaining (if it's stability changes or something else)

    submitted by /u/rillweed
    [link] [comments]

    Android Feature Development at Babylon Health — Part 2: From Designs to Architecture

    Posted: 01 Sep 2020 04:45 AM PDT

    Android vs iOS development time

    Posted: 01 Sep 2020 09:36 AM PDT

    Hi Reddit, I need your help. Can you tell me from your own experience which platform requires more work in terms of time: Android or iOS? Does it take the same time to do the same thing in Android than iOS?

    Please share with colleagues in Android/iOS for reach. Thanks!

    View Poll

    submitted by /u/zboarda
    [link] [comments]

    how to create a custom layout that is capable of rotating any of its child view/or nested layouts

    Posted: 01 Sep 2020 10:58 AM PDT

    I am having so much confusion creating custom layouts that can rotate it's child layout/views(any number of then nested). (Should I just think about rotating it's direct child only?) The closest I could find was this library: rotate-layout , but for some reason it's not working for nested constraintLayouts.

    I didn't find much resources online for extending viewGroups
    , and I'm having trouble understanding the very basic of things, e.g. MeasureSpec
    , where everyone says that it is the constraint imposed by the parent to it's children, but, is the parent the view we're extending or the viewGroup that holds the viewGroup we're extending? If the MeasureSpec
    is referring to the parent
    's specs, then would getPadding
    also get the padding of the parent of the ViewGroup
    we're extending?

    If possible please answer my above confusions and give me hints to how I should go about making the kind of view I have described above.

    submitted by /u/bzarnal
    [link] [comments]

    Android WebView Developer Satisfaction Research

    Posted: 01 Sep 2020 02:32 AM PDT

    Template for Smooth navigation menu like the one slack uses ?

    Posted: 01 Sep 2020 07:06 AM PDT

    Anyone with some template(Kotlin,java) to create a smooth navigation menu like the one slack uses ?

    submitted by /u/stevebaros
    [link] [comments]

    TextSwitcher Jetpack Compose

    Posted: 01 Sep 2020 05:55 AM PDT

    Does anyone knows how i could create the TextSwitcher element from the Android standard library using Jetpack Compose? With in and out animation?

    submitted by /u/danieldaeschle
    [link] [comments]

    Keep Your Regular Expression Escapes in Android

    Posted: 31 Aug 2020 07:02 PM PDT

    Could you recommend me a smartphone to develop?

    Posted: 01 Sep 2020 03:50 AM PDT

    Hi everyone, I'm quite new to the world of Android development so I have to buy a new smartphone just for development. Could you recommend one for me? The budget is € 200-250

    submitted by /u/limdev92
    [link] [comments]

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel