CIS 694/EEC 693 Android Sensor Programming

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
KJOlinski.com - RapidHMI INTRODUCING RapidHMI AND PLCExplorer.
Author: Loh Jianxiong Christopher Editors: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang.
CPSC1301 Computer Science 1 Overview of Dr. Java.
Active-HDL Interfaces Debugging C Code Course 10.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Chapter Two Creating a First Project in Visual Basic.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Introduction to Eclipse Programming with an Integrated Development Environment.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
Intro to. Windows – Mac – osx
1 Using an Integrated Development Environment. Integrated Development Environments An Integrated Development Environment, or IDE, permits you to edit,
Debugging with Eclipse
EEC-693/793 Applied Computer Vision with Depth Cameras
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Development Environment
Chapter 2: The Visual Studio .NET Development Environment
Programming and Debugging with the Dragon and JTAG
ME 142 Engineering Computation I
How to debug an application
EEC-693/793 Applied Computer Vision with Depth Cameras
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Debugging Dwight Deugo
Eclipse Navigation & Usage.
Computer Programming I
1. Introduction to Visual Basic
 Firstly you need to press the “Windows” key, and then simply enter “Google Chrome” that will bring up the search option. Here you need to right-click.
3.01 Apply Controls Associated With Visual Studio Form
Tutorial 1 – Creating a Document
Scripts & Functions Scripts and functions are contained in .m-files
CIS 470 Mobile App Development
Using Visual Studio with C#
Important terms Black-box testing White-box testing Regression testing
EEC-693/793 Applied Computer Vision with Depth Cameras
DEBUGGING.
Important terms Black-box testing White-box testing Regression testing
Debugging with Eclipse
CIS 470 Mobile App Development
Social Media And Global Computing Introduction to Visual Studio
NORMA Lab. 7 Generating Reports More Display Options
Chapter 2 – Introduction to the Visual Studio .NET IDE
CIS 470 Mobile App Development
Understanding the Visual IDE
1. Open Visual Studio 2008.
Tonga Institute of Higher Education
Getting Started: Developing Code with Cloud9
Testing, debugging, and using support libraries
Creating Your First C Program Using Visual Studio 2010
CSC235 - Visual Studio Tutorial
Download and Installation of code::blocks
Creating Your First C Program Using Visual Studio 2010
CIS 470 Mobile App Development
Debugging Visual Basic Programs
CIS 493/EEC 492 Android Sensor Programming
CIS 470 Mobile App Development
jGRASP editor-syncrasies (idiosyncrasies)
KEYBOARD and IMPORTANT KEYS
Debugging Dwight Deugo
EEC-693/793 Applied Computer Vision with Depth Cameras
Debugging with Eclipse
Visual Studio Code Walkthrough
Workshop for Programming And Systems Management Teachers
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

CIS 694/EEC 693 Android Sensor Programming Lecture 2 Wenbing Zhao Department of Electrical Engineering and Computer Science Cleveland State University w.zhao1@csuohio.edu 11/6/2019 CIS 470: Mobile App Development

Using Android Studio for Android Development How to move around in the Integrated Development Environment (IDE) How to use code completion to make writing applications easier How to use breakpoints to debug your applications 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Exploring the IDE Open the IDE Start a new project Select options Project view Android monitor 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Give the project name: IDEExplorer; use whatever domain name you like 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development The default option is Empty Activity. This is the most useful for our examples because it creates a basic activity for you, with no code in it 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development It is accepted practice in Android development to name your main activity—that is, the Activity that is loaded on startup by your application—as MainActivity The startup layout, that is the layout for the screen elements that will be displayed when your application is started by the user, is the activity_main layout. All other layouts should be named according to the activity that they support (activity_input, activity_delete) Click the Finish button to finish creating the project and jump into exploring the IDE 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development The Android Studio IDE 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development The left side of the IDE shows the Project window. The Project window enables you to quickly navigate the files within your project. 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development On the right side of the IDE are the Editor tabs. The Editor tabs are where you write and work with your code files. 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development To work on a new file, simply locate the file in the Project window and double-click it to open a new Editor tab that contains that file’s code. If you need to create a new file from scratch, right-click the directory into which you want to place your file, and select New ➪ <File Type> from the context menu. At the bottom of the IDE, you should see a button labeled LogCat. Logcat displays most of the helpful messages that are output by your application while you are trying to debug it. 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Using Code Completion Code completion: a tool that shows contextual options for completing the piece of code that you are trying to write Example: In the editor tab for the MainActivity.java file, locate the line that reads setContentView(R.layout.activity_main); Place your cursor after this line and press the Enter key. On the new line, type the letter R, and then type a period, as shown here: R. Android Studio Code Completion should display a list of values that you could use to try to complete the code statement 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Code completion example If the code completion window does not open, press Ctrl+Space to force it to open. 11/6/2019 CIS 470 Mobile App Development

Debugging Your Application Common way to debug: set breakpoints to help you find what is going on with your code Breakpoints are a mechanism by which you can tell Android Studio to temporarily pause execution of your code, which allows you to examine the condition of your application You can check on the values of variables in your application while you are debugging it You can check whether certain lines of code are being executed as expected—or at all 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Click the margin of the editor tab next to line of code you want to break at, to set a breakpoint. A red circle is placed in the margin, and the corresponding line is highlighted in red (clicked it again to remove the breakpoint) Method Breakpoint A method breakpoint is represented by a red circle containing four dots placed at the method signature Android Studio pauses execution when the method is hit, and it also automatically sets a corresponding breakpoint and pauses at the end of the method 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Temporary Breakpoints Useful in a loop To set a temporary breakpoint, place your cursor at the location in the code where you want it to break and select Run ➪ Toggle Temporary Line Breakpoint. Android Studio only stops at this breakpoint the first time your code enters it 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Conditional Breakpoints A condition breakpoint is a breakpoint at which Android Studio only pauses when specific conditions are met. To set a conditional breakpoint, first set a simple breakpoint at the line of code you want to examine, then right-click the simple breakpoint to bring up the condition context menu You would then set the condition in the breakpoint such as: foo == true 11/6/2019 CIS 470 Mobile App Development

CIS 470 Mobile App Development Navigating Paused Code When Android Studio hits, and pauses at, a breakpoint, the red circle in the margin next to the corresponding line of code changes to a circle with a check mark Once a breakpoint has been hit, the debug window opens at the bottom of Android Studio Step Over and Step Into 11/6/2019 CIS 470 Mobile App Development