social network twitter hashtag: #m2eu #android personal twitter: @rallat israel ferrer - @rallat –...
TRANSCRIPT
![Page 1: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/1.jpg)
Social networkTwitter Hashtag: #m2eu #android
Personal twitter: @rallat
Israel Ferrer - @rallat – [email protected]
![Page 2: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/2.jpg)
Who am I?
Israel Ferrer Camachoco-founder and.roid.es & bubiloop.comBusiness Developer at bubiloop.comAndroid Developer
Trovit homes: http://bblp.to/10rNand.roid.es news: http://bblp.to/11E6Rac1: http://bblp.to/10uhBubiloop recommender: http://bblp.to/11Hg Working on salir.com app
Israel Ferrer - @rallat – [email protected]
![Page 8: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/8.jpg)
Androides Barcelona 2010
Co-founder of Barcelona Android dev group
Israel Ferrer - @rallat – [email protected]
![Page 11: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/11.jpg)
Location and Maps in Android
Israel Ferrer CamachoJune 17, 2010
Israel Ferrer - @rallat – [email protected]
![Page 13: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/13.jpg)
Agenda
Israel Ferrer - @rallat – [email protected]
Google Maps in Android
Location in Android
Show me the code
Questions
![Page 14: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/14.jpg)
Google Maps in AndroidGoogle Maps is an external library to the Android
SDK.
Israel Ferrer - @rallat – [email protected]
Features Google Maps Google Maps Android
World Maps
Mode Sat/Street View/Traffic
Places content
Compass
![Page 15: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/15.jpg)
Google Maps in AndroidGeoPoint: longitude/latitude stored as
integer in microdegrees (degrees * 1E6)
Overlay: Base class representing an overlay which may be displayed on top of a map
OverlayItem: The basic component of any ItemizedOverlay.
ItemizedOverlay: A base class for an Overlay which consists of a list of OverlayItems
Israel Ferrer - @rallat – [email protected]
![Page 16: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/16.jpg)
Google Maps in AndroidMapActivity: Base class with code to manage
the boring necessities of any activity that displays a MapView
MapView: A View which displays a map (with data obtained from the Google Maps service).
MapController: A utility class to manage panning and zooming of a map.
MyLocationOverlay: An Overlay for drawing the user's current location (and accuracy) on the map, and/or a compass-rose inset.
Israel Ferrer - @rallat – [email protected]
![Page 17: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/17.jpg)
Google Maps in Android¿What?
We can show custom markers with info at someplace in a map
¿How?PrerequisitesShow the map using MapViewCreate our custom marker classMapActivity:
Add marker to our located overlaysAdd this located overlays to our MapView
Israel Ferrer - @rallat – [email protected]
![Page 18: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/18.jpg)
Prerequisites
Create an Android project with Google APIs support
Israel Ferrer - @rallat – [email protected]
![Page 19: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/19.jpg)
PrerequisitesManifest Permissions:
Add permission to use Google Maps external library
<uses-library android:name="com.google.android.maps" />
Add permission to use Internet
<uses-permission android:name="android.permission.INTERNET" />
Google Maps API key for mobile:http://tinyurl.com/androidkeyapi
Israel Ferrer - @rallat – [email protected]
![Page 22: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/22.jpg)
MyLocationOverlayThis object create an overlay that shows your
location.
![Page 23: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/23.jpg)
Custom MarkerObject that extends ItemizedOverlay
Object is initialize with a Drawable our custom marker
![Page 24: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/24.jpg)
Custom MarkerPopulate our custom marker ItemizedOverlay
with OverlayItems
Finally, add our custom marker Overlay to MapView Overlays
![Page 27: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/27.jpg)
Location in Android¿What?
Location-based services are technique to figure out where you are
¿How?PrerequisitesLocation ManagerLocation Listener
Israel Ferrer - @rallat – [email protected]
![Page 28: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/28.jpg)
Prerequisites
Manifest PermissionsGPS Location
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
Network Location
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Israel Ferrer - @rallat – [email protected]
![Page 29: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/29.jpg)
Location
Manager
Location-Based Services (LBS) are handle using the LocationManager
Two Location providers in Android: GPS, Network
Define Criteria object to obtain the best provider
Israel Ferrer - @rallat – [email protected]
![Page 30: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/30.jpg)
Location
Manager
One we get the best provider is time to get locationGet last know location
Get the location changesRequest Location Manager this updates
Israel Ferrer - @rallat – [email protected]
![Page 31: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/31.jpg)
Location Listener Used for receiving notifications from the LocationManager
when the location has changed
Israel Ferrer - @rallat – [email protected]
![Page 33: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/33.jpg)
Maps and LocationEasy to use in your apps
Once we’ve got the location, we can show data on the map just with the method update(location) to refresh de UI
Israel Ferrer - @rallat – [email protected]
![Page 34: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/34.jpg)
Q&AAll the source from this session is in
http://bblp.to/mobile20
Questions?
Israel Ferrer - @rallat – [email protected]
![Page 35: Social network Twitter Hashtag: #m2eu #android Personal twitter: @rallat Israel Ferrer - @rallat – israel@bubiloop.com](https://reader036.vdocuments.us/reader036/viewer/2022062409/56649e535503460f94b492ec/html5/thumbnails/35.jpg)
ThanksTwitter: @rallat
Mail: [email protected]
Projects: bubiloop.com & and.roid.es
Israel Ferrer - @rallat - [email protected]