Ch 2: Getting Started Flashcards

1
Q

What you need to start developing

Android applications

A
  • Android Software Development Kit(SDK)
  • Java Development Kit (JDK)
  • An Integrated Development Environment(IDE)
    • Android Studio is strongly suggested
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Android Studio:

Overview

A
  • Google’s officially supported IDE for Android app development
  • Includes an integrated JDK and manages installation of Android SDK and associated tools
  • Purpose built for Android development
    • Built on top of IntelliJ IDEA
  • Supports all Android Form Factors
  • Includes tools for:
    • rich code editing
    • debugging
    • testing
    • profiling
    • version control
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Programming Languages

for Android

A

Can be written in either Java or Kotlin

  • Java
    • Statically typed
  • Kotlin
    • Statically typed language
    • Fully interoperable with Java source files and Android Run Time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Benefits of Kotlin

A
  • Fully interoperable with Java source files and Android Runtime
  • Considered expressive and concise
  • Introduces improvements:
    • reduced language verbosity
    • null-pointer safety
    • extension functions
    • infix notation

Java is still the default, but Kotlin is expected to become very popular

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Kotlin:

Extension Functions

A
  • Allow you to extend a class with new functionality, without having to create a new subclass or use design patterns such as a Decorator
  • Can write a new function for a class without modifying the class code
  • There are also Extension Properties that work similarly
  • Syntax:
    • Define a new function, appended to the class name
      • fun <classname>.<myfunction>(...parameters){ .... }</myfunction></classname>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Kotlin:

infix notation

A
  • Allows functions to be called with just their name
    • Similar to core functions like arithmetic
  • Defined by using the infix keyword before a function definition:
    • infix fun myFunc(x: Int) { …. }
  • Used simply with the class/object and the name of the function:
    • this myFunc 5
    • Rather than: this.myFunc(5)
  • Function must meet some requirements:
    • Be a member function or extension function
    • Single parameter
    • Parameter must not accept variable number of arguments(no lists, etc)
    • No default value for the parameter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Android SDK Manager:

Overview

A
  • Integrated into Android Studio
  • Manages installation of Android SDK components, tools, Framework Libraries and optional add-ons
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Unique Challenges of

Mobile Development

A
  • Small Form Factors
  • Limited Battery Life
  • Restricted Processing Power
  • Restricted Memory
  • Unreliable Network Connections
  • Increased need for Responsiveness
  • User Interface must be simple and easy to learn
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Android Studio:

Major IDE Features

A
  • Intelligent code editing:
    • Advanced code completion
    • Refactoring
    • Code analysis
  • Version control integration including GitHub and Subversion
  • Robust static analysis framework:
    • Over 280 Lint checks along with quick fixes
  • Extensive testing tools and frameworks:
    • JUnit 4
    • Functional UI tests
    • Tests can be run on :
      • Device
      • Emulator
      • Continuous Integration Environment
      • Firebase Test Lab
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Android Studio:

Useful Build and Debug Features

A
  • Android Project Wizard
  • XML Editors
  • Automated Build Process:
    • Build Project
    • Convert to Android exectuable (.dex)
    • Creating package files (.apk)
    • Installation of packages onto Android Run Time
  • Android Virtual Device manager
  • Android Emulator
    • Access to Emulator filesystem
  • Android Profiler
  • Runtime debugging
  • Logging and console outputs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Android Studio:

Basic Things

you should know how to do

A
  • Create a new Project
  • Create Android Virtual Device
  • Configure a Physical Device for Testing and Debugging
  • Run and Debug Android Application
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Android Studio:

Creating a New Project:

Basic Steps

A
  • Open New Project Wizard
    • File->New->New Project
  • Select a Project Template
    • Select Form Factor (Target Device)
    • Select a main Activity
  • Configure:
    • Name
    • Directory
    • Package
    • Android SDK version
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Android Studio Operations:

Create an Android Virtual Device

steps

A
  • Open AVD Manager
    • Tools->AVD Manager
  • Click “Create Virtual Device” button to open Virtual Device Configuration dialog box
  • Choose a Hardware Profile from the list (can also create or import)
  • Select System Image
    • Android API version
    • Application Binary Interface(ABI) - usually x86 or ARM
    • May need to download the desired system image
  • Give the AVD a descriptive name and a startup orientation
    • Also some more advanced settings here
  • Finish
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Android Studio Operations:

Configure a Physical Device

Steps

A
  • Enable Developer Mode on the device
    • On device, go to: Settings->About->Build Number
    • Tap “Build Number” 7 times
    • There will now be an option under Settings called “Developer Options”
      • Go to it, enable “USB Debugging”
  • Connect the Device to the Development Computer using a USB cable
  • Give permission to allow USB Debugging on the Dialog Box that comes up
  • The device will now be available as a target when attempting to Run or Debug the App in Android Studio
    • (As long as it is plugged in on USB)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Project Wizard:

Available Form Factors

and

Project Templates

A
  • Phone and Tablet
    • Templates: See dedicated flashcard
  • Wear OS
    • Watch Face
    • Google Maps Wear Activity
    • Blank Wear Activity
  • Automotive
    • Media Service
    • Messaging Service
  • TV
    • Android TV Activity
  • Android Things
    • Android Things Empty Activity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Project Wizard:

Phone and Tablet

Project Templates

(12)

A
  • Basic Activity
  • Empty Activity
  • Fragment + View Model
  • Bottom Navigation Activity
  • Fullscreen Activity
  • Master/Detail Flow
  • Navigation Drawer Activity
  • Google Maps Activity
  • Login Activity
  • Scrolling Activity
  • Tabbed Activity
  • Native C++
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Android Studio Operations:

What happens “behind the scenes”

when Running or Debugging

A
  • Current Project souce is compiled to byte code
    • bytecode is then converted to an Android executable (.dex)
  • Package Created:
    • Executable, Resources and Project Manifest are put into an Android Package(.apk)
  • Deploys Package to device and installs it
    • If using AVD and it is not running, the AVD is started first
  • Starts the application
    • If debugging, the Android Studio debugger is also attached to allow for setting breakpoints and debugging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Android Projects:

Project Hierarchy

A
  • /app - The main folder for the application
    • /manifests - Lists of things included in the project
      • AndroidManifest.xml
    • /java - class definitions, our source code
    • /java (generated) - generated code, including build configurations
    • /res - Resources used in the application
      • /drawable
      • /layout
      • /menu
      • /mipmap
      • /values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Android Sample Projects:

Basics

A
  • Well documented sample projects included with Android Studio
  • Projects are hosted on Git Hub
  • Accessed through the Import Sample Wizard
    • Use File -> New -> Import Sample
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Android Support Library:

Overview

A
  • Also referred to as the “compatibility library” or AppCompat
  • A set of libraries that you can include as part of a project
    • Acess Convenience APIs that aren’t part of the framework
    • Access useful APIs not available on all platform releases
  • Updated more regularly than the Android framework SDK
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Android Support Library:

Using a Package in your Project

A
  1. Use SDK Manager to ensure the Android Support Repository is downloaded
  2. Add dependency for the package to the Gradle Build
    1. Add to Module level Gradle Build file (module:app build.gradle), in the “dependencies” block:
      • implementation <package></package>
    2. Alternatively, Add using Android Studio’s Project Structure UI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Developing for Mobile and Embedded Devices:

Challenges of Mobile Devices

A
  • Low processing power
  • Limited RAM
  • Limited Storage capacity
  • Small Screens
  • High costs associated with data transfers
  • Network issues:
    • Intermittent connectivity
    • Slow data transfer rates
    • high latency
  • Limited battery life
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Developing for Mobile and Embedded Devices:

Design Tips

A
  • Prioritize Performance
  • Expect Limited Storage Capacity
  • Design for Different Screens and Form Factors
  • Expect Low Speeds and High Latency
  • Save Battery Life
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Developing for Mobile and Embedded Devices:

Design Tips:

Performance Matters

A
  • In embedded and mobile devices, thinner form factors and bigger screens are valued more than performance
  • Software developers cannot count on performance increases from Moore’s Law like they can with desktop computers
  • Code should be optimized so that it runs quickly and responsively
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Developing for Mobile and Embedded Devices:

Design Tips:

Expected Limited Storage Capacity

A
  • Although many devices have quite a bit of storage, lower end devices do not
  • Most available storage on a device will be used to store photos, music and movies
  • Users are likely to uninstall apps that take up too much memory
  • Application install size should be limited
  • Application should be polite in its use of system resources
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Developing for Mobile and Embedded Devices:

Design Tips:

Expected Limited Storage Capacity:

Techniques for limiting memory usage

A
  • Use Android databases to persist, reuse and share large quantities of data.
  • Used existing optimized frameworks for Files, Preferences and State information
  • Clean up after yourself:
    • caching, pre-fetching, and lazy loading are useful for limiting repetitive network lookups and improving responsiveness
    • Don’t leave files on filesystem or records in a database when they’re no longer needed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Developing for Mobile and Embedded Devices:

Design Tips:

Design for Different Screens and Form Factors

A
  • Small size and portibility are a challenge for creating good interfaces
  • Applications should be intuitive and easy to use:
    • Reduce number of controls
    • Put most important info front and center
  • Prioritize Graphical controls
  • Consider how touch input will affect the interface design
  • Consider how to support accessibility and non-touch screen devices such as TVs
  • Create responsive designs and test application on a variety of screens
  • Ensure UIs scale well
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Developing for Mobile and Embedded Devices:

Design Tips:

Expect Low Speeds, High Latency

A
  • Internet connectivity is not as fast, reliable, cheap, or readily available as we would like.
  • It is best to assume a network connection will be slow, intermittent, expensive and unreliable
  • App should be able to handle losing, or not finding, a data connection
  • Techniques:
    • Limit functionality of app
    • Reduce network lookups to cached bursts when data transfer capabilities are limited
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Developing for Mobile and Embedded Devices:

Design Tips:

Save Battery Life

A
  • Battery life is a significant problem
  • Larger, higher resolution screens and thinner form factors make it worse
  • Network Data Transfers are one of the most dramatic influencers
    • Carefully consider if and when you choose to transfer data
  • Useful APIs for conserving battery life:
    • Doze
    • App Standby
    • Job Scheduler
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Considering User’s Environment:

How people use Smart Phones

A
  • Your application is unlikely to be the most important App on a user’s phone
  • Typical Usage Priority:
    • Communications device
    • Camera
    • Music and Video Player
    • Games
    • “Useful Stuff” (your app)
  • People use their phones in many different environments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Considering User’s Environment:

Software design should make the app:

A
  • Predictable and well behaved
  • Switch seamlessly from background to foreground
  • Polite
  • Present an attractive and intuitive UI
  • Be responsive
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Developing for Android:

High Quality design considerations

according to Android Design Philosophy

A
  • Performance
  • Responsiveness
  • Freshness
  • Security
  • Seamlessness
  • Accessibility
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Developing for Android:

Being Performant

A

Two Basic Rules:

  • Don’t do work that you don’t need to do
  • Don’t allocate memory if you can avoid it

System memory is a scarce commodity, take special care to use it efficiently.

Think about:

  • how you use the stack and heap
  • limiting object creation
  • being aware of how variable scope affects memory use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Developing for Android:

Being Responsive:

Basics

A
  • There is a 100-200ms threshold at which users experience a delay
  • Android Activity Manager and Window Manager enforce a time limit for unresponsive apps
    • If time limit reached, an “Application Not Responding”(ANR) dialog box is presented to the user to let them close the app.
  • Android monitors 2 Conditions:
    • Response to user action
    • Broadcast Receiver response time
35
Q

Developing for Android:

Being Responsive:

Two conditions monitored by Android

A
  • App must respond to any user action, such as a key press or screen touch, within 5 seconds
  • A Broadcast Receiver must return from its “onReceive” handler within 10 seconds

If either of these conditions is met, an Application Not Responding (ANR) dialog box will be presented to the user, allowing them to kill the app.

36
Q

Developing for Android:

Being Responsive:

Techniques to ensure Responsiveness

A
  • Move lengthy tasks off of the main UI thread and run asynchronously
    • network or database lookups
    • Complex Processing( such as calculating game moves)
    • File I/O
  • Show progress within the UI if there are long-running tasks happening in the background
  • If initial setup phase is time-consuming:
    • Render the main view as quickly as possible
    • Indicate that loading is in progress
    • Fill in information asynchronously
    • May also show a splash screen
37
Q

Developing for Android:

Ensuring Data Freshness

A

Ideally, the application would be updated immediately before the user looks at it(constantly).

In practice, need to weigh the update frequency against its effect on battery life and data usage.

  • Consider how often data will be updated
  • Minimize time users are waiting for refreshes or updates
  • Limit the effect that background updates have on battery life
  • The Job Scheduler is a useful tool for background updates
38
Q

Developing for Android:

Developing Secure Applications:

Built in security measure of Android

A

Application access restrictions

  • Each application is “sandboxed”
  • Access to services and functionality is restricted by requiring applications to declare the permissions they require
    • Users may accept or reject these requests
  • An assortment of specialized security tools and implementations
39
Q

Developing for Android:

Developing Secure Applications:

Developer Responsibilities

A
  • Make sure application is secure for its own sake
  • Ensure app does not “leak” permissions, data and hardware access
    • This could compromise the device or user data
40
Q

Developing for Android:

Developing Secure Applications:

Techniques/Approaches

A
  • Be security conscious when storing or transmitting data
    • Take special care not to share or transmit sensitive information, such as
      • Personally Identifiable Information(PII)
      • Location data
  • Always perform input validation
    • One of the most common security problems affecting applications
  • Be cautious when your app may expose access to lower-level hardware to third party apps
  • Minimize the data used and permissions required by your app
41
Q

Developing for Android:

Ensuring a Seamless User Experience:

Goals

A
  • Consistent user experience:
    • Applications start, stop, and transition instantly and without perceptible delays or jarring transitions
  • Speed and responsiveness of mobile device should not degrade the longer it is used
  • Apps should retain the same state when not being used
  • Should be consistent and intuitive, integrating cleanly with the wider Android environment
42
Q

Developing for Android:

Ensuring a Seamless User Experience:

Techniques

A
  • Ensure Activities are properly suspended when not in the foreground
    • Android sends event handlers for pausing and resuming
    • Suspend tasks that use processor cycles, network bandwidth, or battery life when app not visible
      • UI updates and network lookups
  • Persist data between sessions
  • Return to last visible state when resumed/restarted
  • Use consistent and intuitive approach to usability
  • Use consistent design language
43
Q

Developing for Android:

Providing Accessibility

A
  • Important not to assume that every user will be exactly like you
  • Need to consider Internationalization and Usability
  • Critical for providing accessible support for user with disabilities
    • May be required to interact with their Android devices in different ways
  • Android provides some Accessibility features:
    • text-to-speech
    • haptic feedback
    • trackball or D-pad navigation
44
Q

Android Development Tools:

Major Tools

incorporated into

Android Studio

(8)

A
  • Android Virtual Device Manager
  • Android Emulator
  • Android SDK Manager
  • Android Profiler
  • Lint
  • Gradle
  • Vector Asset Studio
  • APK Analyzer
45
Q

Android Development Tools:

Minor Tools

in Android Studio (10)

A
  • Android Debug Bridge (ADB)
  • Logcat
  • Android Asset Packaging Tool(AAPT)
  • SQLite3
  • Hprof-conv
  • Dx
  • Draw9Patch
  • Monkey
    • Monkey Runner
  • ProGuard
46
Q

Android Development Tools:

Major Tools:

Android Virtual Device Manager

and Emulator

A
  • AVD Manager creates and managers AVDs.
  • An AVD hosts the Emulator running a particular build of Android.
  • Each AVD can specify a particular screen size and resolution, memory and storage capacities, and available hardware capabilities
  • The Emulator is an implementation of the Android Run Time, designed to run within an AVD on your host development computer.
47
Q

Android Development Tools:

Major Tools:

Android SDK Manager

A

Used to download SDK packages, including:

  • Android platform SDKs
  • Support Libraries
  • Google Play services SDK
48
Q

Android Development Tools:

Major Tools:

Lint

A

A static analysis tool that analyzes your application and its resources to suggest improvements and optimization

49
Q

Android Development Tools:

Major Tools:

Gradle

A

An advanced build system and toolkit that manages the compilation, packaging and deployment of an application

50
Q

Android Development Tools:

Major Tools:

Vector Asset Studio

A

Generates bitmap files for each screen density to support older versions of Android that don’t support the Android vector drawable format

51
Q

Android Development Tools:

Major Tools:

APK Analyzer

A

Provides insight into the composition of your built APK (Package) files

52
Q

Android Development Tools:

Major Tools:

Android Profiler

A

Visualize the behavior and performance of your app.

Android Profiler can track memory and CPU use in real time, as well as analyze network traffic.

53
Q

Android Development Tools:

Minor Tools:

Android Debug Bridge(ADB)

A

A client-server application that provides a link between your host computer and virtual and physical Android devices.

Allows you to copy files, install compiled application packages(.cpk), and run shell commands

54
Q

Android Development Tools:

Minor Tools:

Logcat

A

A utility used to view and filter the output of the Android logging system.

55
Q

Android Development Tools:

Minor Tools:

Android Asset Packaging Tool (AAPT)

A

Constructs the distributable Android package files (.apk)

56
Q

Android Development Tools:

Minor Tools:

SQLite3

A

A database tool that you can use to access the SQLite database files created and used by Android.

57
Q

Android Development Tools:

Minor Tools:

Hprof-conv

A

A tool that converts HPROF profiling output files into a standard format to view in your preferred profiling tool.

58
Q

Android Development Tools:

Minor Tools:

Dx

A

Converts Java class files (.class)

into Android (.dex) bytecode

59
Q

Android Development Tools:

Minor Tools:

Draw9patch

A

A handy utility to simplify the creation of NinePatch graphics

using a WYSIWYG(What You See Is What You Get) editor

60
Q

Android Development Tools:

Minor Tools:

Monkey and Monkey Runner

A

Monkey

Runs within the Android Run Time, generating pseudorandom user and system events.

Monkey Runner

Provides an API for writing programs to control the VM from outside your application

61
Q

Android Development Tools:

Minor Tools:

ProGuard

A

A tool used to shrink and obfuscate your code by replacing class, variable, and method names with semantically meaningless alternatives.

This is useful to make your code more difficult to reverse engineer.

62
Q

Android Development Tips:

Improving Build Performance

A
  • Allocate enough RAM to the build process
    • Can modify in the gradle.properties file
      • org.gradle.jvmargs property
    • Minimum of 2Gb is recommended
  • If on WIndows, Windows Defender may cause slowdowns
    • Add project folder to list of Windows Defender exclusions
63
Q

Android Development Tools:

Android Studio Tips:

Using Instant Run

A

Instant Run is a feature that significantly reduces build and deploy time for incremental changes.

  • The first time you build the project, the Gradle build system does a full build
  • On subsequent builds, Android Studio attempts to improve the build and deploy speed by “swapping” code and resource changes directly into the running debug app process
  • A small yellow lightning bolt icon indicates that Instant Run is available
64
Q

Android Development Tools:

Android Studio Tips:

Instant Run types of Changes

A
  • Hot Swap
    • Incremental code changes are applied and reflected in the app without needing to relaunch the app or even restart the current Activity
    • Can be used for most simple changes
  • Warm Swap
    • Activity needs to be restarted before changes can be seen and used.
    • Typically required for changes to resources
  • Cold Swap
    • App is restarted(but still not reinstalled).
    • Required for any structural changes such as to inheritance or method signatures
65
Q

Android Development Tools:

Android Studio Tips:

Very Useful Shortcuts/Utilities

A
  • Quick Search
  • Autocomplete Selections
  • Postfix Code Completion
  • Live Templates
66
Q

Android Development Tools:

Android Studio Tips:

Quick Search

A
  • Open Action Search with
    • Ctrl + Shift + A
  • After opening, can start typing keywords. Any available actions or options containing those words will be available for selection
  • To seach for files within a project, press Shift twice to display the Search Everywhere dialog
  • Wherever there is a list, start typing and the results will be filtered to match
67
Q

Android Development Tools:

Android Studio Tips:

Using Tab to Autocomplete Selections

A
  • Normal Autocomplete (by pressing Enter) inserts a new selection in front of it
  • Pressing Tab when selecting an autocomplete option replaces any existing methods and values instead
68
Q

Android Development Tools:

Android Studio Tips:

Postfix Code Completion

A
  • Allows you to transform a simple, already typed value or expression into a more complex one
  • Example:
    • Can create a for-loop over a List variable by typing .fori after the variable name
    • Turn a boolean expression into an if statement by postfixing .if (or .else)
  • Can see all the valid postfixes available for a given context using Cmd + J
69
Q

Android Development Tools:

Android Studio Tips:

Live Templates

A

Allows you to use shortcuts that are available as autocomplete options to insert templatized snippets into your code.

Dozens of generic and Android-specific Live Templates are available, including a selection of logging shortcuts.

You can create your own Live Templates to simplify best-practice patterns or boilerplate within your own code.

View or create your own by opening the settings window and navigating to Editor -> Live Templates

70
Q

Android Development Tools:

Android Virtual Devices Manager:

Virtual Devices Configuration Features

A

Each virtual device is configured with:

  • name
  • physical device type
  • Android system image
  • sceen size and resolution
  • ABI/CPU
  • Memory and Storage capacities
  • Hardware capabilities, including
    • camera
    • network speeds
71
Q

Android Development Tools:

Android Emulator:

Basic Controls available

A
  • Power button
  • Volume buttons
  • Software buttons:
    • Home
    • Back
    • Recents
  • Rotate display
  • Take screen shot
72
Q

Android Development Tools:

Android Emulator:

Extended Controls available

A
  • Set GPS location
  • Simulate GPS track playback
  • Simulate cellular network connectivity:
    • Signal strength
    • Speed
    • Data connection type
  • Set Battery status
  • Simulate incoming phone calls and SMS messages
  • Simulate fingerprint sensor
  • Provide mock Sensor data
73
Q

Android Development Tools:

Android Profiler:

Overview

A
  • Allows you to see “under the hood”
  • Displays real-time profiling data and graphs for:
    • CPU
    • Memory
    • Network activity
  • Tracks and displays a timeline for state changes:
    • Changes in Activity State
    • User inputs
    • Screen Rotations
74
Q

Android Development Tools:

Android Profiler:

Major Actions

A
  • Inspect CPU activity and method traces:
    • Time code execution:
      • Sample based method tracing
  • Inspect Memory:
    • Capture heap dumps
    • View memory allocations
  • Monitor Traffic
    • Inspect details of network transmitted files
75
Q

Android Develepment Tools:

Android Debug Bridge:

Overview

A

A client-service application.

Lets you connect with an Android device(virtual or actual)

  • Communications conduit between development hardware and the Android Device or Emulator
76
Q

Android Develepment Tools:

Android Debug Bridge:

Three Components

A

A daemon running on the device or Emulator

A Service that runs on the development computer

Client Applications that communicate with the daemon through the service

77
Q

Android Develepment Tools:

Android Debug Bridge:

Target device operations

A
  • Install applications
  • Push and Pull files
  • Run Shell Commands on the target
    • Change logging settings
    • Query or modify SQLite databases available on the device
78
Q

Android Develepment Tools:

APK Analyzer:

Overview

A

Allows you to better understand the composition of your APK files.

Provides an interface to:

  • View absolute and relative size of files within the APK
    • Including .DEX and resource files
  • View the final versions of .DEX files
  • View final version of AndroidManifest.xml
  • Perform a side-by-side comparison of two APKs
79
Q

Android Development Tools:

The Lint Tool:

Overview

A
  • Static Code Analysis tool
  • Helps identify and correct structural quality issues within your code without running or testing
  • Checks source code and resource files for potential bugs and optimization improvements, including:
    • Correctness
    • Security
    • Performance
    • Usability
    • Accessibility
    • Internationalization
  • Problems are highlighted in IDE, with:
    • description
    • severity level
    • suggested remedies, if avalailable
80
Q

Android Development Tools:

UI Testing:

Monkey overview

A

Works from within the ADB shell.

Sends a stream of pseudorandom, but repeatable, System Events and UI Events to the application.

Can provide some unconventional use of the UI.

Particularly useful to stress-test an application, investigating unanticipated edge-cases.

81
Q

Android Development Tools:

UI Testing:

Monkey Runner overview

A

A python scripting API.

Lets you send specific UI commands to control an Emulator or device from outside the application.

Extremely useful for performing UI Tests,

Functional Tests, and Unit Tests in a predictable and repeatable fashion.

82
Q

Android Development Tools:

UI Testing:

Espresso overview

A

A testing framework provided through the Android Testing Support Library.

  • Provides APIs for writing UI tests to simulate specific user interactions for a specific app.
  • Detects when main thread is idle
  • Runs test commands at the appropriate time to improve test reliability
    • No need to add timing workarounds, such as sleep periods, into test code
83
Q

Android Development Tools:

Gradle Overview

A

Advanced Build System and Toolkit

  • Integrated into Android Studio
  • Perform custom build configurations without needing to modify an app’s source files
  • Plug-in based
  • Capabilities
    • Configure, extend and customize the build process
    • Simplify code and resource reuse
    • Easily create multiple build variants of an application
84
Q

Developing for Android:

Security Functionality and Tools

A

Security Functionality Implementations

Cryptography

secure IPC

Specialized technology/tools:

ASLR

NX

ProPolice

safe_iop

OpenBSD dlmalloc

OpenBSD calloc

Linux mmap_min_addr