Back to homeAP® Computer Science Principles · AP Computer Science Principles · Change subject
Start for free
AP CSP · AP® Computer Science Principles
Digital content creation · Simple creation and programming

Simple apps for mobile and web

Behind every app you use on your cell phone, from a ride-share app to a streaming service, there was first an idea, then an algorithm on paper, then the program, and finally lots of testing before it went on the Apple App Store or Google Play. Why did the app on your phone not crash the first time you used it? Creating a simple app, such as a converter, a counter or a quiz, brings together everything you already know about algorithms and blocks. You will also see the difference between an app's purpose (the problem it solves) and its function (what it does).

From the idea to the published app

Two words matter here. The purpose of an app is the problem it solves for people (for example, "help me split a bill"). Its function is what it actually does (reads the bill, multiplies, displays the tip). Apps are also event-driven: they wait for an event, such as a tap on a button, and then run code. Developers build apps in small steps, test them with real users, collect feedback, and add comments in the code (program documentation) so teammates understand it.

The stages of creating an app, each illustrated with an icon: light bulb (idea), prototype screens (design), flowchart (algorithm), code window (programming), phone with unusual data, magnifying glass and bug (testing) and cloud with an upward arrow (publication). #@9 1 · Idea 2 · Design 3 · Algorithm 4 · Programming 5 · Testing 6 · Publication

Back to the beginning: the app on your phone works smoothly because developers tested it again and again with unusual data before publishing.

Practice★☆☆Not started
List the stages involved in creating an app, from the idea until it is used by others, and explain what each stage consists of. Explain why it is not advisable to skip…

List the stages involved in creating an app, from the idea until it is used by others, and explain what each stage consists of. Explain why it is not advisable to skip the testing phase even if the program seems to work.

Solve
Practice★☆☆Not started
Before programming, it is useful to draw the prototype on paper. Describe (or draw in your notebook) the three screens of a "water glass counter" app: the main screen…

Before programming, it is useful to draw the prototype on paper. Describe (or draw in your notebook) the three screens of a "water glass counter" app: the main screen with the counter, the button to add a glass, and a history screen, indicating what each button does.

You can do it on paper and send a photo with your answer.

Solve

Input, process and output in an app

Block diagram with the data flow of an app: user input, algorithm process and result output. km → miles converter 10 km Convert 6.25 miles input: 10 km process: 10 ÷ 1.6 output: 6.25 miles
Practice★☆☆Not started
An app calculates the recommended tip at a restaurant based on the bill amount. Identify what data the user inputs (input), what the app does with it (process), and what…

An app calculates the recommended tip at a restaurant based on the bill amount. Identify what data the user inputs (input), what the app does with it (process), and what it displays at the end (output), following the scheme input → process → output.

Solve
Practice★☆☆Not started
The figure shows the screen design of an app that converts distances from kilometers to miles, knowing that $1\ \text{milla}$ is equivalent to $1.6\ \text{km}$. Write…

The figure shows the screen design of an app that converts distances from kilometers to miles, knowing that $1\ \text{milla}$ is equivalent to $1.6\ \text{km}$.

Converter km → miles kilometers Convert miles: ?

Write the steps that the app must follow when the user presses the button to display the result, and state what should happen if the user presses "Convert" without entering any number.

Solve
Practice★☆☆Not started
A very simple app receives a text and returns it written in capital letters. Analyze its input → process → output scheme and suggest two real uses such an app could have…

A very simple app receives a text and returns it written in capital letters. Analyze its input → process → output scheme and suggest two real uses such an app could have within a larger one.

Solve
Practice★★☆Not started
Describe the algorithm for a quiz app with five questions: how the score is saved, what happens when the user gets a question right or wrong, how to move on to the next…

Describe the algorithm for a quiz app with five questions: how the score is saved, what happens when the user gets a question right or wrong, how to move on to the next question, and what is displayed at the end. Use numbered steps with decisions and a loop.

Solve
Practice★★☆Not started
An app that calculates the average of grades gives absurd results when a box is left empty or when someone enters a grade of 42. Explain what invalid input data is,…

An app that calculates the average of grades gives absurd results when a box is left empty or when someone enters a grade of 42. Explain what invalid input data is, propose two checks the app should make before calculating, and describe the tests you would carry out to check that it no longer fails.

Solve
Practice★★★Not started
Unit challenge. Your mission is to create a prototype of an interactive app that recommends to your neighbors how to dress and whether they need an umbrella based on the…

Unit challenge. Your mission is to create a prototype of an interactive app that recommends to your neighbors how to dress and whether they need an umbrella based on the official weather forecast.

  1. Real data collection: Check the National Weather Service (weather.gov) website for tomorrow's forecast in your city and record the maximum temperature ($T_{\text{max}}$ in ºC) and the probability of precipitation ($P$ in %) in a data table.

  2. Computational thinking: Design a flowchart with logical conditionals (for example, if $T_{\text{max}} < 16.5\text{ ºC}$ or if $P \ge 50\,\%$) to determine which tips to show.

  3. Block-based programming: Implement your prototype in Scratch or App Inventor. The app must ask for both numerical values and display an appropriate graphic message based on the evaluated conditions.

  4. Final report: Prepare a brief report (one page) with a screenshot of the flowchart, the table with the real data from the National Weather Service, the public link to your program, and a test run.

Evaluation criteria:

  • Logical correctness of the flowchart and proper use of conditionals.

  • Interactive, error-free operation of the block code with the entered data.

  • Intuitive and clear user interface design.

  • Quality of the brief report and justification of the decisions made.

Solve

Screens, elements and prototypes

Paper prototype of the water-glass counter app: main screen with a label and two buttons, and a history screen that the History button leads to. Glasses today 3 +1 glass History History Monday: 6Tuesday: 8Wednesday: 7 label button

Good design: accessibility, notifications and onboarding

Accessible apps work for more people. Use large buttons with space between them (helps people with motor difficulties), high contrast between text and background (helps low vision), and text or icons in addition to color (helps color-blind users).

Notifications should be useful and rare: send what the user asked for (a due date reminder) and let them choose which ones to turn on. Too many notifications make people uninstall the app.

Onboarding is the short set of screens shown the first time the app opens. Each screen teaches one thing, and a "Skip" button respects users who already know how to use it.

Practice★☆☆Not started
App screens are built using basic elements: buttons, text labels, input fields, and images. Explain the purpose of each of these four elements and give an example of…

App screens are built using basic elements: buttons, text labels, input fields, and images. Explain the purpose of each of these four elements and give an example of each in an app you use often.

Solve
Practice★☆☆Not started
Before installing an app from the app store, it is advisable to check several details. Explain what the ratings, the number of downloads, the requested permissions, and…

Before installing an app from the app store, it is advisable to check several details. Explain what the ratings, the number of downloads, the requested permissions, and the developer's name tell you, and what combination of these details would make you suspicious.

Solve
Practice★☆☆Not started
Apps are updated periodically. Explain two reasons why it is advisable to keep them updated and one risk of failing to do so, and explain why an update sometimes changes…

Apps are updated periodically. Explain two reasons why it is advisable to keep them updated and one risk of failing to do so, and explain why an update sometimes changes features you liked.

Solve
Practice★★☆Not started
Notifications alert users to updates, but too many notifications make the user uninstall the app. Design the notification policy for the classroom reading app: which…

Notifications alert users to updates, but too many notifications make the user uninstall the app. Design the notification policy for the classroom reading app: which three notifications you would send, which notifications you would not, and what configuration options you would allow the user.

Solve
Practice★★☆Not started
Evaluate the accessibility of this app screen: small buttons very close together, light gray text on a white background, and all information in color only (without…

Evaluate the accessibility of this app screen: small buttons very close together, light gray text on a white background, and all information in color only (without text). Suggest three specific improvements and explain which users each one benefits.

Solve
Practice★★★Not started
Onboarding consists of the screens that guide users through the app the first time it is opened. Design a three-screen onboarding process for the school cafeteria app:…

Onboarding consists of the screens that guide users through the app the first time it is opened. Design a three-screen onboarding process for the school cafeteria app: what each screen shows, what the user learns on each one, and why there should be a 'skip' button.

Solve

Connection, storage and permissions

Three phones compared: a calculator that works without a connection, a weather app that shows data saved in the device's cache and a maps app that receives live traffic from the internet. no connection calculator partial weather (cache) needs network live maps
Practice★★☆Not started
Some apps work without an internet connection and others cannot do anything without it. Explain the difference between the two types and classify these apps, giving…

Some apps work without an internet connection and others cannot do anything without it. Explain the difference between the two types and classify these apps, giving reasons for your answer: a calculator, maps with live traffic, an already downloaded quiz, and a messaging app.

Solve
Practice★★☆Not started
A game remembers your level, your coins, and your high score even if you close the app. Explain what local storage of an app is, what data that game saves, and explain…

A game remembers your level, your coins, and your high score even if you close the app. Explain what local storage of an app is, what data that game saves, and explain what will happen to them if you uninstall the app or change cell phones without a backup.

Solve
Practice★★☆Not started
A weather app works partly offline: it displays the last downloaded forecast, but does not update it. Explain which parts of an app can continue to work without internet…

A weather app works partly offline: it displays the last downloaded forecast, but does not update it. Explain which parts of an app can continue to work without internet and design the "offline" message the user would see: what it should say and what options it should offer.

Solve
Practice★★★Not started
A flashlight app requests permission to access contacts, location, and the microphone. Analyze whether these permissions are necessary for its function, what risks…

A flashlight app requests permission to access contacts, location, and the microphone. Analyze whether these permissions are necessary for its function, what risks granting them without thinking entails, and draft a three-question criterion to decide which permissions to accept in any app.

Solve
Practice★★★Not started
Applying the idea of "privacy by design," define what minimum data a classroom task app would actually require to work, what data it would NOT request even if it "could…

Applying the idea of "privacy by design," define what minimum data a classroom task app would actually require to work, what data it would NOT request even if it "could be useful," and how you would explain those decisions to users on the app store listing page.

Solve

Privacy by design

Good developers collect only the data the app needs to work (data minimization) and explain it clearly. For a class homework app, the minimum might be the assignment title and due date. Location, contacts, and the microphone are not needed, even if they "could be useful". Under US laws like COPPA (children under 13) and FERPA (school records), schools are especially careful. A good app store listing says what is collected and why.

Publishing, trusting and making money with an app

Three phones showing the ways of making money with an app: free with ads, paid and with in-app purchases. Ad $2.99 $0.99 free with ads paid purchases inside the app
Practice★★☆Not started
Some apps are first downloaded as a "beta version" for a small group of users. Explain what that label means, what advantages testing this way before the official launch…

Some apps are first downloaded as a "beta version" for a small group of users. Explain what that label means, what advantages testing this way before the official launch has, and what two things you should expect from a beta (and not get angry when they happen).

Solve
Practice★★★Not started
Design a complete app called 'Reading Challenges' for the class to log the books they read: screens it would have, input and output data for each one, main algorithm,…

Design a complete app called 'Reading Challenges' for the class to log the books they read: screens it would have, input and output data for each one, main algorithm, and three specific tests you would perform before publishing it.

Solve
Practice★★★Not started
Your team has programmed an app to organize recess sports tournaments. A classmate proposes funding it by inserting ads from a commercial network and charging 0.99…

Your team has programmed an app to organize recess sports tournaments. A classmate proposes funding it by inserting ads from a commercial network and charging 0.99 dollars through in-app purchases to unlock advanced statistics. Justify two legal or ethical issues with this model when applied in a school setting with minors. Then, design an alternative model to sustain and maintain the app without resorting to invasive advertising or payments that discriminate against some of the students.

Solve
Practice★★★Not started
You are going to download an app to calculate grades and you find "SuperGrades". In the app store, you notice the following data: Average rating: 4.9 ★ with 2,500…

You are going to download an app to calculate grades and you find "SuperGrades". In the app store, you notice the following data:

  • Average rating: 4.9 ★ with 2,500 reviews.

  • Dates and text: 90% of the 5 ★ ratings were published over just three consecutive days, with identical text ("Excellent app") and profiles without pictures.

  • Required permissions: Access to contact list, precise location, and microphone.

Interpret this data: explain what fraudulent practice is taking place and what goal it pursues. Next, predict what risks someone assumes by installing it guided only by the average rating, and write two mandatory checks that must always be performed before installing an unfamiliar app.

Solve

Summary

See all the exercises in this section