Download presentation
Presentation is loading. Please wait.
1
3 rd -party APIs Kalin Kadiev Astea Solutions AD
2
LocationManager Provides ability to: get the last known location register for periodic location updates register for proximity alerts Needed permissions in AndroidManifest: android.permission.ACCESS_COARSE_LOCATION android.permission.ACCESS_FINE_LOCATION
3
LocationManager Getting the best provider for a criteria GPS Network Other? Provider differences Accuracy Battery usage Latency
4
Google Maps General stuff 3rd party - Google does not guarantee every android device has maps library. Not open source Hardly customizable You can't see the source Does not work without MapActivity Only one MapActivity per process You should be able to use a WebView with a map instead
5
apk build process aidl javac aapt apkbuilder → jarsigner → zipalign
6
apk signing Signing the app with your certificate's private key identifies the app developer The private key is secured in a keystore This keystore's fingerprint is used to generate the Google Maps АPI key
7
MapView Extend MapActivity In your layout, put MapView as a top-level component Provide the generated API key
8
Controlling the MapView setBuiltInZoomControls setZoom setCenter zoomInFixing, zoomOutFixing zoomToSpan
9
Adding overlays Extend ItemizedOverlay Fill the overlay with OverlayItem objects Override ItemizedOverlay.onTap to handle tapping Use ItemizedOverlay.addOverlay(OverlayItem) MapView.getOverlays.add(ItemizedOverlay)
10
Geocoding Geocoding - transforming a street address or other description of a location into a (latitude, longitude) coordinate. Reverse geocoding - transforming a (latitude, longitude) coordinate into a (partial) address.
11
Geocoding With Android's Geocoder getFromLocation getFromLocationName With Google services http://maps.googleapis.com/maps/api/geocode/output?parameters See the limitations first!
12
NFC What is NFC? A set of short-range wireless technologies, which allow you to share small payloads of data between an NFC tag (unpowered NFC chip) and an Android- powered device, or between two Android-powered devices.
13
NFC So what? Enables secure contactless payments Does not need 2 powered devices Does not need pairing (as in Bluetooth)
14
NFC in Android Android parses the scanned NFC tag and figures out the MIME type or a URI. Android encapsulates the MIME type or the URI and the payload in an intent. The activity that can handle the intent is being started.
15
Handling NFC intents Requirements permission “android.permission.NFC” platform “minSdkVersion=10” feature “android.hardware.nfc” Add intent filter to your activity for the MIME type or the URI. In your onResume(), handle the intent.
16
OAuth – what is it? A standard for authorization. Allows sharing a limited set of your private data to 3rd-party apps without sharing your credentials with it.
17
Facebook integration Create a Facebook app. Get the Facebook development kit. Depend on it. Authenticate. Use the Graph API Hold your token!
18
Twitter integration No specific Android library, a Java one instead. Put the.jar into your /libs and depend on it. Possibly wrap the requests in AsyncTasks The rest is quite similar to Facebook.
19
Q&A + Feedback Questions? Feedback section: – Did you hear well? – Was there anything you didn’t understand? – What would you like changed in our next lecture?
20
Recommended resources Location Tutorial LocationManager MapView Tutorial Obtaining Maps API key Geocoder Google Geocoding API NFC in Android OAuth Facebook, Twitter4J FacebookTwitter4J
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.