Android

0.0(0)
studied byStudied by 2 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/64

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

65 Terms

1
New cards

What is Android (3 answers)

  • A Linux based operating system

  • Mainly for touchscreen mobile devices

  • Plus more recently for other platforms

2
New cards

What are the other android platforms

knowt flashcard image
3
New cards

What parts make up the Android Stack (6 answers)

  • Linux Kernel

  • HAL (Hardware Abstraction Layer)

  • Native Libraries

  • Android Runtime

  • Android Framework

  • Applications

4
New cards

What does the Linux Kernel do ?

  • DRIVERS (DISPLAY, KEYPAD, SHARED MEMORY)

  • POWER MANAGEMENT

5
New cards

What does HAL do ? (10 answers)

  • AUDIO

  • BLUETOOTH

  • CAMERA

  • DRM

  • EXTERNAL STORAGE

  • GRAPHICS

  • INPUT

  • MEDIA

  • SENSORS

  • TV

6
New cards

What do the Native Libraries do ? (9 answers)

  • AUDIO MANAGER

  • FREETYPE

  • LIBC

  • MEDIA FRAMEWORK

  • OPENGL/ES

  • SQLITE

  • SSL

  • SURFACE MANAGER

  • WEBKIT

7
New cards

What does android runtime do ? (3 answers)

  • CORE LIBRARIES

  • ART

  • DALVIK VM

8
New cards

What does the Android Framework do ? (3 answers)

  • CONTENT PROVIDERS

  • MANAGERS (ACTIVITY, LOCATION, PACKAGE, NOTIFICATION, RESOURCE, WINDOW)

  • VIEW SYSTEM

9
New cards

What does the Application Layer do ? (6 answers)

  • ALARM

  • BROWSER

  • CALCULATOR

  • CALENDAR

  • CAMERA

  • plus more

10
New cards

What are the ‘Standard’ Apps for Android Development ? (3 answers)

  • User Interface (UI) + managing data

  • XML for UI

  • Java (or Kotlin) for functionality

11
New cards

What are the ‘Non-Standard’ Apps ?

  • Start with standard, then link to C/C++

  • Increased performance or 3D graphics

  • Game engines (Unity)

  • Scripting (JavaScript, Python, Ruby, etc.)

12
New cards

What are the two ways to run your Application ?

  • Emulator

  • Your physical device

13
New cards

What are the main use cases of the emulator ?

  • Test your functionality, i.e. check that your app runs as expected

  • Test your layout on multiple devices with different shapes and sizes

14
New cards

What are the 4 main components of Android Apps

  • Activities

  • Services

  • Content providers

  • Broadcast receivers

15
New cards

What is an Android Activity ? (3 answers)

An Activity is a component that has a UI and some functionality:

  • The UI is defined in XML

  • Functionality is defined in Java

16
New cards

What are the 4 main files of the Android File Structure ?

app

  • manifests

  • java

  • java (generated)

  • res

Gradle Scripts

17
New cards

What are the 4 parts of the res file ?

  • drawable

  • layout

  • mipmap

  • values

18
New cards

What is in the drawable file

Bitmap files (.png, .9.png, .jpg, .gif) or XML files that are compiled into drawable resource files.

19
New cards

What is in the layout file

XML files defining the architecture for the UI. Both for Activities and components within Activities.

20
New cards

What is in the mipmap file

Drawable files for different launcher icon densities. Only used for launcher icons.

21
New cards

What is in the values file

XML files that contain simple values, such as strings, integers, and colors.

22
New cards

Where is the activity_main.xml file located ?

In the layout file

23
New cards

What is XML and what does it stand for ?

  • XML = eXtensible Markup Language

  • Kind of like HTML

  • BUT XML does not DO anything.

  • XML is just information wrapped in tags.

  • Also, unlike HTML, XML does not have pre-defined tags

  • But Android pre-defines tags for us…

24
New cards

What are the two main components of the Android UI ?

  • Views – actual widgets that you can see and/or interact with

  • ViewGroups – describe the layout

<ul><li><p><strong>Views</strong> – actual widgets that you can see and/or interact with</p></li><li><p><strong>ViewGroups</strong> – describe the layout</p></li></ul><p></p>
25
New cards

What are the main ViewGroups layouts ? (6.5 answers)

  • LinearLayout

  • RelativeLayout

  • ConstraintLayout

  • WebView

  • ListView

  • GridView

  • + more

26
New cards

How does LinearLayout work ?

Automatically displays views one after each other – either vertically or horizontally.

<p>Automatically displays views one after each other – either vertically or horizontally.</p>
27
New cards

How does RelativeLayout work ?

Specify position relative to other views. I.e. below view1, above view2, etc.

<p>Specify position relative to other views. I.e. below view1, above view2, etc.</p>
28
New cards

How does ConstraintLayout work ?

Similar to relative layout but “more flexible and easier to use”

<p>Similar to relative layout but “more flexible and easier to use”</p>
29
New cards

What are the main Views (8.5 answers)

  • TextView (label that shows text)

  • EditText (field for users to enter text)

  • ImageView (displays an image)

  • Button

  • Checkbox

  • RadioButton

  • FloatingActionButton

  • ProgressBar

  • + more

30
New cards
<p>Fill in these Views</p>

Fill in these Views

knowt flashcard image

31
New cards
<p>Determine ViewGroups</p>

Determine ViewGroups

knowt flashcard image
32
New cards

What is a Responsive Layout ? (3 answers)

  • Mobile devices come in all sorts of shapes and sizes – Mobile phones (large and small) – Tablets (large and small) – And more recently, foldable devices like the Samsung Galaxy Zip Fold

  • A single layout needs to look good on all of these devices

  • A responsive layout is a layout that grows, shrinks, and rearranges itself to different screen sizes and orientations.

33
New cards

What are the two main ways to design a Responsive Layout ?

  • Create a Flexible Layout

  • Use Alternative Layouts

34
New cards

What should you do to create a Flexible Layout ? (4 answers)

  • ConstraintLayout

  • LinearLayout with weights

  • ListViews and ScrollViews

  • Avoiding hard-coded sizes

<ul><li><p>ConstraintLayout </p></li><li><p>LinearLayout with weights </p></li><li><p>ListViews and ScrollViews </p></li><li><p>Avoiding hard-coded sizes</p></li></ul><p></p>
35
New cards

What should you do to create Alternative Layouts ? (4 answers)

  • Orientation qualifiers

  • Smallest width qualifiers

  • Available width qualifiers

  • Fragments

<ul><li><p>Orientation qualifiers </p></li><li><p>Smallest width qualifiers </p></li><li><p>Available width qualifiers </p></li><li><p>Fragments</p></li></ul><p></p>
36
New cards

What are the two main ways to avoid using hard-coded sizes ?

  • wrap_content (tells the view to set its size to whatever is necessary to fit the content within that view.)

  • match_parent (makes the view expand to as much as possible within the parent view.)

37
New cards

What are the 3 units of measurement used for adding specific sizes i.e. for margins, padding, text, etc.

  • Pixels (px)

  • Density independent pixels (dp)

  • Scalable pixels (sp)

38
New cards

What are pixels and when should you use them?

DO NOT USE PIXELS. Not only do Android devices come in different screen sizes but their screens also have different resolutions (pixels).

39
New cards

What are Density independent pixels and when should you use them?

They are virtual pixels that are roughly equal to one pixel on a medium-density screen. Android translates this value to the appropriate number of real pixels for each other density.

40
New cards

What are Scalable pixels and when should you use them?

Used for text sizes. Same size as dp, by default, but it resizes based on the user's preferred text size.

41
New cards

What are Alternative Layout Qualifiers ?

You can provide screen-specific layouts by creating additional res/layout/ directories

42
New cards

What is an Orientation Qualifier and How do you create one ?

Where in the Android project structure is your activity_main.xml layout stored?

  • res/layout/activity_main.xml

You can create a second layout qualifier for landscape

  • res/layout-land/activity_main.xml

Android will load the first activity_main.xml when in portrait orientation and the second when in landscape.

<p>Where in the Android project structure is your activity_main.xml layout stored? </p><ul><li><p>res/layout/activity_main.xml </p></li></ul><p>You can create a second layout qualifier for landscape </p><ul><li><p>res/layout-land/activity_main.xml </p></li></ul><p>Android will load the first activity_main.xml when in portrait orientation and the second when in landscape.</p>
43
New cards

What is an Smallest Width Qualifier and How do you create one ?

The smallest width qualifier specifies the smallest of the screen's two sides, regardless of the device's current orientation, so it's a simple way to specify the overall screen size available for your layout.

<p>The smallest width qualifier specifies the smallest of the screen's two sides, regardless of the device's current orientation, so it's a simple way to specify the overall screen size available for your layout.</p>
44
New cards

What are some of the common smallest width values ?

  • 320dp: a typical phone screen (320x480)

  • 480dp: a large phone screen ~5" (480x800)

  • 600dp: a 7” tablet (600x1024)

  • 720dp: a 10” tablet (720x1280)

For example: res/layout-sw600dp/activity_main.xml

45
New cards

What are Drawables ?

A drawable resource is a general concept for a graphic that can be drawn to the screen.

46
New cards

What are the most common Drawable Files

  • Bitmap file

  • State list

  • Shape drawable

47
New cards

What are the 3 Bitmap image formats and where should they be saved ?

  • png (preferred)

  • jpg (acceptable)

  • gif (discouraged)

  • Should be saved in the res/drawable/ folder

48
New cards

How is a drawable called ?

knowt flashcard image
49
New cards

What data is stored within the Shape Files and where should it be saved ?

  • A generic shape defined in XML.

  • Rectangle, oval, line, or ring

  • Can specify:

    • Size

    • Corners

    • Padding

    • Solid (colour)

    • Stroke (colour)

    • Gradient (colour)

  • Should be saved in the res/drawable/ folder

50
New cards

How is a shape created ?

knowt flashcard image
51
New cards

What are Statelist Files used for and where should they be saved?

  • Represent different states of an object

    • state_pressed

    • state_focused

    • state_hovered

    • state_selected

    • state_checked

    • + others

  • Should be saved in the res/drawable/ folder

52
New cards

How is a Statelist file created

knowt flashcard image
53
New cards

What is the purpose of the Mipmap folder ? (3 answers)

  • The Mipmap folder should be used exclusively to store your app launcher icons.

  • You can create a new launcher icon in Android Studio by using the Image Asset Studio.

  • This will automatically generate appropriately sized launcher icons and store them in the Mipmap folder for you.

54
New cards

What is the purpose of the Values folder ?

The Values folder contains simple values. Files in the values directory describe multiple resources, i.e. a list of strings.

55
New cards

What is the difference between the Values folder and the rest of the res folders ?

The other “res” subdirectories (drawables, layouts, mipmap) define a single resource based on the XML filename whereas files in the values directory describe multiple resources.

56
New cards

What are the 4 most commonly used files in the Values directory

  • string

  • color

  • dimension

  • theme

57
New cards

What is a theme in the context of android studio ?

  • Your theme describes the overall look of your application.

    • The color of your Action bar and Status bar

    • The default button color

    • The style for ‘day’ and ‘night’

58
New cards

What are resource qualifiers ?

They are used to make an application more responsive similar to orientation qualifiers. Basically just extra folders in your application.

59
New cards
60
New cards
61
New cards
62
New cards
63
New cards
64
New cards
65
New cards