development with android studioapm/cm/docs/asdev.pdf · log.wtf() - log ‘what a terrible...
TRANSCRIPT
![Page 2: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/2.jpg)
Android Studio IDE and SDK
Android IDE 2
Android Studio
Android SDK
https://developer.android.com/studio
![Page 3: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/3.jpg)
Android development❖ Creation of emulators
•Android Virtual Device Manager (AVD)
Android IDE 3
![Page 4: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/4.jpg)
Android IDE 4
New Android project
1.
3.
2.
3.
![Page 5: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/5.jpg)
Characterizing a project
Android 5
Project Structure (some properties and dependencies)
Project
properties
Project
organization
You can
delete these
![Page 6: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/6.jpg)
Project skeleton
Android 6
Activities are classes that ultimately derive from Activity or some descendent
First method to be called
The screen is defined using a layout resource
![Page 7: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/7.jpg)
Resources (activity layout)
Android 7
![Page 8: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/8.jpg)
Layout editor
Android 8
![Page 9: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/9.jpg)
Resources (values)
Android 9
You can define string constants, number constants, colors, styles, … in the values directory
![Page 10: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/10.jpg)
The manifest
Android 10
Properties of application and other components
All componentsshould be listed
Intent filters allow the activation by the Launcher and other applications, using the corresponding intent
![Page 11: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/11.jpg)
Execution
Android 11
Real device connected through USB
An emulator
Launch other emulator
![Page 12: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/12.jpg)
Messages and emulator
Android 12
Execution messages
An emulator
![Page 13: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/13.jpg)
❖Logging messages
•Using the Log class which has several static methods
▪Log.e() - log errors
▪Log.w() - log warnings
▪Log.i() - log information
▪Log.d() - log debugging
▪Log.v() - log verbose
▪Log.wtf() - log ‘what a terrible failure’
•These messages are shown on the Android Monitor
▪Many API functions and even the OS emit them
▪ In Android Studio: Use the bottom tab Android Monitor (Alt+6)
▪ In an independent view: adb logcat (SDK)
▪Leave it running during the all session
Android 13
Debugging (1)
![Page 14: Development with Android Studioapm/CM/docs/ASDev.pdf · Log.wtf() - log ‘what a terrible failure’ • These messages are shown on the Android Monitor Many API functions and even](https://reader036.vdocument.in/reader036/viewer/2022070800/5f024e637e708231d4039d2b/html5/thumbnails/14.jpg)
•breakpoints, single step, variable state, ...
Android 14
Debugging (2)