Dart Programming Fundamentals

MonumentalParallelism avatar
MonumentalParallelism
·
·
Download

Start Quiz

Study Flashcards

30 Questions

What happens to the future when an asynchronous operation performed by a function fails?

It is completed with an error

Where can the await keyword be used?

Only in async functions

What triggers the redraw of the UI when using setState()?

Setting properties of the state object

What is the relationship between the UI and the state of an application in Flutter?

UI = f(state)

Which type of state is also called a shared state?

App State

What is the purpose of State Management in the lifecycle of an application?

To manage the state of the app

What is the primary purpose of using the SharedPreferences API?

To save and retrieve persistent key-value pairs of primitive data

What plugin is used to store key-value data on disk?

SQLite plugin

What is the limitation of using the SharedPreferences plugin?

It can only save primitive types

What is the purpose of using the PathProvider plugin?

To access the device's file system

What is the primary purpose of using the HTTP package in Flutter?

To enable networking in Flutter

What is the process of converting an object to a string called?

Serialization

What is the primary purpose of the WorkManager plugin in Dart?

To facilitate persistent background processing

What is the main difference between internal storage and shared storage in Android?

Internal storage is used for app-specific data, while shared storage is used for data shared with other apps

What is the purpose of an isolate in Dart's multithreading model?

To create a separate thread that doesn't share memory with the main program

Which region dominated the mobile market and accounted for over 32.0% of the revenue share in 2023?

Asia Pacific

What happens to files stored in internal storage when the app is uninstalled?

They are removed

What is a factor that drives the mobile application market?

Increase in Internet penetration

What is data persistence in the context of Android app development?

The ability to have data available regardless of changes to the app's state

What is an example of Mobile Analytics?

Funnel Analysis

What is a type of Mobile Analytics?

Mobile Advertising

What is the purpose of the MediaStoreAPI in Android?

To access and manage shared files such as media and documents

What is a Key Mobile Metric?

Mobile Downloads

What is a future trend in Mobile Application Development?

5G - always striving for better, faster connection

What is the purpose of Integration Testing?

To simulate or mock the real environment to find bugs early

What is Test-Driven Development (TDD) approach?

Writing tests before writing the actual code

What is the purpose of a Keystore?

To verify the ownership of an application by providing a digital signature

What is the command to generate a Keystore?

keytool -genkey -v -keystore %userprofile%\upload-keystore.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias upload

What is an Android Application Bundle (AAB)?

A publishing format that includes all the app’s compiled code and resources

What is the purpose of the flutter build appbundle command?

To build an Android App Bundle (AAB)

Study Notes

Asynchronous Programming

  • Future or Future is completed with an error if an asynchronous operation performed by the function fails.
  • To define an async function, add async before the function body.
  • Await keyword works only in async functions.
  • Handling errors can be done using try-catch.

State Management

  • State is information that can be read when the widget is built and changed over the lifetime of the app.
  • setState() allows us to set the properties of the state object that triggers the redraw of the UI.
  • The state of an app is everything that exists in memory when the app is running, including app’s assets, variables, UI, animation state, textures, and fonts.
  • State management is the most popular and necessary process in the lifecycle of an application.
  • Flutter is declarative, it builds its user interface to reflect the current state of your application.
  • UI = f(state)

Types of Conceptual States

  • Ephemeral State: also called the UI state or local state, contained in a single widget, no need to use state management techniques.
  • App State: shared state, used to share across many parts of the app, can be stored in Preferences, Files, or Databases.

Data Persistence in Flutter

  • Using SQLite: store structure data in a private database, uses SQL statements.
  • Read and Write files: use the pathprovider to access commonly used locations on the device’s file system.
  • Store key-value data: use the sharepreferences plugin, limitations include only saving primitive types.

Flutter Networking

  • Use the HTTP package to make HTTP requests.
  • In the Android Manifest, include permission for INTERNET.

JSON and Serialization

  • Serialization: converting an object to a string.
  • Deserialization: converting a string to an object.
  • Manual serialization: coding it manually.
  • Code generation libraries: used for serialization.

Background Process

  • Implementing Dart code, even though the app is not currently an active app.
  • Examples: Notifications, Sensors.
  • Isolates: Dart’s model for multithreading, used by creating callbacks and callback dispatchers.
  • WorkManager Plugin: enables persistent background processing that keeps tasks scheduled through app restarts and system reboots.

Data Persistence and Networking

  • Data Persistence: the capability to have data that the app uses or relies on to continue to be available regardless of changes to the app’s state.
  • Different types of persistent data in Android: App-specific storage, Shared storage, Preferences, Databases, Network Connection.

Mobile Analytics

  • Measuring and analyzing data generated by mobile platforms and properties.
  • Examples: Advertising KPIs, Funnel Analysis, App performance and usage, Heatmaps, Retention rates, Click-through rates, Conversion rates, Response rates to push notifications and marketing campaigns.
  • Types of Mobile Analytics: Mobile Advertising, App monetization, Performance analysis, In-app engagement, Mobile analytics for product teams, Mobile analytics for marketing teams, Mobile analytics for UI/UX teams, Mobile analytics for technical teams.

Key Mobile Metrics

  • Mobile Downloads
  • Uninstalls
  • Heatmaps and user session recreations
  • Session length and depth
  • Retention Rate
  • Churn Rate
  • Sessions
  • Session Intervals

Future of Mobile Application Development

  • 5G: always striving for better, faster connection
  • AR and VR: moving beyond gaming
  • AI: everywhere
  • Blockchain: beyond cryptocurrency
  • Wearables: more sophisticated
  • Security

This quiz covers the basics of Dart programming, including asynchronous operations, error handling, and state management in Flutter apps.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free

More Quizzes Like This

Use Quizgecko on...
Browser
Browser