Slide 1

Slide 1 text

Making the most of user data on Android Matt Oakes @matto1990 [email protected]

Slide 2

Slide 2 text

User data • Loads of data already on the phone to use • Its personal to the user • Contacts • Accounts • Relevant to now • Location • Calendar

Slide 3

Slide 3 text

Why bother? • Customise your app to the user from first run • Save the user time by predicting actions • Surprise them with what you know • (be careful not to scare them!)

Slide 4

Slide 4 text

Case Studies

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Some Basics

Slide 8

Slide 8 text

Intents

Slide 9

Slide 9 text

Explicit Intents • Every app uses them • Explicitly says what activity you want to go to • Should only be used internally in an app • Don’t use between apps

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Generic Intent • Can request other applications open • Opens the most relevant application • User can choose which they want to open if they have more than one • App can also get a result back for the opened application • You don’t even need to know what the application you’re opening is

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Web URLs • Can open one of your activities by going to a url • Will open if the user clicks a link in their browser (or another app) • Useful if you have a web version of your app that people might link to that you want the native app to take over from

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

OpenIntents.org

Slide 23

Slide 23 text

Magically getting emails

Slide 24

Slide 24 text

Why? • A lot of apps ask for email as a login • Email addresses are long and sometimes complicated! • Most users will already have an account signed in on the phone • You can therefore ask for access to their email addresses, and save them the typing

Slide 25

Slide 25 text

Shiny new way to do it • Available from 4.0 and up (ICS) • Phone profile • Permission required • android.permission.READ_PROFILE • Users will have to have filled out their profile. Which Android tries to get them to do on first startup

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

Pre-ICS Method • Available from 2.0 and up (Eclair) • As of 1st May 2012 that’s 99% of users • Account information is stored on the phone • Can read the name of the account, which is the email • Required permission • android.permission.GET_ACCOUNTS

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Sharing

Slide 37

Slide 37 text

Never roll your own • Android has an amazing sharing framework • Apps state that they are able to share data of a certain type • Twitter sharing text and images • Dropbox can handle any file or text • Other apps say they have data to share • The user is presented with a list of all apps that can handle that data • The apps they have installed are likely the only ones they care about

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Media • Photos for example • Can call other apps when you want users to pick media • Can get other apps to open your app to choose data from your service • Could be used if you have photos/video which isn’t on the device but the user might want

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

Content providers

Slide 52

Slide 52 text

What? • They provide access to content (durrr) • They can be used across applications • One app can provide data to another • They are used for data that’s built into Android • Messages • Contacts • Calendar • Media (Music, photos etc.)

Slide 53

Slide 53 text

Contacts

Slide 54

Slide 54 text

Contacts • You should use this whenever the user is entering the name or email of a friend • Saves them typing • They’re more likely to type people in if it’s easy • Can enhance the view with the friends profile picture

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

What the user sees A contact from an application Each piece of data is a row

Slide 59

Slide 59 text

Calendar • You know what the user is up (or meant to be) right now • Can use the event location to tailor data • Would be great for weather apps • Can tell users what the weather is at each of their events

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Location

Slide 64

Slide 64 text

Where art thou? • Can tailor search results based on the current location • Great for anything to do with local businesses or events • Really well used • Fairly tricky to do it right

Slide 65

Slide 65 text

Reto Meier - Deep dive into location http://goo.gl/NFDmW

Slide 66

Slide 66 text

Wrap up

Slide 67

Slide 67 text

Do it! • Lots of ways to get data • Tailor you app based on the users data • Tailor your app to current condition • Location • Even a barometer (?!?!?)

Slide 68

Slide 68 text

Matt Oakes @matto1990 [email protected] Example code on GitHub http://goo.gl/XfyMJ