Mobile Application UNIT1
Mobile Application UNIT1
What is android?
What is Framework?
In computer systems, a framework is often a layered structure
indicating what kind of program can or should be built and
how they would interrelate.
Android development frameworks
a. Ionic Framework
Features:
Angular Integration
b. Adobe PhoneGap
Adobe PhoneGap is an open-source Android application
development framework that was purchased by Adobe
Systems in 2011. Its unique feature is that it can be used to
build mobile applications using HTML5, CSS3, and
JavaScript instead of using API like Android, iOS, or
Windows Phone. According to PhoneGap, it can be used
to “Reuse existing web development skills to quickly make
hybrid applications built with HTML, CSS and Javascript.”
Features:
Cloud Build and Testing
Integrating Debugging Tools
OpenSource
Robust Backend
Large Community Base.
c. React Native
React Native is an open-source Android Development
framework that was created by Facebook and released in
2015. It provides support for various IDEs and mobile app
development tools and that is one of the main reasons it is
used by many companies such as Instagram, Tesla, Walmart,
Baidu, etc. to develop their mobile apps.
Features:
Platform-Specific UI Components
React Native Bridge for Native Integration
Code Sharing with Web Application
Instant Updates and Over-The-Air Updates.
d. Flutter
Flutter is an open-source Android development framework
that was released by Google in 2017. According to
Google, “Flutter is Google’s portable UI toolkit for
building beautiful, natively-compiled applications for
mobile, web, and desktop from a single codebase.” Flutter
is written in the Dart programming language (Also developed
by Google) and it is currently used by famous companies
such as Alibaba, Tencent, and Google.
Features:
Hot Reload
Widget-Based Development
Cross-Platform Compatibility
Beautiful and Customizable UI
Access to Native APIs.
e. Titanium SDK
Titanium SDK is an open-source Android Development
framework that was created by Appcelerator and released in
2018. It is basically a development environment that can be
used to create native apps across various operating systems
like iOS, Android, BlackBerry, etc. Titanium is quite
popular. According to the Titanium website “The Titanium
environment helps organizations get to market 60%
faster and achieve a significant competitive advantage.”
Features:
Native Performance
Cross-Platform Compatibility
Code Reusability
Native UI Components
Access to Native APIs.
d. Android Emulators:
An Android Emulator is a device that simulates an Android
device on your system. Suppose we want to run our android
application that we code. One option is that we will run this
on our Android Mobile by Enabling USB Debugging on our
mobile. Another option is using Android Emulator. In
Android Emulator the virtual android device is shown on our
system on which we run the Android application that we
code.
In Android Virtual Emulator all functions that are feasible
on real Android mobile is works on virtual Device like:
phone calls, text messages.
stimulate different network speeds.
specify the location of a device
access on google play store and lot’s more.
But there is one disadvantage of this emulator is that. It is
very slow when System’s PC has less RAM. It works fine
when a maximum GB of RAM is present on our device.
There are two tabs at the top, Virtual and Physical. If you
don't have a phone plugged in to your computer, the Physical
tab will be empty. The Virtual tab shows you what virtual
devices you have already set up. To set up a new one, click
the Create Device button at the top. you'll see this:
In the image above, we've selected the Phone category. In the
middle, we've selected tp set up a Pixel 6 virtual device. Click
Next to see this screen:
This screen is where you can select a system image for when
the device loads. As the message on the right says, the
recommended images run faster and support Google APIs.
Click Next and you're almost there. This is the final screen
you'll see:
Not much to do here but confirm you choices. Click Finish to
finish setting up your new virtual device.
After you have finished setting up the new device, you should
see it appear on your Device Manager list:
You'll also see it on the menu to the left of the Run button at
the top of Android Studio:
When you click the Run button now, your app will start on
your new virtual device. The idea here is that you can test
your app on a wide range of devices to see what it looks like:
Now have a look at the control strip at the top of the the
emulated phone. This one:
Creating AVDs:
In android development, we need an android device to run
the application. So, developers of Android Studio provide an
option to install android virtual device to run it.
Follow the below steps to install Android Virtual Device.
Step 1: Go to Tools > AVD Manager.
Step 2: Now click on Create Virtual Device.
The panel on the left side of the android studio window has
all the files that the app includes. Under the java folder,
observe the first folder containing the java file of your
project.
For every activity, a “.java” file and a “.xml” file is created.
In this case for MainActivity, “MainActivity.java” and
“activity_main.xml” are created.
The above java file shows us the default code that is present
when an app is created. An activity is created that extends
AppCompactActivity class.
The “res” folder contains “layout” subfolder, which includes
the xml files of the projects.
Now, consider the activity_main.xml file, it contains various
tags similar to HTML. The first tag ensures the version. The
second tag is usually the Layout tag. There are various types
of Layouts but for now, let us go with the
default RelativeLayout. This is a layout that places the
widgets relative to screen size.
There is a TextView widget by default. This “TextView” is
basically the Text field that displays the text specified. It has
various attributes. For now, consider the default attributes
present. The layout_width and layout_height are the width
and height of the widget occupied in the screen. The attribute
“wrap_content” refers to width or height being restricted to
the content of the text.
Now, click the “Run” option at the Toolbar at the top. You
can observe the option being highlighted in the image below.
You would get a pop-up as in the image below.
You can either choose the emulator or you can connect your
phone and find them listed under Connected Devices but for
this you must enable the developer options in your phone and
set the USB debugging mode on.