MAD 2023/2024 (Regular) (NEP) Solved Question Paper Mobile Application Development

Time: 2 Hrs | Max. Marks: 60

Section - A

I. Answer any TEN questions of the following. (2x10=20)

1. What is Mobile App Development?

Mobile app development is the process of creating software applications that run on mobile devices like smartphones and tablets. It involves designing, coding, testing, and deploying apps for platforms like Android and iOS.

2. Define Flutter SDK.

Flutter SDK is an open-source UI toolkit developed by Google for building natively compiled applications for mobile, web, and desktop from a single codebase using the Dart programming language.

3. List the data types.
  • int (integer)

  • double (floating point)

  • String (text)

  • bool (Boolean)

  • List (array)

  • Map (key-value pairs)

4. Define Constructors.

A constructor is a special method in a class that is automatically called when an object is created. It is used to initialize the object’s properties.

5. What do you mean by Widget?

In Flutter, a widget is a basic building block of the user interface. Everything in Flutter is a widget, including buttons, text, images, and layout structures.

6. Define Gestures.

Gestures are actions or interactions made by the user on the screen, like tapping, swiping, or pinching, which the app can detect and respond to.

7. What is Tap and Double Tap?

Tap is a quick touch on the screen, while double tap means two quick taps in succession. Both are common gesture inputs in mobile apps.

8. Differentiate between radio button and check box.
  • Radio Button: Allows selecting only one option from a group.

  • Check Box: Allows selecting multiple options at once.

Or
Radio ButtonCheck Box
Allows only one selection from a group.Allows multiple selections.
Used for mutually exclusive options.Used for independent options.
9. State the benefits of Dart Packages.

Dart packages provide reusable libraries or tools that help developers add features like state management, networking, or animations easily without writing code from scratch.

10. Define SQLite.

SQLite is a lightweight, open-source database that is embedded within the application and used to store structured data locally on the device.

11. What do you mean by Testing?

Testing is the process of checking if the app works correctly, is free of bugs, and performs as expected. It includes unit tests, integration tests, and UI tests.

12. Mention the looping statements.

Common looping statements include:

  • for loop

  • while loop

  • do-while loop

Section - B

Answer any FOUR from the following, each carries 5 marks. (4x5=20)

13. Explain the core components of Mobile Application and their roles in development.
  • User Interface (UI): Defines the visual layout and elements that users interact with, such as buttons, text fields, and images.

  • Backend/Server: Manages data storage, authentication, and server-side logic.

  • Database: Stores data locally (e.g., SQLite) or remotely (e.g., Firebase).

  • Application Logic: Contains the code that defines how the app functions and responds to user input.

  • APIs: Allow communication between the app and external services for features like payment gateways, maps, or data access.

14. Explain Flow Control Statements with an example.

1. Looping Statements (Repetition)

(a) for Loop
for (int i = 1; i <= 5; i++) {
  print("Count: $i"); // Prints 1, 2, 3, 4, 5
}
(b) while Loop
int i = 1;
while (i <= 3) {
  print("Number: $i"); // Prints 1, 2, 3
  i++;
}
(c) do-while Loop
int i = 5;
do {
  print("Value: $i"); // Prints 5 (even though condition is false)
  i++;
} while (i < 5);

2. Conditional Statements (Decision Making)

(a) if-else Statement
int age = 20;
if (age >= 18) {
  print("You are an adult."); // This will execute
} else {
  print("You are a minor.");
}
(b) else-if Ladder
int marks = 75;
if (marks >= 90) {
  print("Grade: A");
} else if (marks >= 80) {
  print("Grade: B");
} else if (marks >= 70) {
  print("Grade: C"); // This will execute
} else {
  print("Grade: D");
}
(c) switch-case Statement
String day = "Monday";
switch (day) {
  case "Monday":
    print("Start of the week!"); // This will execute
    break;
  case "Friday":
    print("Weekend is near!");
    break;
  default:
    print("Regular day");
}

3. Jump Statements (Control Transfer)

(a) break
for (int i = 1; i <= 10; i++) {
  if (i == 5) break; // Stops at 4
  print(i); // Prints 1, 2, 3, 4
}
(b) continue
for (int i = 1; i <= 5; i++) {
  if (i == 3) continue; // Skips 3
  print(i); // Prints 1, 2, 4, 5
}
Or

Flow control statements control the execution order of the program based on conditions.

Types include:

  • if / else if / else: Executes blocks of code based on boolean conditions.

  • switch: Selects a block of code to execute based on a value.

  • for, while, do-while: Used for looping.

Example (Dart):

int number = 10;
if (number > 0) 
{ print("Positive"); }
else
{ print("Non-positive"); }
15. Define Scaffold. Explain its properties.

A Scaffold in Flutter is a layout structure used to create a basic visual interface. It provides standard UI components such as the app bar, floating action button, drawer, etc.

Important properties:

  • appBar: A top bar displaying the title or navigation actions.

  • body: The main content area of the screen.

  • drawer: A side navigation panel.

  • floatingActionButton: A circular button typically used for primary actions.

  • bottomNavigationBar: Navigation bar placed at the bottom of the screen.

Example:

Scaffold(
  appBar: AppBar(title: Text("My App")),
  body: Center(child: Text("Hello")),
)
16. Explain the types of dialogues in Flutter.

Flutter provides several types of dialogs for user interaction:

  1. AlertDialog: Shows simple messages, with optional buttons (e.g., OK, Cancel).

  2. SimpleDialog: Used for showing options in a dialog box.

  3. BottomSheet: Slides from the bottom of the screen and is used for non-critical user choices or menus.

  4. CupertinoDialog: It is a Flutter widget that creates a customizable dialog with iOS-style design. 

Examples: (Codes)

1. AlertDialog
showDialog(
  context: context,
  builder: (ctx) => AlertDialog(
    title: Text("Alert"),
    content: Text("Do you want to exit?"),
    actions: [
      TextButton(onPressed: () {}, child: Text("No")),
      TextButton(onPressed: () {}, child: Text("Yes")),
    ],
  ),
);
2. SimpleDialog
showDialog(
  context: context,
  builder: (ctx) => SimpleDialog(
    title: Text("Choose Option"),
    children: [
      SimpleDialogOption(child: Text("Option 1")),
      SimpleDialogOption(child: Text("Option 2")),
    ],
  ),
);
3. BottomSheet
showModalBottomSheet(
  context: context,
  builder: (ctx) => Container(child: Text("Bottom Sheet")),
);
4. CupertinoDialog (iOS-style)
showCupertinoDialog(
  context: context,
  builder: (ctx) => CupertinoAlertDialog(
    title: Text("iOS Alert"),
    actions: [CupertinoButton(child: Text("OK"), onPressed: () {})],
  ),
);
17. Discuss in brief Dart packages.

Dart packages are libraries that help developers extend the functionality of their Flutter or Dart applications.

Benefits and features:

  • Reusable code modules for common features like HTTP requests, image loading, state management, etc.

  • Available through pub.dev, Dart’s official package repository.

  • Can be easily integrated using the pubspec.yaml file.

Types of Dart packages:

  1. Plugin packages – Interact with native code (e.g., camera, GPS).

  2. Pure Dart packages – Written only in Dart, platform-independent.

Example packages:

  • http: For making API requests.

  • provider: For state management.

  • shared_preferences: For storing data locally.

Section - C

Answer any TWO from the following, each carries 10 marks. (2x10=20)

18. a) Describe the process of creating the new project on Flutlab.io and write a simple Hello World application.
  1. Visit Flutlab.io: Open a web browser and go to https://flutlab.io.

  2. Sign In/Register: Log in using your Google account or create a new account.

  3. Create a New Project:

    • Click on “New Project”.

    • Choose a template like “Empty”, “Starter”, or “Full App”.

    • Enter a project name and click Create.

  4. Edit Main File:

    • Navigate to lib/main.dart.

    • Replace or edit the code to write your application.

  5. Run the Project:

    • Click Run (Play icon) to build and view the app in the Flutlab emulator.

Example: (write a simple Hello World application)

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Hello World')),
        body: Center(child: Text('Hello Flutlab!')),
      ),
    );
  }
}
18. b) Arrow Function Constructors

Arrow function constructors are a shorthand way of defining functions or constructors in Dart when the function has a single expression.

Syntax:

ClassName(this.property);

ClassName.namedConstructor() : property = value;

Example:

class Person {
String name;

// Arrow function constructor
Person(this.name);

void greet() => print("Hello, my name is $name");
}
19. a) Explain in depth layout widgets with examples

In Flutter, layout widgets help define the structure and positioning of UI elements on the screen. They are used to organize the visual elements.

Common Layout Widgets:

  1. Column & Row – Align widgets vertically or horizontally.

     
    Column(
      children: [
        Text("Title"),
        Text("Subtitle"),
      ],
    );
    
  2. Container – A box model with padding, margin, border, and color.

    Container(
      padding: EdgeInsets.all(16),
      color: Colors.blue,
      child: Text("Hello"),
    );
    
  3. Center – Centers the child widget within its parent.

     
    Center(child: Text("Centered Text"))
    
  4. Expanded & Flexible – Used in Rows/Columns to manage space.

     
    Row(
      children: [
        Expanded(child: Text("Left")),
        Expanded(child: Text("Right")),
      ],
    );
    
  5. Stack – Allows overlapping of widgets.

     
    Stack(
      children: [
        Container(color: Colors.blue),
        Positioned(child: Text("Overlay"), top: 10),
      ],
    );
19. b) Explain Flutter Navigation and Routing

Flutter provides powerful tools for navigation and routing, enabling users to move between screens (also called routes). This is essential for creating multi-page apps like login screens, dashboards, forms, and more.

  1. Navigation is the process of transitioning from one screen (widget) to another.
  2. Routing is the mechanism of mapping route names (like "/home" or "/login") to specific widget screens in your app.

Types of Navigation in Flutter:

1. Imperative (Manual) Navigation using Navigator:Uses Navigator class methods like push(), pop(), etc.

2. Named Routing (Declarative Navigation): Define routes with string names in the MaterialApp widget.

Benefits of Flutter Navigation and Routing:

  • Organized management of multiple screens

  • Supports deep linking and argument passing

  • Works well with state management libraries

  • Easy to customize with animations and transitions

20. Explain SQLite DB Provider object and its method?

SQLite is a lightweight, open-source, embedded SQL database engine used in mobile applications for local storage. In Flutter, the sqflite package is commonly used to work with SQLite databases.

A DB Provider Object is a singleton class in Flutter that manages the entire database connection. It ensures:

  • Only one instance of the database is open

  • Efficient and consistent access to the database

  • Centralized control of CRUD (Create, Read, Update, Delete) operations

Structure of a DB Provider:

A typical DB Provider contains:

  1. Database initialization

  2. Table creation

  3. Singleton pattern setup

  4. CRUD operation methods

Common DB Methods:

1. Insert Data

Future<void> insertUser(Map<String, dynamic> user) async {
  final db = await database;
  await db.insert('users', user);
}

2. Read (Query) Data

Future<List<Map<String, dynamic>>> getUsers() async {
  final db = await database;
  return await db.query('users');
}

3. Update Data

Future<void> updateUser(Map<String, dynamic> user) async {
  final db = await database;
  await db.update('users', user, where: 'id = ?', whereArgs: [user['id']]);
}

4. Delete Data

Future<void> deleteUser(int id) async {
  final db = await database;
  await db.delete('users', where: 'id = ?', whereArgs: [id]);
}

Example:

class DatabaseProvider {
  Database? _database;

  Future<Database> get database async {
    if (_database != null) return _database!;
    _database = await _initDB();
    return _database!;
  }

  Future<Database> _initDB() async {
    return openDatabase(
      join(await getDatabasesPath(), 'app_db.db'),
      onCreate: (db, version) {
        return db.execute('''
          CREATE TABLE users(
            id INTEGER PRIMARY KEY,
            name TEXT,
            email TEXT
          )
        ''');
      },
      version: 1,
    );
  }
}

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    error: Content is protected !!