Slide 1

Slide 1 text

Android “Cool Kid on the Block!”

Slide 2

Slide 2 text

Alexey Buzdin

Slide 3

Slide 3 text

Mobile PCor ?

Slide 4

Slide 4 text

4

Slide 5

Slide 5 text

5

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Number of mobile phones to exceed world population by 2014 http://www.digitaltrends.com/mobile/mobile-phone-world-population-2014/ iOS and Android - 1 million+ apps

Slide 8

Slide 8 text

How do we choose a cell phone? Software vs Hardware

Slide 9

Slide 9 text

CRITERIA

Slide 10

Slide 10 text

CRITERIA OS Size Speed Battery Display Camera Popularity

Slide 11

Slide 11 text

Mobile OS

Slide 12

Slide 12 text

MeeGo iOS Android Windows Phone FirefoxOS BlackBerryOS Symbian bada webOS Sailfish OS Ubuntu Tizen Mobile OS

Slide 13

Slide 13 text

MeeGo iOS Android Windows Phone FirefoxOS BlackBerryOS Symbian bada webOS Sailfish OS Ubuntu Tizen Mobile OS

Slide 14

Slide 14 text

14

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Why choose Android?

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Android Pros Free license Google support Open Source No Small Market Censorship Lots of powered devices o Prices o Size o Hardware

Slide 19

Slide 19 text

Androiders Acer HTC ZTE Samsung Asus LG Motorola Panasonic Sony Alcatel Dell Huawei Lenovo Amazon Archos Prestigio Alibaba

Slide 20

Slide 20 text

20 Android where?

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Android Cons Free license Google support Open Source No Small Market Censorship Lots of powered devices o Prices o Size o Hardware

Slide 23

Slide 23 text

Lots of Devices

Slide 24

Slide 24 text

24

Slide 25

Slide 25 text

VS

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Versioning

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Version Statistics March 2015

Slide 30

Slide 30 text

Forking

Slide 31

Slide 31 text

HTC Sense

Slide 32

Slide 32 text

TouchWiz

Slide 33

Slide 33 text

MotoBlur

Slide 34

Slide 34 text

Kindle

Slide 35

Slide 35 text

Solution to Forking?

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

or

Slide 38

Slide 38 text

Nexus / Google Play edition

Slide 39

Slide 39 text

Android Summary ● Variety ● Cheap/er alternative ● Constantly growing/ improving ● Open for modification ● Though to choose the right Android ● If wrong, suffer from lags and slowness

Slide 40

Slide 40 text

40

Slide 41

Slide 41 text

41 Android Studio • IntelliJ IDEA based • Gradle build support • Comes with Android SDK • Layout editor with preview • Numerous plugin and much more…

Slide 42

Slide 42 text

Android platform • Android is a Linux-based operating system and a software stack designed for touchscreen mobile devices

Slide 43

Slide 43 text

Android Anatomy

Slide 44

Slide 44 text

Android Runtime • On Android you develop in Java • ... but Android does not run Java Bytecode !

Slide 45

Slide 45 text

Android Runtime • Custom Virtual Machine. Why? Constraints Designed for 64M RAM No swap Phone tech v. Desktop CPU specific Oracle JVM problems Memory Hog Slow startup IP licensing restrictions

Slide 46

Slide 46 text

Anatomy of Android application • AndroidManifest • Activities • Fragments • Intents • Services • Content providers • Broadcast receivers

Slide 47

Slide 47 text

Android Manifest • general configuration for your application • contains all component definitions of your appication

Slide 48

Slide 48 text

Activity • An activity represents a single screen with a user interface • An activity is implemented as a subclass of Activity

Slide 49

Slide 49 text

Fragment • A Fragment represents a behavior or a portion of user interface in an Activity • Affected by lifecycle of Activity • subclass of Fragment

Slide 50

Slide 50 text

Intent Intent is used to invoke different components: • Start a service • Launch an activity • Display a web page • Broadcast a message

Slide 51

Slide 51 text

Service • Background process that performs long- running operations or remote processes • No user interface for service • A service is implemented as a subclass of Service • Service can be local (accessed within application) or remote (scope of device)

Slide 52

Slide 52 text

Content providers • Content providers are used to share data between applications • Can store data in SQLite, Web and other storages and perform CRUD operations with Content providers • subclass of ContentProvider

Slide 53

Slide 53 text

Broadcast receiver • Component that responds to system-wide broadcast announcements (e.g.. Screen is turns on-off, SMS received, • Broadcast delivered as Intent • Don’t have user interface • Subclass of BroadcastReceiver

Slide 54

Slide 54 text

Android UI fundamentals

Slide 55

Slide 55 text

Android UI fundamentals Screen size • actual physical size, measured as the screen's diagonal • 2.55”, 3.2”, 4.0”, 10.1”, ... Android groups into four generalized sizes: • Small • Normal • Large • Xlarge

Slide 56

Slide 56 text

Android UI fundamentals Screen density • quantity of pixels within a physical area of the screen (dots per inch, dpi). • "low" density screen has fewer pixels • Android groups actual screen densities into four generalized densities: • Low (ldpi, 120) • Medium (mdpi, 160) • High (hdpi, 240) • Extra high (xhdpi, 320)

Slide 57

Slide 57 text

Android UI fundamentals Density-independent pixel (dp) • virtual pixel unit to express layout dimensions or position in a density-independent way • equivalent to one physical pixel on a 160 dpi screen • px = dp * (dpi / 160) • system transparently handles any scaling of the dp units

Slide 58

Slide 58 text

Android UI fundamentals Best practices • Do not use hard-coded pixel values in your application code • Use size and density-specific resources • Use wrap_content, match_parent, or the dp unit for layout dimensions • Test Your Application on Multiple Screens

Slide 59

Slide 59 text

Android resources

Slide 60

Slide 60 text

Resources Android supports the externalization of resources • strings, colors, images, themes, menus, layouts • system resources Why? • easier to maintain, update, and manage • easier to define alternative resource values for internationalization and to support variations in hardware

Slide 61

Slide 61 text

res/ & R res/ • Generated by ADT Wizard • Each resource type is stored in a different subfolder R.java • Resources from /res are „indexed“ by ADT or aapt tool • Enables to reference resources in code

Slide 62

Slide 62 text

Default v. Alternative Resources • For any type of resource, we can specify default and multiple alternative resources • Default resources are used regardless of the device configuration when no alternative resources match the current configuration • Alternative resources are designed for use with a specific configuration

Slide 63

Slide 63 text

How to specify Alternative Resources • Create a new directory in res/ • res/- • specifies a configuration for which these resources are to be used • Save your alternative resources in new directory and name it as the default resource files

Slide 64

Slide 64 text

Resource types • Layouts • Simple values – Strings – Plurals – Colors – Dimensions – Styles – String or integer arrays Stored within XML files in the res/values folder

Slide 65

Slide 65 text

Resource types Styles and Themes • Let your applications maintain a consistent look and feel by enabling you to specify the attribute values used by Views • The most common use of is to store the colors and fonts for an application

Slide 66

Slide 66 text

Building User Interfaces

Slide 67

Slide 67 text

View View • base class for all visual interface elements controls, widgets • an object that draws something on the screen that the user can interact with View Group • extends View class • an object that holds other Views 
 View group is an invisible container that organizes child views, while the child views draw some part of the UI

Slide 68

Slide 68 text

Android Layouts • A layout defines the visual structure for a user interface, such as the UI for an activity or app widget. • Can be defined in XML or programmatically during runtime. • XML layouts stored in res/ layout folder and are qualified as resource

Slide 69

Slide 69 text

Layout Advantages of declaring UI in XML • Separation of the presentation from the code that controls its behavior • modify UI without having to modify source code • create XML layouts for different screen orientations, different device screen sizes, and different languages • Easier to visualize the structure of your UI • Easier to design/debug UI • Visualizer tool (ADT)

Slide 70

Slide 70 text

Layout example ViewGroup View

Slide 71

Slide 71 text

Layout types LinearLayout • Aligns all children in a single direction - vertically or horizontally • All children are stacked one after the other • Layout weight (android:layout_weight) assigns an "importance" value to a view in terms of how much space is should occupy on the screen

Slide 72

Slide 72 text

LinearLayout

Slide 73

Slide 73 text

Layout types RelativeLayout • view group that displays child views in relative positions • can eliminate nested view groups and keep your layout hierarchy flat, that improves performance • specify the location of child objects relative to each other (child A to the left of child B) or to the parent

Slide 74

Slide 74 text

Basic widget toolbox

Slide 75

Slide 75 text

www.coursera.org www.edx.org www.udacity.com

Slide 76

Slide 76 text

76 https://www.udacity.com/course/ud853 http://developerstudyjams.com

Slide 77

Slide 77 text

No content

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

Countries Chapters Events 106 601 3222

Slide 80

Slide 80 text

gdgriga.lv

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

https://developers.google.com/groups/ Find us at

Slide 83

Slide 83 text

March 26th

Slide 84

Slide 84 text

19.00 - 19.15 - "Retrospective of GDG Riga in 2014” by http://ej.uz/GDG_Riga_One_Year 19.15 - 20.00 - "Innovations and the Digital World” by from Google Lithuania 20.00 - 20.15 - Coffee Pause 20.15 - 21.00 - "Coolest Android gadgets of 2014!” by from kursors.lv

Slide 85

Slide 85 text

May 28 - 29, 2015 https://events.google.com/io2015/

Slide 86

Slide 86 text

May 28 - 29, 2015 https://www.youtube.com/watch?v=ksvdvCDO7pA

Slide 87

Slide 87 text

No content