Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
57 views

Unit One For Mobile Programming

This document provides an introduction to mobile programming and Android. It discusses what Android is, its key features such as a beautiful UI, connectivity, storage and more. It also describes Android's architecture including the Linux kernel, libraries, Android runtime, application framework and applications. Finally, it outlines the steps to create a basic "Hello World" Android application using Android Studio including required files like the manifest, Java code, layouts and strings.

Uploaded by

Moti
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Unit One For Mobile Programming

This document provides an introduction to mobile programming and Android. It discusses what Android is, its key features such as a beautiful UI, connectivity, storage and more. It also describes Android's architecture including the Linux kernel, libraries, Android runtime, application framework and applications. Finally, it outlines the steps to create a basic "Hello World" Android application using Android Studio including required files like the manifest, Java code, layouts and strings.

Uploaded by

Moti
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

Bule Hora

Unit one
Introduction to Mobile programming
Well Come to class of Mobile
programming
Unit one
Introduction to Android

Out comes
What is android?
Features of android?
Android OS Architecture.
Android development environment
What is android?
 Android is an open-source, Linux-based operating
system for mobile devices such as smartphones and
tablet computers.
Android was developed by the Open Handset
Alliance, led by Google, and other companies.
Why Android ?
Features of android
 Beautiful UI  Web browser
 Connectivity  Multi-touch
 Storage  Multi-tasking
 Media support  Multi-Language
 Messaging  GCM
Features of android
 Beautiful UI:- Android OS basic screen provides a
beautiful and intuitive user interface.
 Connectivity:-support GSM/EDGE, IDEN, CDMA, EV-DO, UMTS, Bluetooth,
Wi-Fi, LTE, NFC and WiMAX.

 Storage:- SQLite, a lightweight relational database, is used for


data storage purposes.
 Media support:- H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-
AAC, AAC 5.1, MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP

 Messaging:- SMS and MMS


Features of android
 Web browser:- Based on the open-source WebKit layout engine, coupled with Chrome's V8
JavaScript engine supporting HTML5 and CSS3

 Multi-touch:- Android has native support for multi-touch which was initially made
available in handsets such as the HTC Hero.

 Multi-tasking:- User can jump from one task to another and same time various
application can run simultaneously.
 Resizable widgets:- Widgets are resizable, so users can expand them to show more
content or shrink them to save space.
 Multi-Language:- Supports single direction and bi-directional text.
 GCM:- Google Cloud Messaging (GCM) is a service that lets
developers send short message data to their users on Android devices,
without needing a proprietary sync solution
What is API level?
 API Level is an integer value that uniquely identifies the
framework API revision offered by a version of the
Android platform.
Examples Lolipop(21), Kitkit(19),
Jelly_bean(16) etc
Android OS Architecture
is a stack of software components which is roughly divided into five sections
and four main layers.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and
four main layers.
Mainly

1. Linux kernel
 At the bottom of the layers is Linux
 It provides basic system functionality like process management, memory
management, device management like camera, keypad, display etc.
 It handles all the things that Linux is really good at, such as networking and a vast
array of device drivers.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and
four main layers.
Mainly

2. Libraries
 On top of Linux kernel
 There is a set of libraries including
 Open-source Web browser engine WebKit,
 Well known library libc,
 SQLite database which is a useful repository for storage and
 Sharing of application data,
 Libraries to play and record audio and video,
 SSL libraries responsible for Internet security etc.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and four main layers.
2. Libraries
A summary of some key core Android libraries available to the Android developer is as follows −
 android.app − Provides access to the application model and is the cornerstone of all Android applications.
 android.content − Facilitates content access, publishing and messaging between applications and
application components.
 android.database − Used to access data published by content providers and includes SQLite database
management classes.
 android.opengl − A Java interface to the OpenGL ES 3D graphics rendering API.
 android.os − Provides applications with access to standard operating system services including messages,
system services and inter-process communication.
 android.text − Used to render and manipulate text on a device display.
 android.view − The fundamental building blocks of application user interfaces.
 android.widget − A rich collection of pre-built user interface components such as buttons, labels, list
views, layout managers, radio buttons etc.
 android.webkit − A set of classes intended to allow web-browsing capabilities to be built into
applications.
Android OS Architecture
is a stack of software components which is roughly divided into five sections and four
main layers.
Mainly

3. Android Runtime
 It is the third section of the architecture and available on the second layer from the
bottom.
 It provides a set of core libraries- enable a developer to use java language.
 It provides a key component called Dalvik Virtual Machine which is a kind of Java
Virtual Machine specially designed and optimized for Android.
NB:- The Dalvik VM enables every Android application to run in its own
process.
- The Dalvik VM makes use of Linux core features like memory
management and multithreading, which is intrinsic in the Java language.
Android OS Architecture
is a stack of software components which is roughly divided into five sections
and four main layers.

4. Applications Framework
 It provides many higher-level services to applications in the form of Java
classes.

 Application developers are allowed to make use of these services in their


applications.
Android OS Architecture
is a stack of software components which is roughly divided into five sections
and four main layers.

4. Applications Framework
The Android framework includes the following key services −
 Activity Manager − Controls all aspects of the application lifecycle and activity stack.
 Content Providers − Allows applications to publish and share data with other applications.
 Resource Manager − Provides access to non-code embedded resources such as strings, color settings and
user interface layouts.
 Notifications Manager − Allows applications to display alerts and notifications to the user.
 View System − An extensible set of views used to create application user interfaces.
Android OS Architecture
is a stack of software components which is roughly divided into five sections
and four main layers.
Mainly

5 Applications
 All the Android application are at the top layer of architecture.
 Application to be installed is written on this layer only.
 Examples are Contacts Books, Browser, Games, etc.
Android development Environment

For android application development: -


1. Know your machine OS- it may supported by
- window,
- mac,
- Linux and so on.
2. Find required tools that appropriate with your machine OS.
- Java JDK5 or later version
- Android Studio + SDK
3. Install required tools on your machine
Hello world example

To create hello world application follow


below steps
1. Launch android studio
2. Fill new installation frame information- Application
name, package information and location of the project.
3. Specify Minimum SDK.
4. Selecting the activity to mobile
5. Write the application code
Overview of android application
 Manifest:- describes the fundamental characteristics of the app and
defines each of its components.
 Java :- it contains .java file that runs when your app is launched using the
app icon.
 res/layout:- define your app's user interface.
 res/drawable:- for drawable objects that are designed for screens in
different density.
 res/values:- for other various XML files that contain a collection of
resources, such as strings and colours definitions.
 Gradle:- is an auto generated file which contains compileSdkVersion,
buildToolsVersion, applicationId, minSdkVersion, targetSdkVersion,
versionCode and versionName, location of sdk,
Android Application code for Hello world example

 Main Activity File :-is a Java file MainActivity.java directly runs


your app.

package com.example.HelloWorld;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Android Application code for Hello world example
 Manifest File:-is a root of app because
 whatever component of application is declared in it.
 works as an interface between Android OS and your application.

<?xml version="1.0" encoding="utf-8"?>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.my1">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.HelloWorld">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />


</intent-filter>
</activity>
</application>

</manifest>
Android Application code for Hello world example

 Strings File:-is located in the res/values folder and it contains all


the text that your application uses.
<resources>
<string name="app_name">HelloWorld</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
Android Application code for Hello world example

 Layout File :-is available in res/layout directory, to reference UI of


application.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="50dp"
android:textAllCaps="true"
android:textColor="@color/purple_500"
android:textAlignment="gravity"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Set up AVD

 Go to AVD manager- from tools tab.


 Select create virtual devices
 Download hardware
 Launch created AVD

You might also like