Unit 3 android
How Does Android App Work?
Developing an android application involves several processes that
happen in a sequential manner. After writing the source code files,
when developers click the Run button on the Android studio, plenty of
operations and process starts at the backend. Every operation
happening in the background is a crucial step and are interdependent.
The IDE builds all the application files, make them device compatible in
order to deploy, and assure that the application runs successfully on
the device.
Step 1: Building the APK File
1. Code Compilation
The android application source files are written in either Java(*.java
files) or Kotlin(*.kt files) programming languages. Syntax of writing the
code in these 2 languages are different but their compilation process is
almost the same. Both programming languages generate code that can be
compiled to Java byte-code which is executable on JVM(Java Virtual
Machine).
2. Conversion into Dalvik bytecodes
The generated Java class(*.class) file in the previous step is executable on
Java Virtual Machine(JVM) as it contains the standard Oracle JVM Java
byte-codes. However, this code format is not suitable for Android devices
and thus Android has its own unique byte-code format known as Dalvik
byte-code. Dex compiler translates the Java byte-code into the Dalvik
byte-code that are machine-code instructions for a theoretical processor.
3. Generating .apk file
Resource files of the android application like images, fonts, XML layouts,
etc. are transformed into a single compiled resource unit by the Android
Asset Packaging Tool(aapt)
4. App Distribution
The .apk file generated in the previous step is a ready-to-use application
package and developers can use this file for the purpose of app distribution.
However, to distribute and publish the application through Google Play
Store, developers need to sign it. Android applications are required to be
digitally signed with a certificate so that they can be installed by the users.
The certificate is self-signed, and the Android uses it to identify the author of
the application.
Step 2: Deploy the Application
1. Establish the ADB Server
Android Debug Bridge(ADB) deploys an application to Android devices. It is
a command-line tool that acts as an interface and facilitates developers to
communicate with an android device. To start the deployment, the ADB
client will first check whether the ADB server process is already running
on the device. If there isn’t, the server process starts with the ADB
command. The ADB server starts and binds with local TCP port 5037. All
communication and commands are transferred from the ADB server to ADB
clients using port 5037.
2. Transfer .apk file to the Device
The ADB command transfers the .apk file into the local file system of the
target Android device. The app location in the device file system is defined
by its package name. For example, if the application package
is [Link], then its .apk file will be located in the
path /data/app/[Link].
Step 3: Run the Application
1. App launch request
Zygote process is the parent to all Android apps and it launches an
application when a user makes the request to do so. The zygote is a special
kind of Android OS process which enables code sharing between different
instances that run across Android virtual devices(Dalvik/Android Runtime).
. Conversion of the .dex code to native OAT format
When a new application is installed, the Android optimize the app data and
generates a corresponding OAT file. This file is created by the Android OS
to accelerate the application loading time. The process to generate the OAT
file starts with the extraction of [Link] file present inside the .apk file
of the application.
Android Application life cycle
Android is a perfect example of true multi-tasking i.e. you can perform more than one
tasks at a particular instant of time. Actually, we are not performing multiple tasks at a
particular instant of time, rather it seems that we are performing more than one tasks
at a time. In a very simple way, at any particular instant of time, only one app can be in
the running state and other apps will be in the background state. All these processes
are managed and handled in such a way that it seems that we are doing more than one
task at some instant of time.
Priorities of Android Application
So far, we have seen that, in order to have a proper memory and battery
management in the Android device, Android pushes or kills the
applications that are having less priority.
1. Foreground process: A process is said to be in the foreground
state if a user interacts with that process. For example, if you are
watching some video on the YouTube app, then the YouTube app
will be called to be in the foreground state because that app is
currently being used by the user. So, the applications that are on the
foreground have the highest priority.
2. Visible process: A process is said to be in the visible state when
the activity of the application can be visible but not in the fort. :)
Confusing? Let’s have an example, whenever you are using some
application that requires some kind of permission then you are using
the visible process. For instance, let’s take the example of Instagram
application, when you want to upload some images from your device
then the app will ask you to give permission of the storage. Service
process: A process is said to be a Service process if it is currently
running but it does not come under the above two categories i.e. the
foreground and the visible process..
3. Background process: A process is said to be in background state
if it’s onStop() method is being called by the Android. Suppose you
are using some application and you suddenly press the home button
of your mobile then at that time, your application will go to the
background state from the foreground state. Empty process: A
process is said to be in the empty state if it doesn’t come under the
category of the above four mentioned process states.
How do I fix a white screen when an app starts?
How to Fix Android White Screen of Death?
Open the Settings app and tap Apps & notifications.
Find and tap on the app that you think is causing the problem.
Tap Storage & cache and then tap Clear cache followed by Clear storage.
Why does my screen keep turning white?
A problem in the hardware is the most common reason for the White Screen of
Death. There are likewise examples where software issues can bring about the
white screen Windows 10. It additionally happens because of dropping your device,
equipment damage, or an incomplete OS or application update.5 days ago
Why is my Android screen white?
There are multiple reasons why your Android phone screen turns white. The screen
itself could be faulty, in which case the only solution is to have it replaced. Or maybe
other hardware components are damaged. Additionally, corrupted files and
overheating issues could also cause white screen issues.25-Jul-2021
What is white app on Android?
A white label mobile app is a “native” mobile application that runs directly on the
Apple iOS or Google Android operating systems that is built by a third party but
offered under your own brand. It's available in the Apple App or Google Play Stores
for people to download directly.
How do you fix a blank white screen?
Effective DIY methods to resolve blank white screen of death
Remove the peripheral devices.
Force restart your Windows PC.
Boot your PC into Safe Mode.
Update the Graphics Driver.
Update your Windows 11/10 OS to fix blank white screen.
Uninstall a recently installed Windows update.
Restore your PC to an earlier state.
gains or loses the top resumed
A