Lesson: Storing Android Accelerometer Data: App DesignContributed by: IMPART RET Program, College of Information Science & Technology, University of Nebraska-Omaha
Educational Standards :
Pre-Req Knowledge (Return to Contents)
To conduct this lesson, the teacher must have a working knowledge of MIT's App Inventor software. This software enables users to create, simulate and build Android applications that can be used on Android devices. This lesson is ideal for a computer programming environment or a setting in which students want to push the envelope of the typical curriculum. Students are required to think logically and sequentially.
Learning Objectives (Return to Contents)
After this lesson, students should be able to:
Introduction/Motivation (Return to Contents)
(Be ready to show students a 12-minute online tutorial.)
In this lesson and its associated activity, you will get to do "real" engineering. Engineers use a cyclical design process to arrive at the best possible solution to a problem. You will plan what an Android application for a mobile device will do, decide what it looks like, decide how to structure the software, as well as test and edit to ensure the app works correctly.
The writing of applications for Android devices is commonplace in today's society. A growing number of "smart phones" have the capability to be much more than communication devices. In fact, these devices are really mini-computers. A user interface such as MIT's App Inventor can enable you to create your own applications for Android devices. This lesson is a specific use of the App Inventor software that lets you use one of the sensors in a smart phone, the accelerometer, to store collected data for later use. This lesson is far more than a computer science experiment or science lab. While the skills that you will learn through exploring and using App Inventor will be fun and educational, they also will provide you with the ability to use your own smart phone in unique ways.
We begin by exploring a user interface developed by MIT to create applications for Android devices. To learn about this application, named App Inventor, we will watch a tutorial on how the App Inventor software works and then explore the possibilities of the App Inventor software. In the activity that follows, you will write an app that stores persistent data in a database on the local device. Possible uses of the App Inventor tools will be the focus of a class discussion after watching the tutorial. (Show the App Inventor tutorial to the class by following the link: http://www.youtube.com/watch?v=Iq9KkAbhxQg.)
Now that we have viewed the tutorial, let's cover a few main points. (Ask students the following questions to stimulate a class discussion.)
Lesson Background & Concepts for Teachers (Return to Contents)
The focus of this lesson is not really about writing the app, although that is the measurable end product. The lesson is meant to allow students to gain experience with the engineering design process. Students are exposed to this process and implement it to solve the problem of writing a mobile Android application that measures a device's acceleration and stores that data for future use.
Introduce students to the engineering design process and the software development life cycle (or review these topics if students are already familiar with them). Figure 1 shows the software development life cycle; Figure 2 shows the steps of the engineering design process. Notice the similarities.
The software development life cycle begins with the requirement analysis phase, which can be compared to the identify the problem and identify criteria and constraints steps in the engineering design process. In both cases, this is the time when the project goal is identified. Questions such as "What am I trying to solve or create?", "What is the purpose?", "How should the end product function?", "What are my limitations?", "What materials can be used or are needed?" are answered at this stage.
Once the goal is clearly defined, as well as additional constraints or requirements, the next phase in the software development life cycle is design. This corresponds to the brainstorm possible solutions, generate ideas, explore possibilities, and select an approach steps in the engineering design process. At this point, research is often conducted to gather relevant information. Different ideas for designs are explored, and eventually the most promising design or solution is selected and refined. Specifically for software design, this phase may be focused on the development of a code or series of codes. In the associated activity, this includes first creating a pseudo code.
The next two phases in the software development life cycle are implementation and testing, which correspond to the build a model or prototype step in the engineering design process. At this point, the prototype or code, for example, is completed and tested.
The last phase in the software development life cycle is the evolution phase, which is comparable to the refine the design stage of the engineering design process. At this point, the results of the testing phase are analyzed and incorporated into the project. Based on the testing results, the cycle is repeated (an iteration) as many times as necessary to satisfy the overall project goal.
This lesson is designed for use in a programming or other technology class in which the focus is on students programming. It can be used as an experience with the App Inventor software to create a database that stores persistent data. In a follow-up lesson, Android Acceleration, students can utilize the applications that they create to explore the relationship between acceleration and velocity.
Refer students to the MIT App Inventor website (http://appinventor.mit.edu/explore/) for tutorials and curricula to work though to gain knowledge of how to use the App Inventor.
Tutorials for getting started, installing app inventor and practice projects: http://appinventor.mit.edu/explore/learn.html
Teacher curricula: http://appinventor.mit.edu/teach/
Vocabulary/Definitions (Return to Contents)
Associated Activities (Return to Contents)
Attachments (Return to Contents)
Assessment (Return to Contents)
Use the following prompts to have students write or discuss the topic.
Have students complete the writing prompt found on Storing Android Accelerometer Data: App Design Assessment. This worksheet presents students with a screenshot of sample App Inventor code that that controls two buttons. The prompt asks students to explain what happens when each button is clicked and how it works. Assign this post-lesson assessment after students have completed the associated Android App Development activity, as students work with the code displayed in the screenshot during the process of developing their apps.
ContributorsScott Burns, Brian Sandall
Copyright© 2013 by Regents of the University of Colorado; original © 2012 Board of Regents, University of Nebraska
Supporting Program (Return to Contents)IMPART RET Program, College of Information Science & Technology, University of Nebraska-Omaha
Acknowledgements (Return to Contents)
The contents of this digital library curriculum were developed as a part of the RET in Engineering and Computer Science Site on Infusing Mobile Platform Applied Research into Teaching (IMPART) Program at the University of Nebraska-Omaha under National Science Foundation RET grant number CNS 1201136. However, these contents do not necessarily represent the policies of the National Science Foundation, and you should not assume endorsement by the federal government.