28
DAY 3 Summary

Project a day 4 all

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 2: Project a day 4   all

This is our last day, and yesterday we talk about:

• Monetizing your app• Publishing your app

• Before you upload you APK

• Using Services in you app• What is a Service• Tell me something about Service priority• How do we start a service

• Cloud solutions• Training options

• Pluralsight• Coursera (this is what I’ve forgot yesterday)

2

Page 3: Project a day 4   all

Monetization strategy is important

3

Page 4: Project a day 4   all

Potential Revenues sources

• Pay-per download• In-app advertising• In-app purchase• Subscriptions• Affiliate sales

4

• Sponsorship• Promotions• Analytics

Page 6: Project a day 4   all

Before we start Day 4 lectures

• Let’s look at Eclipse IDE • How to import projects• What android device do you have???• What kind of device do you have

• http://developer.samsung.com/android/tools-sdks/Samsung-Andorid-USB-Driver-for-Windows

• How to use device to run app

6

Page 7: Project a day 4   all

DAY 4: Location Basics

Page 8: Project a day 4   all

Android location basics

• Accessing the location systems• Location providers and security• Handling location information• Receiving location updates• Getting a single location value

8

Page 9: Project a day 4   all

Accessing the location system

• Location manager is the root of the location system• Get current location• Monitor for changes in status of location hardware• Request notification when reaching a location• Exposed as system service• Use | Context.getSystemService (Context.LOCATION_SERVICE)

9

Page 10: Project a day 4   all

Selecting a location provider

• Global Positioning System (GPS)• LocationManager.GPS_PROVIDER• Satellite based• Extremely accurate (3 meters)• Very power intensive

• Network-based• LocationMAnage.NETWORK_PROVIDER• Uses a combination of known Wi-Fi hotspots and cellular towers• Accuracy varies (10m-1km)• Less power

10

Page 11: Project a day 4   all

Location is a secured service

• You must request permissions• How?

• Different permission depending on location accuracy• Course location providers

• Network provider is considered low-accuracy (a.k.a course)• Request ACCESS_COURSE_LOCATION permission

• Fine location providers• GPS provider is consider high-accuracy (a.k.a fine)• Request ACCESS_FINE_LOCATION• Fine location permission implies course

11

Page 12: Project a day 4   all

Location provided through callbacks

• Implement the LocationListener interface to receive updates

• OnLocationChanged• onProviderEnabled/onProviderDisabled• onStatusChanged

12

Page 13: Project a day 4   all

Understanding Location class

• Providers row location information• Core fields

• getLatitude, getLongitude, getAccuracy• Provides latitude/longitude and accuracy in meters

• Time• getTime (UTC)• getElapsedRealtimeNanos

• Added in Android 4.2

• Other information varies depending on provider• getSpeed, getAltitude ( use has method to check)

13

Page 15: Project a day 4   all

Steps to receive location updates

• Request a reference to location service• Create instance of LocationListener implementation• Call the location service’s requestLocationUpdates method

15

Page 16: Project a day 4   all

Getting a single location value

• Getting a single location value quickly• LocationManage.getLastKnownLocation• Immediately returns the last Location received by the provider

• Getting a single, current location value• Locationmanage.requestSingleUpdate• Uses callback model like requestLocationUpdates• To run callback on main thread, pass null as the 3rd (Looper) parameter

16

Page 17: Project a day 4   all

Summary

• The LocationManage is exposed as a system service• Location Providers offer varaying features

• GPS• Network

• Location requires appropriate security privilages• Implement LocationListener interface to receive location callbacks• Location class contains raw details• Get single location quickly with getLastKnownLocation (watch the

time)

17

Page 19: Project a day 4   all

And now – THE TEST

• Just a few questions from summaries

19

Page 21: Project a day 4   all

DEMO

• We did the talk yesterday

21

Page 22: Project a day 4   all

Workshop Evaluation

• Why it is so important• What you need to pay attention to

22

Page 23: Project a day 4   all

Do we have time to look into progress bars

• Let check documentation

23

Page 24: Project a day 4   all

How can you connect with me

• Twitter: @gdjonovic – fastest way to ask question and get answer• Email: djonovic.g@gmail – send me an email to get material• LinkedIn: http://www.linkedin.com/in/gdjonovic• Slide share: http://www.slideshare.net/gorandjonovic• Git hub: https://github.com/gdjonovic• Blog: http://gdjonovic.me/ - fresh

24/13

Page 25: Project a day 4   all

Farewell speech

• You are smart – Question everything• Solve problems • Be passionate• Go out your comfort zone – grow• Share your knowledge• Learn true value

25