Mobile Programming Lecture 3 Debugging. Lecture 2 Review What widget would you use to allow the user to enter o a yes/no value o a range of values from.

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

HELP GUIDE NEW USER REGISTRATION (SLIDE 2) TAKING A QUIZ (SLIDE 8) REVIEWING A QUIZ (SLIDE 17) GROUP MEMBERSHIP (SLIDE 26) CREATING QUIZZES (SLIDE 31)
MT311 Tutorial Li Tak Sing( 李德成 ). Uploading your work You need to upload your work for tutorials and assignments at the following site:
Android Application Development Stephen Diniz Computer/Electrical Engineer Lecture 01 Introduction.
LAUNCHXL2-RM57L – Project 0
CS 2511 Fall  Windows:  Start->Specialized Academic Software- >Programming Languages->NetBeans->NetBeans IDE x.y.z  where x.y.z is a version.
Debugging Android Applications
A wonderful informal assessment tool! Created by Joell Wilkins using the Apple app, so please note Android apps might be different. This powerpoint may.
Getting Started with Android Programming Note: if you have already installed android development tools, please check that you have the same version as.
Better reference the original webpage :
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Android development the first app. Andoid vs iOS which is better? Short answer: neither Proponents on both sides For an iOS side, see this article on.
Welcome to turnitin.com!. What is turnitin.com? An online paper submission website Online grading Paper free! A place to keep a record of your assignments.
Mobile Programming Lecture 2 Layouts, Widgets, Toasts, and Event Handling.
1 Mobile Computing Monetizing An App Copyright 2014 by Janson Industries.
Intro to C++. Getting Started with Microsoft Visual Studios Open Microsoft Visual Studios 2010 Click on file Click on New Project Choose Visual C++ on.
Author: Loh Jianxiong Christopher Editors: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang.
26/05/2016 E.R.Edwards 26/05/2016 Staffordshire University School of Computing Introduction to Android Practical 1 Changing the Eclipse Workspace Importing.
SE 320 – Introduction to Game Development Lecture 8: Animations, GUIs, Debugging and IDEs Lecturer: Gazihan Alankuş Please look at the last two slides.
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
CSE 332: C++ debugging in Eclipse C++ Debugging in Eclipse We’ve now covered several key program features –Variable declarations, expressions and statements.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
HOW TO USE for Audio Diaries click for teacher instructions click for student instructions for smartphone instructions.
Welcome To Eclipse. Basic Concepts Workspace – directory where your projects are stored –Projects grouping of related works –Resources generic term to.
9/2/ CS171 -Math & Computer Science Department at Emory University.
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
Mobile Programming Lecture 11 Animation and TraceView.
Eclipse Project. Installing Visit to download a copy for your home computerhttp:// –Get Release version 3.0 (or.
Author: Loh Jianxiong Christopher Contributions: Chua Jie Sheng, Li Mengran, Peh Shao Hong, Oo Theong Siang, Tong Chun Kit, Tania Chattopadhyay.
1 Class 1 Lecture Topic Concepts, Definitions and Examples.
Introduction to Eclipse Programming with an Integrated Development Environment.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
Tomcat Setup BCIS 3680 Enterprise Programming. One-Click Tomcat Setup 2  This semester we’ll try to set up Tomcat with a PowerShell script.  Preparation.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
Today Javadoc. Packages and static import. Viewing API source code. Upcoming Topics: –protected access modifier –Using the debugger in Eclipse –JUnit testing.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
Mobile Programming Lecture 4 Resources, Selection, Activities, Intents.
Import existing part with drawing
CSE 332: Scientific debugging in C++ Scientific Debugging in C++ (with Eclipse & gdb) By now we’ve covered several key C++ features –Variable declarations.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Debugging with Eclipse
A step-by-Step Guide For labels or merges
CARA 3.10 Major New Features
Mobile Application Development Chapter 5 [Persistent Data in Android]
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
The Android Activity Lifecycle
CENG2400 Tutorial 1 Keil IDE CENG2400 tutorial 1 v.7a.
Instructor: Prasun Dewan (FB 150,
DEBUGGING.
Debugging with Eclipse
CIS 470 Mobile App Development
Aaron Zeckoski Tomcat Debugging Aaron Zeckoski
Setting up Eclipse Locally
Creating and Modifying Queries
DEBUGGING JAVA PROGRAMS USING ECLIPSE DEBUGGER
Tonga Institute of Higher Education
Debugging Taken from notes by Dr. Neil Moore
Testing, debugging, and using support libraries
Instructions for Windows users:
CISC124 Assignment 3 due tomorrow at 7pm.
Instructions for Windows users:
Debugging Taken from notes by Dr. Neil Moore
Software Setup & Validation
CIS 470 Mobile App Development
CMPE212 – Reminders Assignment 2 due today, 7pm.
Debugging with Eclipse
Canvas introduction for students
CIS 694/EEC 693 Android Sensor Programming
Presentation transcript:

Mobile Programming Lecture 3 Debugging

Lecture 2 Review What widget would you use to allow the user to enter o a yes/no value o a range of values from 1 to 100 What's the benefit of a RelativeLayout over LinearLayout? How many ways can you set an event listener?

Lecture 2 Review How do you make the android:inputType attribute of an EditText both textCapCharacters and and textMultiLine? Why should you use resource for TextViews instead of hardcoding the string? If you use the same android:onClick value for multiple views, how do you determine which one was clicked?

Agenda Debugging using Toast... LogCat Debug Perspective Importing existing projects into Eclipse Lab debugging assignment

Debugging using Toast... A Toast is an easy way to debug your app... sometimes

Try not to debug using Toast! it's slower o especially if you're using multiple Toasts it doesn't persist o after the Toast is gone, you may not have seen all of the debug information, then you'll have to run it again sometimes the code for a Toast will be correct, but the Toast just won't show! o depends on the state of the application

Debugging - LogCatLogCat LogCat shows the stack traces, diagnostic information from the operating system. You can use LogCat in Eclipse easily: o Log.i("HelloWorldActivity", "This line has been executed"); This is the message Tag This is the message

Debugging - LogCatLogCat Log.i("HelloWorldActivity", "This line has been executed"); Log.i("HelloWorldActivity", "Value of x = " + x);

Debugging - LogCatLogCat Log.i("HelloWorldActivity", "This line has been executed"); Log.i("HelloWorldActivity", "Value of x = " + x); This is the message. Prints the value of x to the Log

Debugging - LogCatLogCat A good convention is to declare a TAG constant in your class

Debugging - LogCatLogCat private static final String TAG = "HelloWorldActivity"; Log.i(TAG, "This line has been executed"); Log.i(TAG, "Value of x = " + x);

Debugging - LogCatLogCat Open the LogCat view if it's not already open in Eclipse o Window > Show View > LogCat Under Saved filters, click the + button to add a new filter Enter the following (modify to match your app) o Filter Name: HelloWorldActivity o by Log Tag: HelloWorldActivity Click OK Your debug messages should now show up o If they're not showing up, double check your filter (or advance a few slides in this presentation)or advance a few slides in this presentation

Debugging - LogCatLogCat You can view LogCat information up until you close Eclipse (or probably until you run out of memory dedicated to LogCat)

Debugging - Debug Perspective Another way to debug is by using breakpoints, which you may already be familiar with from an IDE other than Eclipse Add breakpoints to lines in your code where you want to pause your program To start debugging, you can do one of the following o press F11 o Run > Debug If your application gets to your breakpoint, it will pause there

Debugging - Debug Perspective If it asks whether you want to switch to Debug Perspective, say yes In the Expressions View of the Debug Perspective, you can add variables to see what their values are at the breakpoint o e.g., if you have int x somewhere in your code, try adding x to You may have to open the view first  Window > Show View > Expressions Buttons in the Debug View allow you to continue or step through the rest of the code o Resume, Step Into, Step Over, etc

Exporting projects from Eclipse To export a project from Eclipse Right click your project > Export > General > Archive File Next Select your project if necessary Options > Save in tar format preferably (zip will work as well) Browse... Finish Submit your homework assignments and projects in these formats

Importing projects into Eclipse Most code examples that I post will be.tar (or.zip) archive files To import an existing project into Eclipse Download the archive file Navigate to File > Import... > General > Existing Project into workspace Choose "Select archive file" Browse for the downloaded file and select it Finish I may include a README file in the root directory with instructions that you need to follow

References The Busy Coder's Guide to Android Development - Mark Murphy The Busy Coder's Guide to Android Development - Mark Murphy Android Developers The Mobile Lab at Florida State University