logo

Crowdly

Browser

Add to Chrome

Mobile Device Programming (CS326/CSE5333/CS326n)

Looking for Mobile Device Programming (CS326/CSE5333/CS326n) test answers and solutions? Browse our comprehensive collection of verified answers for Mobile Device Programming (CS326/CSE5333/CS326n) at e-learning.msa.edu.eg.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

(Code Examination)

Examine the following Flutter code for navigating between pages. Identify any issues and suggest improvements for managing data passed between pages.

 

 

Navigator.push(

  context,

  MaterialPageRoute(

    builder: (context) => SecondPage(data: 'Hello, Second Page!'),

  ),

);

 

// In SecondPage:

Navigator.pop(context, 'Hello, First Page!');

View this question

(Code Examination)

Evaluate the correctness of the following Flutter code for saving a user's details to Firestore. Does it handle error cases properly? Suggest improvements.

 

 

Future<void> saveUserDetails(Map<String, dynamic> userDetails) async {

  final userCollection = FirebaseFirestore.instance.collection('users');

  try {

    await userCollection.doc(userDetails['id']).set(userDetails);

    print('User details saved successfully');

  } catch (e) {

    print('Error saving user details: $e');

  }

}

View this question

(Create)

Create a Flutter application that uses a ListView to display a list of items fetched from a REST API. Include a RefreshIndicator to reload the list.

View this question

(Design)

Design a Flutter interface with a TextField for entering a username and a Text widget to display the entered username in real-time below it.

View this question

(Create)

Create a Flutter UI that displays a map with the current user's location. Include a button that, when clicked, re-centers the map on the user's updated location.

View this question

Given the following code, identify the day that will be printed if day is 5.

 

 

void main() {

  int day = 5;

  switch (day) {

    case 1:

      print("Monday");

      break;

    case 2:

      print("Tuesday");

      break;

    case 3:

      print("Wednesday");

      break;

    case 4:

      print("Thursday");

      break;

    case 5:

      print("Friday");

      break;

    default:

      print("Invalid day");

  }

}

View this question

(Code Examination)

Analyze the following Flutter code snippet. What happens if the onPressed method is invoked multiple times? Is there a risk of overwriting data?

 

 

ElevatedButton(

  onPressed: () async {

    final file = File('/storage/emulated/0/notes.txt');

    await file.writeAsString('This is a note.');

  },

  child: Text('Save Note'),

);

View this question

Write a  function that calculates the sum of all even numbers in a list.

 

View this question

(Create)

Design a Flutter application that includes a toggle switch for enabling or disabling Bluetooth. When Bluetooth is enabled, display a list of paired devices.

View this question

Create a  function that checks if a number is prime. Return true if it is prime, false otherwise.

  bool isPrime(int num) {

  if (num <= 1) return false;

  for (int i = 2; i <= num ~/ 2; i++) {

    if (num % i == 0) return false;

  }

  return true;

}

Example Usage:

 

 

void main() {

  print(isPrime(7)); // Output: true

  print(isPrime(10)); // Output: false

}

View this question

Want instant access to all verified answers on e-learning.msa.edu.eg?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome