Application Development-1
Application Development-1
Lect1
Platform-specific Development:
Apps are often built for specific operating systems such as Android or iOS.
User Interface (UI):
Mobile apps have interfaces optimized for touch input, smaller screens and
gestures (e.g., swiping, pinching).
Internet Connectivity:
Many apps rely on an active internet connection.
Wide Range of Uses:
Utility apps: Calendars, reminders.
Social apps: Facebook, WhatsApp.
Productivity apps: Google Docs, Trello.
Mobile Operating Systems a software interface that is responsible for managing and
operating hardware units.
The most well-known mobile OSs are Android, iOS, Windows phone OS, and
Symbian.
IOS
Apple's very own operating system, iOS runs the company's iPod, iPad, iPhone, and
Apple Watch devices. It is only available on Apple products and responds to commands
from the user's fingertips.
Android
Windows
Hardware Layer
The physical components of the device, including the CPU, GPU, memory.
Managed by the lower layers of the OS.
Kernel Layer
Acts as the core of the OS, managing hardware resources and providing low-level
services such as memory management, process scheduling, and hardware abstraction.
Common kernels:
Android: Modified Linux kernel.
iOS: XNU (a hybrid of Mach and BSD).
Platform Layer
iOS Core OS
Core Services
Media Layer
Cocoa Touch Layer
Applications
Harmony OS Kernel
Device Virtualization Layer
Platform Layer
Application Framework
Applications
Applications are separated into three general categories: native applications, web
apps, and hybrid applications.
Category Description
Native Built specifically for a platform (e.g., iOS, Android) using platform-specific
Applications languages (e.g., Swift, Kotlin).
Installed directly on devices and can access hardware features (e.g., GPS,
camera).
Web Applications Run within a web browser and are built using web technologies (HTML, CSS,
JavaScript).
Cannot access device hardware and are not available in app stores.
Hybrid Combine elements of both native and web apps.
Applications
Built using web technologies (HTML5) but run in a native wrapper and can be
installed on devices.
Hybrid Mobile Apps These apps can be installed on devices just like native apps, but
they run through web browsers. All hybrid apps are developed through the HTML5
programming language. Though hybrid apps are not as fast or reliable as native apps,
they have a greater capacity for streamlining the development process. Because you
don’t have to build and maintain apps for separate platforms, your business can save on
time and resources.**
Flutter A free and open-source mobile UI framework created by Google and released in
May 2017.
Flutter is a great tool from Google for creating cross-platform applications with only one
code which can be deployed to the web, desktop, and mobile(IOS and Android).
Two important parts of flutter particularly responsible for its popularity are:
Flutter is organized around layers. Each layer is build upon the previous.
Flutter Layers
Presentation Layer
Widgets, States, Controllers.
Application Layer
Services.
Domain Layer
Models.
Data Layer
Repositories, DTOs, Data Sources.
Everything is a widget
1. Hot Reload
The changes made by the developers can be seen instantaneously with Hot
Reload.
2. Cross-Platform Development
CPD saves time, energy and money. With Flutter, you need to write the code once,
maintain and can use that for two apps.
3. Accessible Native Features and SDKs
you can easily access the native features and SDKs on both Android and iOS
platforms and reuse the widely-used programming languages such as Kotlin and
Swift.
4. Minimal Code
Flutter is developed using Dart programming language. Dart uses JIT and AOT
compilation that helps improve the overall startup time, functioning and accelerates
the performance. JIT enhances the development system with the hot reload
function. It refreshes the UI without putting in the effort to building a new one.
5. Widgets
In Flutter, the widgets are given an upper hand. It is capable of developing
customizable and complex widgets. Most importantly, Flutter has all the sets of
widgets from Material Design and Cupertino pack and it helps to provide a glitch-
free experience in this case over and above all the other platforms.
6. Native Feel and Features
Flutter enables you to use your existing code Java, Obj-C and Swift to gain the key
to native features which are platform specific. Camera and Geo location are
features connected with the use of native languages and offers you the
convenience of working in the native language and, it provides access to the native
features of both iOS and Android platforms.
Lect2
Widget a user interface component that affects and controls the view and interface of
the app. It represents an immutable description of part of the user interface and includes
graphics, text, shapes, and animations that are created using widgets.
Widgets are nested with each other to build the app. It means the root of your app is
itself a widget, and all the way down is a widget also.
Widgets are the building blocks of a Flutter app
1. Visible (Output and Input) related to the user input and output data. Some of the
important types of this widget are: Text, Button, Image, Icon, column, Row.
2. Invisible (Layout and Control)
StatelessWidget
StatefulWidget
To build the UI, you use two main types of widgets, StatelessWidget and
StatefulWidget.
Each stateless or stateful widget has a build method with a BuildContext that
handles the location of the widget in the widget tree. The BuildContext objects are
actually Element objects, an instantiation of the Widget at a location in the tree.
StatelessWidget Lifecycle
A StatelessWidget is built based on its own configuration and does not change
dynamically.
It can be called the first time the widget is created, when the widget’s parent
changes, and when an InheritedWidget has changed.
The StatefulWidget Lifecycle
The widget tree is how developers create their user interface; developers position
widgets within each other to build simple and complex layouts.
To improve code readability and manageability, developers can separate widgets
into their own widget class, creating widget tree.
MaterialApp widget
a widget to create the root level UI of the application and contains three properties -
title, theme, and home.
Scaffold widget
Scaffold widget is a top-level widget after the MaterialApp widget for creating the
user interface.
The Scaffold is a widget in Flutter used to implements the basic material design
visual layout structure.
1. appBar: It is a horizontal bar that is mainly displayed at the top of the Scaffold
widget. It is the main part of the Scaffold widget and displays at the top of the
screen. Without this property, the Scaffold widget is incomplete. It uses the appBar
widget that itself contains various properties like elevation, title, brightness, etc.
return Scaffold(
appBar: AppBar(
), )
}**
2. body: It is the other primary and required property of this widget, which will display
the main content in the Scaffold. The widgets inside the body are positioned at the
top-left of the available space by default.
return Scaffold(
appBar: AppBar(
title: Text('First Flutter Application'),
),
body: Center(
child: Text("Welcome to Flutter",
style: TextStyle( color: Colors.black, fontSize: 30.0,
),
),
),
}
Example:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
@override
return MaterialApp(
theme: ThemeData(
primarySwatch: Colors.blue,
),
);
@override
return Scaffold(
appBar: AppBar(
title: Text(this.title),
),
body: Center(
),
);
Scaffold properties(con..)
floatingActionButton example:
return Scaffold(
body: Center(
),
floatingActionButton: FloatingActionButton(
elevation: 8.0,
child: Icon(Icons.add),
onPressed: (){
);
}
* backgroundColor: This property is used to set the background color of the whole
Scaffold widget.
backgroundColor: Colors.yellow
primary: It is used to tell whether the Scaffold will be displayed at the top of the
screen or not. Its default value is true.
primary: true/false,
Drawer
It is a slider panel that is displayed at the side of the body. Usually, it is hidden on the
mobile devices, but the user can swipe it left to right or right to left to access the drawer
menu. It uses the Drawer widget properties slides in a horizontal direction from the
Scaffold edge to show navigation links in the application. An appropriate icon for the
drawer is set automatically in an appBar property. The gesture is also set automatically
to open the drawer.
persistentFooterButton
It is a list of buttons that are displayed at the bottom of the Scaffold widget. These
property items are always visible. It is always wrapped in a ButtonBar widget. They are
rendered below the body but above the bottomNavigationBar.