0% found this document useful (0 votes)
10 views2 pages

Mobile Programming Assignment2

Uploaded by

Cate Muigai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Mobile Programming Assignment2

Uploaded by

Cate Muigai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

19/05988

NAME: CATHRINE WAITHERA MUIGAI

Adm No: 19/05988

Mobile programming

Assignment 2

Question

1. Describe the role of the Dalvik virtual machine and how it relates to Android Debugging.
Additionally show your understanding on how the 3 different methods of debugging in Android
Studio, including LogCat, Toast, and breakpoints work. Discuss the advantages and
disadvantages of each method. (10 Marks)

Answers

The Dalvik Virtual Machine was the original runtime environment for Android applications. Here is how
it relates to android debugging:

Execution Environment:

 DVM executes Android app bytecode (compiled from Java or Kotlin) and manages memory,
threads, and resources.
 Debugging DVM involves understanding its behavior during app execution.

Debugging DVM:

 Debugging DVM is similar to native debugging on Android.


 Use gdbserver on the device to attach to the process you want to debug.
 Forward the port from the device to your local machine using adb forward.

Regarding android debugging, there are three primary methods commonly used in Android Studio:

LogCat:

 Role: Displays real-time logs from your device during app execution.

 Advantages:

o Provides insights into app behavior, exceptions, and system messages.

o Helps track down issues by showing stack traces.

o Supports filtering by tags, priority levels, and search queries.

 Disadvantages:

o Overwhelming volume of logs can make it hard to find relevant information.

o Limited to textual output, which may not be user-friendly.


19/05988

Toast:

 Role: Displays short-lived messages (usually notifications) on the screen.

 Advantages:

o Quick and simple way to provide feedback to users.

o Non-intrusive and does not interrupt the app flow.

o Useful for showing small snippets of information.

 Disadvantages:

o Limited to short messages; not suitable for detailed debugging.

o Can be easily missed if the user is not paying attention.

Breakpoints:

 Role: Pauses the app execution at specific lines of code during debugging.

 Advantages:

o Allows detailed inspection of variables, expressions, and call stacks.

o Precise control over where to pause execution.

o Works well for systematic debugging.

 Disadvantages:

o Slows down execution during debugging.

o May disrupt the app flow if not used judiciously.

You might also like