0% found this document useful (0 votes)
3 views

Notes on Android Studio

The document provides an overview of Android Studio, its recent versions, and features, as well as a brief introduction to Kotlin as a programming language. It includes several Flutter application examples demonstrating the use of widgets like AppBar and Scaffold, along with user interaction through buttons and SnackBars. Additionally, it explains the importance of importing Dart packages and distinguishes between general Dart packages and plugin packages for Flutter development.

Uploaded by

aaishighosh2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Notes on Android Studio

The document provides an overview of Android Studio, its recent versions, and features, as well as a brief introduction to Kotlin as a programming language. It includes several Flutter application examples demonstrating the use of widgets like AppBar and Scaffold, along with user interaction through buttons and SnackBars. Additionally, it explains the importance of importing Dart packages and distinguishes between general Dart packages and plugin packages for Flutter development.

Uploaded by

aaishighosh2005
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Version of Android Studio :-

Recent Version – Lady Bug (2024)


Koala (2024) – initial version
Jellyfish (2023)
Android Virtual Device :-
It’s a configuration in android operating simulator
What is Android Studio ?
ans:- It is a tool which is used to develop android applications.
It has many features, i.e.
1. Gradle Build System
2. Android SDK build tools
3. Build Analyzer
4. API modules
5. Flexibility
What is Kotlin ?
ans:- Kotlin is a cross platform, high – level Programming
Language.
Difference between Android & ios.
ans:-
https://www.youtube.com/watch?v=cyNjnyQwVcU
PROGRAM : 1
import 'package:flutter/material.dart';

void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Hello Joy'),
),
body: Center(
child: Text(
'Hello, World!',
style: TextStyle(fontSize: 24),
),
),
),
);
}
}
NOTE : scaffold provides a framework for implementing the basic
material design layout
AppBar widget creates a top bar, typically with a title.
title: Text ('Hello World App')
PROGRAM : 2
import 'package:flutter/material.dart';
//runApp() is resposible for creating WidgetsFlutterBinding
Which
//is the binding between framework and flutter engine
void main() => runApp(MyApp()); //to start app's execution

class MyApp extends StatelessWidget {


@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Hello World App',
//scaffold widget in flutter is a basic structure that
//provides the visual layout for a material design app
home: Scaffold(
//AppBar widget is based on Material design
appBar: AppBar(
title: Text('Hello World App'),
),
body: Center(
child: Text(
'JOY ADHIKARY is bad Guy',
style: TextStyle(fontSize: 35),
),
),
),
);
}
}
PROGRAM : 3
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Hello World App',
home: Scaffold(
appBar: AppBar(
title: Text('Hello World App'),
),
body: Center(
child: HelloWorldWidget(),
),
),
);
}
}
class HelloWorldWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'JOY ADHIKARY',
style: TextStyle(fontSize: 24),
),
SizedBox(height: 20), // Add some space between the text
and button
ElevatedButton(
onPressed: () {
// Display a SnackBar with "Hello World" message
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('Happy Puja')),
);
},
child: Text('Click Me'),
),
],
);
}
}
Scaffold Messenger of (context) is used to access the nearest
Scaffold Messenger widget in the widget tree, enabling the display
of a Snack Bar.

Snack Bar (content: Text ('Happy Puja')) creates a temporary


message popup with the text "Happy Puja."

Functionality: When this button is pressed, it displays a Snack


Bar with the message "Happy Puja" at the bottom of the screen.
This is a helpful way to give feedback to the user in response to
their action (clicking the button).
PROGRAM : 4
void main() => runApp(MyApp()); // Entry point of the app
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Multi-Text Example',
home: Scaffold(
appBar: AppBar(
title: Text('Multi-Text Example'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'JOY ADHIKARY is a Good Guy',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: Colors.blue,
),
),
SizedBox(height: 20),
Text(
'He loves Flutter Development',
style: TextStyle(
fontSize: 25,
fontStyle: FontStyle.italic,
color: Colors.green,
decoration: TextDecoration.underline,
),
),
SizedBox(height: 10),
Text(
'Learning is his passion!',
style: TextStyle(
fontSize: 20,
color: Colors.purple,
fontWeight: FontWeight.w500,
),
),
],
),
),
),
);
}
}
PROGRAM : 5
import 'package:flutter/material.dart';
void main() => runApp(MyApp()); // Entry point of the app
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Multi-Text Example with Button',
home: Scaffold(
appBar: AppBar(
title: Text('Multi-Text Example'),
),
body: Center(
child: Column( // Column arranges widgets vertically
mainAxisAlignment: MainAxisAlignment.center, //
Center vertically
children: [
Text(
'JOY ADHIKARY is a Good Guy',
style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
color: Colors.blue,
),
),
SizedBox(height: 20), // Adds spacing between texts
Text(
'He loves Flutter Development',
style: TextStyle(
fontSize: 25,
fontStyle: FontStyle.italic,
color: Colors.green,
decoration: TextDecoration.underline,
),
),
SizedBox(height: 20), // Adds more spacing
Text(
'Learning is his passion!',
style: TextStyle(
fontSize: 20,
color: Colors.purple,
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 30),
ElevatedButton(
onPressed: () {

ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Button Pressed! Keep Going, Joy!'),
),
);
},
child: Text('Click Me'),
),
],
),
),
),
);
}
}
❖ In Flutter, importing packages is essential for leveraging
libraries and tools to extend the functionality of your
application

Example: import 'package:http/http.dart' as http;


import 'package:provider/provider.dart';

❖ Dart Package: It is a general package, which is written in


the dart language, such as a path package. This package
can be used in both the environment, either it is a web or
mobile platform. It also contains some Flutter specific
functionality and thus has a dependency on the Flutter
framework, such as fluro package.
❖ Plugin Package: It is a specialized Dart package that
includes an API written in Dart code and depends on the
Flutter framework. It can be combined with a platform-
specific implementation for an underlying platform such as
Android (using Java or Kotlin), and iOS (using Objective C
or Swift). The example of this package is the battery and
image picker plugin package.

You might also like