The document discusses location APIs and services in Android. It covers determining the device's location using providers like GPS and networks, accessing location data through the LocationManager class, selecting providers with criteria, permissions needed, and displaying locations on maps using Google Maps APIs.
Lecture 5: Storage: Saving Data Database, Files & PreferencesAhsanul Karim
This slide is made for Shikkhok.com Android course. To get the video lectures visit: http://www.shikkhok.com/%E0%A6%95%E0%A7%8B%E0%A6%B0%E0%A7%8D%E0%A6%B8-%E0%A6%A4%E0%A6%BE%E0%A6%B2%E0%A6%BF%E0%A6%95%E0%A6%BE/android-app-development/
Acrhitecture deisign pattern_MVC_MVP_MVVMDong-Ho Lee
Look over MVC, MVP, MVVM pattern in android.
and introduce android data binding library.
You can follow this with simple project.
https://github.com/withleedh/patternChat
References
https://realm.io/kr/news/eric-maxwell-mvc-mvp-and-mvvm-on-android/
This Presentation will give u information about Android :
1. Geocoding and Location Based Services Maps Finding Current Location Using Geocoder to get the current address of the user Plotting the current location on map
Lecture 5: Storage: Saving Data Database, Files & PreferencesAhsanul Karim
This slide is made for Shikkhok.com Android course. To get the video lectures visit: http://www.shikkhok.com/%E0%A6%95%E0%A7%8B%E0%A6%B0%E0%A7%8D%E0%A6%B8-%E0%A6%A4%E0%A6%BE%E0%A6%B2%E0%A6%BF%E0%A6%95%E0%A6%BE/android-app-development/
Acrhitecture deisign pattern_MVC_MVP_MVVMDong-Ho Lee
Look over MVC, MVP, MVVM pattern in android.
and introduce android data binding library.
You can follow this with simple project.
https://github.com/withleedh/patternChat
References
https://realm.io/kr/news/eric-maxwell-mvc-mvp-and-mvvm-on-android/
This Presentation will give u information about Android :
1. Geocoding and Location Based Services Maps Finding Current Location Using Geocoder to get the current address of the user Plotting the current location on map
How to use geolocation in react native appsInnovationM
Geolocation will find your current location and Geocoding gives your address (like City Name, Street Name, etc) by Coordinates (Latitude and Longitude).
What is Geolocation?
The most famous and familiar location feature — Geolocation is the ability to track a device using GPS, cell phone towers, WiFi access points or a combination of these. Since devices area unit employed by people, geolocation uses positioning systems to trace associate degree individual’s whereabouts right down to latitude and great circle coordinates, or more practically, a physical address. Both mobile and desktop devices can use geolocation.
Geolocation is accustomed to confirm zone and actual positioning coordinates, like for chase life or shipment shipments.
Flutter workshop @ bang saen 2020 on 26-28 Oct 2020 at The 90's Workplace see more example in github repository https://github.com/anoochit/flutter_bangsaen_2020
1. 4
Location API
Anuchit Chalothorn
anoochit@gmail.com
Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
2. Determine the current location
Most Android devices allow to determine the
current geolocation. This can be done via a
GPS (Global Positioning System) module, via
cell tower triangulation or via wifi networks.
Ref: http://developer.android.com/guide/topics/location/index.html
3. Location Manager
The LocationManager class provides access to
the Android location service. This services
allows to access location providers, to register
location update listeners and proximity alerts
and more.
4. LocationProvider
The LocationProvider class is the superclass of
the different location providers which deliver the
information about the current location. This
information is stored in the Location class.
5. LocationProvider
LocationProvider Description
network Uses the mobile network or WI-Fi to determine the best location. Might have
a higher precision in closed rooms then GPS.
gps Use the GPS receiver in the Android device to determine the best location
via satellites. Usually better precision than network.
passive Allows to participate in location of updates of other components to save
energy
6. Selecting LocationProvider via Criteria
For a flexible selection of the best location
provider use a Criteria object, in which you can
define how the provider should be selected.
7. Permission
If you want to access the GPS sensor, you
need the ACCESS_FINE_LOCATION
permission. Otherwise you need the
ACCESS_COARSE_LOCATION permission.
8. Prompt the user to Enabled GPS
LocationManager service = (LocationManager) getSystemService
(LOCATION_SERVICE);
boolean enabled = service
.isProviderEnabled(LocationManager.GPS_PROVIDER);
if (!enabled) {
Intent intent = new Intent(Settings.
ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(intent);
}
9.
10. Workshop: Get current location
Use criteria find the best provider then get
current position from it.
LocationManager locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = locationManager.getBestProvider
(criteria, true);
Location location = locationManager.getLastKnownLocation
(provider);
float lat = (float) location.getLatitude();
float lon = (float) location.getLongitude();
13. Google Maps
Google provides via Google play a library for
using Google Maps in your application. The
following description is based on the Google
Maps Android API v2 which provides significant
improvements to the older API version.
Ref: https://developers.google.com/maps/documentation/android/
14. Getting the Google Map key
To use Google Maps you need to create a valid
Google Maps API key. The key is free, you can
use it with any of your applications that call the
Maps API, and it supports an unlimited number
of users.
15.
16.
17.
18. SHA-1 for your signature key
keytool -list -v -alias androiddebugkey -
keystore ~/.android/debug.keystore -
storepass android -keypass android
19.
20.
21. Work with Google Map
● Register your app and sha1 for publish
keystore and debug keystore
● Import Google Play Service library
● Add some permission and information
● Add MapView to layout
● then coding
22. MapView
The library provides the com.google.android.
gms.maps.MapFragment class and the
MapView class for displaying the map
component.
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />