This PowerPoint helps students to consider the concept of infinity.
2_ProgrammingOnAndroidDevice.pdf
1. Lesson 3: Basics of Android
Application Development
By Gaddisa Olani
Prepared By Gaddisa Olani (Ph.D.) 2021
2. Application Fundamentals
• Android applications are written in the Java/Kotlin programming
language.
• The compiled Java code along with any data and resource files
required by the application is bundled by the aapt tool into an
Android package, an archive file marked by an .apk suffix.
• This file is the vehicle for distributing the application and installing it
on mobile devices; it's the file users download to their devices. All the
code in a single .apk file is considered to be one application.
Prepared By Gaddisa Olani (Ph.D.) 2021
3. Android Software Development Kit (SDK)
• The SDK includes a comprehensive set of development tools.
• Includes a debugger, libraries, documentation, sample code
• These tools are accessed through an Eclipse/Android Studio plugin called
ADT (Android Development Tools) or from command line
• Developing with Android Studio is preferred (but not required)
Prepared By Gaddisa Olani (Ph.D.) 2021
4. Steps for Developing Applications
1. Install Android Studio or Eclipse or own IDE
2. Install ADT plugin, or an editor of your choice (depending on the IDE version
you are using)
3. Set up Android Virtual Devices or hardware devices on which you will install
your applications
4. Create an Android project
o Contains all source code and resource files for your application. Built into
an .apk package that you can install on Android devices.
5. Build and run your application
Prepared By Gaddisa Olani (Ph.D.) 2021
7. Component - Activity
❑Present a visual user interface for one focused
endeavor the user can undertake.
❑Example - Present a list of menu items users can
choose from or it might display photographs along with
their captions.
❑Example - A text messaging application might have
one activity that shows a list of contacts to send
messages to, a second activity to write the message to
the chosen contact, and other activities to review old
messages or change settings.
❑Each activity is it's own entity but all activities
work together to form the application.
Prepared By Gaddisa Olani (Ph.D.) 2021
8. Component - Services
➢Services are tasks that run in the
background (i.e., a service doesn't have a
visual user interface)
➢Run on the main process thread unless
otherwise specified
➢Examples: Downloads, Playing Music,
TCP/UDP Server, alarm clock, etc
(Image from http://marakana.com)
Prepared By Gaddisa Olani (Ph.D.) 2021
9. Component - Content Provider
➢Content providers are data storage facilities
which supports data exchange between
application (Example: SQLite database)
➢Content Providers allow for cross application
communication
➢Applications must have necessary permission
levels to communicate
➢For example allows applications to select an
image from the phones library, select a
contacts info from the contacts list, etc
Prepared By Gaddisa Olani (Ph.D.) 2021
10. Component - Broadcast Receiver
➢Broadcast are system wide
notifications
➢A broadcast receiver is a
component that does nothing but
receive and react to broadcast
announcements.
➢Ex: Low battery, power connected,
shutdown, timezone changed, etc.
Prepared By Gaddisa Olani (Ph.D.) 2021
15. Android Manifest
• Its main purpose in life is to declare the components to the system:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.demo">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name="com.example.demo.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest> Prepared By Gaddisa Olani (Ph.D.) 2021