Mobile Programming Lecture 4. Debugging

Similar documents
Lab Android Development Environment

Filtering - Zimbra

Mobile Programming Lecture 3. Resources, Selection, Activities, Intents

Migration from HEW to e 2 studio Development Tools > IDEs

Android Programming Lecture 2 9/7/2011

Assignment 1: Port & Starboard

CSCI 201 Lab 1 Environment Setup

QUICK START GUIDE. Quick Start Guide. This will assist you to setup and distribute content to a StratosMedia Player device in 4 easy steps.

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling

From time to time Google changes the way it does things, and old tutorials may not apply to some new procedures.

A Tutorial for ECE 175

Lab 1 - Setting up the User s Profile UI

Android Debug Framework

PISCES Installation and Getting Started 1

EPiSERVER Content Management System

Introduction to Computation and Problem Solving

Hello World. Lesson 1. Create your first Android. Android Developer Fundamentals. Android Developer Fundamentals

Lab 3-2: Exploring the Heap

COMP 110/401 APPENDIX: INSTALLING AND USING ECLIPSE. Instructor: Prasun Dewan (FB 150,

Mobile Programming Lecture 1. Getting Started

Outlook Integration. Installation & Configuration

Android App Development for Beginners

Composer Help. Import and Export

Android Studio Setup Procedure

Homework 3 - Dumb Notes

ECE QNX Real-time Lab

License Server Administrator Guide How to configure and manage a license server for sharable licenses

Profiling Applications and Creating Accelerators

Laboratory Assignment #3 Eclipse CDT

XML Tutorial. NOTE: This course is for basic concepts of XML in line with our existing Android Studio project.

CMSC436: Fall 2013 Week 4 Lab

SyncToy - Automated Schedule

Recording Narration in PowerPoint using ispring Free

MEDIA COMPUTATION DRJAVA. Lecture 11.3 November 7, 2008

ESRI stylesheet selects a subset of the entire body of the metadata and presents it as if it was in a tabbed dialog.

QNX Software Development Platform 6.6. Quickstart Guide

BCA 6. Question Bank

Moodle 2.2 Student User Guide My Private Files

DSS User Guide. End User Guide. - i -

Introduction. Mail Merge. Word 2010 Using Mail Merge. Video: Using Mail Merge in Word To Use Mail Merge: Page 1

PadFone Infinity. Standard Operating Procedure for Upgrading the Firmware to Android Kit Kat

Eclipse-Based CodeWarrior Debugger

Module 3: Working with C/C++

Introduction. Key features and lab exercises to familiarize new users to the Visual environment

BASICS OF THE RENESAS SYNERGY PLATFORM

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

Dweet Library VSA User s Guide

DocuTech. XDS Plus for Mac OS X. Obtaining XDS Plus

Struts Tools Reference Guide. Version: beta1

6L00IA - Introduction to Synergy Software Package Short Version (SSP v1.2.0) Renesas Synergy Family - S7 Series

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.

Introducing HP NonStop Development Environment Version 2.0 for Eclipse (NSDEE 2.0)

1.00 Lecture 2. What s an IDE?

Assignment Mobile Android application

Creating a new CDC policy using the Database Administration Console

MC Android Programming

CodeWarrior Development Studio for StarCore DSP SC3900FP Architectures Quick Start for the Windows Edition

Microsoft Outlook. How To Share A Departmental Mailbox s Calendar

How to clear a web browsers cache, cookies and history last updated on 8/28/2013

Eclipse Setup. Opening Eclipse. Setting Up Eclipse for CS15

Author A.Kishore/Sachin WinSCP

Step 1 Turn on the device and log in with the password, PIN, or other passcode, if necessary.

Android Programming (5 Days)

In order to update you will have to uninstall the current version and install the newer version using the same procedure.

Moving Materials from Blackboard to Moodle

Debugging with PyCharm ~0~ What does it mean to debug a program?

WinSCP. Author A.Kishore/Sachin

Configuring Visual Studio 2017 with SFML Game Engine

CS520 Setting Up the Programming Environment for Windows Suresh Kalathur. For Windows users, download the Java8 SDK as shown below.

Diploma in Android Programming (DAP)

Chapter 12 Visual Program Debugger

Code::Blocks Student Manual

Anonymous Group Manager GUI Tool

Mobile Computing Professor Pushpedra Singh Indraprasth Institute of Information Technology Delhi Activity Logging Lecture 16

WinZip for Sending Files. Zipping a file

Mail Merge. To Use Mail Merge: Selecting Step by Step Mail Merge Wizard. Step 1:

Parallel Tools Platform

Quick Start Guide TWR-S08DC-PT60. Tower System Daughter Card for the 5-Volt 8-bit MC9S08P Family TOWER SYSTEM

Java Training Center - Android Application Development

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

You have a PC with a USB interface, running Microsoft Windows XP (SP2 or greater) or Vista You have the Workshop Installation Software Flash Drive

How to configure the Matlab interface

The ImageJ Eclipse Howto

application components

BlackBerry Developer Summit. A02: Rapid Development Leveraging BEMS Services and the AppKinetics Framework

Step 4 Part F - How to Download a Video on YouTube and Delete a Video

Adobe ColdFusion Documentation. September 2014

NetBeans Tutorial. For Introduction to Java Programming By Y. Daniel Liang. This tutorial applies to NetBeans 6, 7, or a higher version.

Lab 1: Space Invaders. The Introduction

Nextiva Drive The Setup Process Mobility & Storage Option

Downloading & Installing Audacity

As CCS starts up, a splash screen similar to one shown below will appear.

9/2/2016. Storage Media. Storage Media

1. Implementation of Inheritance with objects, methods. 2. Implementing Interface in a simple java class. 3. To create java class with polymorphism

Part 1: Setting up Your Office 365 Account in Outlook

If this is the first time you have run SSMS, I recommend setting up the startup options so that the environment is set up the way you want it.

Lab 1: Simon. The Introduction

Test/Debug Guide. Reference Pages. Test/Debug Guide. Site Map Index

Code::Blocks Student Manual

ETD_CON Utility and User Manual

Transcription:

Mobile Programming Lecture 4 Debugging

Lecture 2 Review How do you make the android:inputtype attribute of an EditText both textcapwords and textmultiline? Why should you use a @string 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 Android Studio 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 especially if you're using multiple Toasts It doesn't persist 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! depends on the state of the application

Debugging - LogCat Log.i("HelloWorldActivity", "This line has been executed"); This is the message Tag

Debugging - LogCat Log.i("HelloWorldActivity", "This line has been executed"); This is the message

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

Debugging - LogCat 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 - LogCat A good convention is to declare a TAG constant in your class

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

Debugging - LogCat Open the LogCat view if it's not already open in Android Studio Open the Active Tool Window and ensure Android Monitor is selected Select the logcat tab In the device dropdown ensure the device you wish to view log output for is selected You can then select the debuggable app whose output should be displayed You can choose to display output only for the selected app, remove filters or modify the current filter To enter a custom filter, select Enter Filter Configuration and populate the appropriate fields, e.g. Filter Name: HelloWorldActivity Log Tag: HelloWorldActivity Click OK Your debug messages should now show up

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

Debugging - Using Breakpoints Another way to debug is by using breakpoints, which you may already be familiar with from an IDE other than Android Studio Add breakpoints to lines in your code where you want to pause your program To start debugging, you can do one of the following Press Shift + F9 Select Run > Debug <module> If your application gets to your breakpoint, it will pause there

Debugging - Debug Tool Window If the Debug Tool Window isn t displayed automatically you can display it by pressing Alt + 5 If you have never launched your app for debugging, you may not be able to access the Debug Tool Window The Frames section of the Debug Tool Window represents the call stack It allows you to select various method calls up to and including the method containing your breakpoint The debugger will automatically attempt to decompile calls to system methods (i.e. for classes not owned by your project e.g. Activity method calls) The Variables section allows you to inspect and modify the values of different variables accessible within the current Frame Buttons in the Debug Tool Window allow you to continue or step through the rest of the code Resume, Step Into, Step Over, etc

Exporting projects for submission To export your Android Studio projects for submission: Simply compress your project folder (tar or zip, tar is the preferred submission format) If you do not know how to do this a quick Google search should provide instructions and/or tools for your specific OS

Importing projects into Android Studio Most code examples that I post will be.zip (or.gz) archive files To import an existing project into Android Studio Download and extract the archive file Navigate to File > New > Import Project... Browse to the extracted directory and select it Click OK Or. You can attempt to open the project directly File > Open Browse to the extracted directory and select it Click OK 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 Android Developers The Mobile Lab at Florida State University