Tutorial Android Notes For HND Students
Tutorial Android Notes For HND Students
Paix-Travail-Patrie Peace-Work-Fatherland
MINISTERE DE L’ENSEIGNEMENT MINISTRY OF HIGHER
SUPERIEUR EDUCATION
Advantages of android :
Wasteful battery
Android market is too much less control of the manager, sometimes there are malware
Difficult to modify
The Google Android SDK is a toolset that developers need in order to write apps on
Android enabled devices. It contains a graphical interface that emulates an Android
driven handheld environment, allowing them to test and debug their codes.
- Linux Kernel
- Libraries
- Android Framework
- Android Applications
The Android Framework is an important aspect of the Android Architecture. Here you
can find all the classes and methods that developers would need in order to write
applications on the Android environment.
5) What is AAPT?
AAPT is short for Android Asset Packaging Tool. This tool provides developers with the
ability to deal with zip-compatible archives, which includes creating, extracting as well
as viewing its contents.
6) What is the importance of having an emulator within the Android environment?
The emulator lets developers “play” around an interface that acts as if it were an actual
mobile device. They can write and test codes, and even debug. Emulators are a safe
place for testing codes especially if it is in the early design phase.
8 ) Describe Activities.
Activities are what you refer to as the window to a user interface. Just as you create
windows in order to display output or to ask for an input in the form of dialog boxes,
activities play the same role, though it may not always be in the form of a user interface.
Intents displays notification messages to the user from within the Android enabled
device. It can be used to alert the user of a particular state that occurred. Users can be
made to respond to intents.
Activities can be closed, or terminated anytime the user wishes. On the other hand,
services are designed to run behind the scenes, and can act independently. Most
services run continuously, regardless of whether there are certain or no activities being
executed.
These are the essential items that are present each time an Android project is
created: - AndroidManifest.xml
- build.xml
- bin/
The use of XML-based layouts provides a consistent and somewhat standard means of
setting GUI definition format. In common practice, layout details are placed in XML files
while other items are placed in source files.
Developers can write and register apps that will specifically run under the Android
environment. This means that every mobile device that is Android enabled will be able
to support and run these apps. With the growing popularity of Android mobile devices,
developers can take advantage of this trend by creating and uploading their apps on the
Android Market for distribution to anyone who wants to download it.
Adb is short for Android Debug Bridge. It allows developers the power to execute
remote shell commands. Its basic function is to allow and control communication
towards and from the emulator port.
- Stopped – if the activity is not visible and therefore is hidden or obscured by another
activity - Destroyed – when the activity process is killed or completed terminated
ANR is short for Application Not Responding. This is actually a dialog that appears to the
user whenever an application have been unresponsive for a long period of time.
20) Which elements can occur only once and must be present?
Among the different elements, the and elements must be present and can occur only
once. The rest are optional, and can occur as many times as needed.
Permissions allow certain restrictions to be imposed primarily to protect data and code.
Without these, codes could be compromised, resulting to defects in functionality.
Because every component needs to indicate which intents they can respond to, intent
filters are used to filter out intents that these components are willing to receive. One or
more intent filters are possible, depending on the services and activities that is going to
make use of it.
A call to onStop method happens when an activity is no longer visible to the user, either
because another activity has taken over or if in front of that activity.
26) Is there a case wherein other qualifiers in multiple resources take precedence over
locale?
Dalvik serves as a virtual machine, and it is where every Android application runs.
Through Dalvik, a device is able to execute multiple virtual machines efficiently through
better memory management.
This file is essential in every application. It is declared in the root directory and contains
information about the application that the Android system must know before the codes
can be executed.
When default resources, which contain default strings and files, are not present, an
error will occur and the app will not run. Resources are placed in specially named
subdirectories under the project res/ directory.
34) When dealing with multiple resources, which one takes precedence?
Assuming that all of these multiple resources are able to match the configuration of a
device, the ‘locale’ qualifier almost always takes the highest precedence over the
others.
1
HIPE UNIVERSITY, SOFTWARE ENGINEERING
0
35) When does ANR occur?
The ANR dialog is displayed to the user based on two possible conditions. One is when
there is no response to an input event within 5 seconds, and the other is when a
broadcast receiver is not done executing within 10 seconds.
-charSequence
-List
-Map
-all native Java data types like int,long, char and Boolean
A fragment is a part or portion of an activity. It is modular in a sense that you can move
around or combine with other fragments in a single activity. Fragments are also
reusable.
1
HIPE UNIVERSITY, SOFTWARE ENGINEERING
1
39) What is a visible activity?
A visible activity is one that sits behind a foreground dialog. It is actually visible to the
user, but not necessarily being in the foreground itself.
The foreground activity, being the most important among the other states, is only killed
or terminated as a last resort, especially if it is already consuming too much memory.
When a memory paging state has been reach by a foreground activity, then it is killed so
that the user interface can retain its responsiveness to the user.
Yes, it is possible to do that, such as when you want to create a background behavior for
a particular activity. You can do this by using add(Fragment,string) method to add a
fragment from the activity.
42) How do you remove icons and widgets from the main screen of the Android
device?
To remove an icon or shortcut, press and hold that icon. You then drag it downwards to
the lower part of the screen where a remove button appears.
43) What are the core components under the Android application architecture?
- intent
- resource externalization
1
HIPE UNIVERSITY, SOFTWARE ENGINEERING
2
- notifications
- content providers
A project under Android development, upon compilation, becomes an .apk file. This apk
file format is actually made up of the AndroidManifest.xml file, application code,
resource files, and other related files.
A Sticky Intent is a broadcast from sendStickyBroadcast() method such that the intent
floats around even after the broadcast, allowing others to collect data from it.
46) Do all mobile phones support the latest Android operating system?
Some Android-powered phone allows you to upgrade to the higher Android operating
system version. However, not all upgrades would allow you to get the latest version. It
depends largely on the capability and specs of the phone, whether it can support the
newer features available under the latest Android version.
Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other
wireless device. For example, using your Android-powered phone as a Wi-Fi Hotspot,
you can use your laptop to connect to the Internet using that access point.
1
HIPE UNIVERSITY, SOFTWARE ENGINEERING
3
In Android development, an action is what the intent sender wants to do or expected to
get as a response. Most application functionality is based on the intended action.
49) What is the difference between a regular bitmap and a nine-patch image?
In general, a Nine-patch image allows resizing that can be used as background or other
image size requirements for the target device. The Nine-patch refers to the way you can
resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the
middle one that can be scaled into both axes.
50) What language is supported by Android for application development?
The main language supported is Java programming language. Java is the most popular
language for app development, which makes it ideal even for new Android developers
to quickly learn to create and deploy applications in the Android environment.
1
HIPE UNIVERSITY, SOFTWARE ENGINEERING
4