Android Accessing GPS Ken Nguyen Clayton State University 2012.

Slides:



Advertisements
Similar presentations
Android Application Development Tutorial. Topics Lecture 6 Overview Programming Tutorial 3: Sending/Receiving SMS Messages.
Advertisements

Android Application Development Tutorial. Topics Lecture 4 Overview Overview of Sensors Programming Tutorial 1: Tracking location with GPS and Google.
Introducing to Location in Android LOCATION IS EVERYTHING Kamil Lelonek Kamil Lelonek
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Location & Maps.  Mobile applications can benefit from being location-aware, e.g.,  Routing from a current to a desired location  Searching for stores.
Android wifi-based localization. Localization types Android allows (location providers) – GPS (GPS_PROVIDER) – Cell tower + wifi (NETWORK_PROVIDER) You.
Location and Maps Content Getting Location Getting Google Map In application Test on Emulator/Device.
6: Getting Started with Android. Android Android Inc. was initially started in 2003 It was acquired by Google in 2005 The hardware side of Android is.
Cosc 5/4730 GPS/Location android.location. Simulator notes All the simulators can simulator GPS/location information – Android DDMS commands (geo) to.
@2011 Mihail L. Sichitiu1 Android Introduction Hello World.
Android Application Development Tutorial. Topics Lecture 5 Overview Overview of Networking Programming Tutorial 2: Downloading from the Internet.
Data Storage: Part 1 (Preferences)
Map Applications.
Android Sensors & Async Callbacks Jules White Bradley Dept. of Electrical and Computer Engineering Virginia Tech
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Developing Push Notifications (C2DM) for Android Vijai Co-Founder Adhish Technologies, Sweet’N’Spicy apps.
 Understanding an activity  Starting an activity  Passing information between activities  Understanding intents  Understanding the activity lifecycle.
Location Services: Part 1 (Location and Geocoding)
Mobile Programming Lecture 9 Bound Service, Location, Sensors, IntentFilter.
1 Localization and Sensing Nilanjan Banerjee Mobile Systems Programming (Acknowledgement: Jules White) University of Arkansas Fayetteville, AR
Mobile Programming Lecture 16 The Facebook API. Agenda The Setup Hello, Facebook User Facebook Permissions Access Token Logging Out Graph API.
Android Tutorial Team 3 Jerry Yu Mayank Mandava Mu Du Will Wangles.
Location based services
CSS216 MOBILE PROGRAMMING Android, Chapter 8 Book: “Professional Android™ 2 Application Development” by Reto Meier, 2010 by: Andrey Bogdanchikov (
Android Activities 1. What are Android Activities? Activities are like windows in an Android application An application can have any number of activities.
1 CMSC 628: Introduction to Mobile Computing Nilanjan Banerjee Introduction to Mobile Computing University of Maryland Baltimore County
Context Aware Location Nasrullah. Location Basics LocationManager—Class providing access to Android system location services LocationListener—Interface.
Threads and Services. Background Processes One of the key differences between Android and iPhone is the ability to run things in the background on Android.
Location. GPS Global Positioning System – At least 4 satellites typically used 3 required extra for error detection and altitude typically accurate within.
Maps Dr. David Janzen Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Android Boot Camp Demo Application – Part 1. Development Environment Set Up Download and install Java Development Kit (JDK) Download and unzip Android.
Android Using Menus Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC. ISBN:
Android Application Lifecycle and Menus
Sensors – Part 2 SE 395/595. Location in Android LocationManager class – Configure providers and their listeners LocationListener class – Handles update.
Android and s Ken Nguyen Clayton state University 2012.
TCS Internal Maps. 2 TCS Internal Objective Objective :  MAPS o Integration of Maps.
Android Alert Dialog. Alert Dialog Place Button to open the dialog. public class MainActivity extends ActionBarActivity { private static Button button_sbm;
Lecture 4: Sensors Topics: Motion, Position, and Environmental Sensors Date: Feb 11, 2016.
Cosc 4735 LocationAware API. Previous on … Before we looked at GPS location. – d-gpslocation.pptx
Event-driven design will set you free The Observer Pattern 1.
Mobile Programming Lecture 4 Resources, Selection, Activities, Intents.
David Sutton SMS TELEPHONY IN ANDROID. OUTLINE  This week’s exercise, an SMS Pub Quiz  Simulating telephony on an emulator  Broadcast Intents and broadcast.
GPS and MapView. First In the emulator, set the time zone to something (e.g., east coast) and check that the time is correct. Otherwise, the gps emulator.
Lecture 5: Location Topics: Google Play Services, Location API Date: Feb 16, 2016.
School of Engineering and Information and Communication Technology KIT305/KIT607 Mobile Application Development Android OS –Permissions (cont.), Fragments,
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
1. 2 Android location services Determining a device’s current location Tracking device movements Proximity alerts.
CS499 – Mobile Application Development Fall 2013 Location & Maps.
Lecture 5: Location Topics: Google Play Services, Location API
Android Introduction Hello World
Lecture 5: Location Topics: Google Play Services, Location API.
UNIT 11 로봇 전화번호부 3/4 로봇 SW 콘텐츠 교육원 조용수.
GUI Programming Fundamentals
Android – Event Handling
Android Introduction Hello World.
Designing Apps Using The WebView Control
Sensors, maps and fragments:
Picasso Revisted.
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Activities and Intents
Activities and Intents
CIS 470 Mobile App Development
CIS 470 Mobile App Development
Lecture 5: Location Topics: Google Play Services, Location API.
ארועים ומאזינים android.
Mobile Programming Gestures in Android.
Maps, Geocoding, and Location-Based Services.
Activities and Fragments
Presentation transcript:

Android Accessing GPS Ken Nguyen Clayton State University 2012

Settings/ Manifest Add uses permission to allow access to device component and services Emulator:  mock location data by Window  Show View  Other  Android  Emulator Control – In Emulator Control panel enter the GPS coordinates under Location Controls and press Send Ex: (both satellite and cell towels) –

Creating a Location Aware Activity public class MainActivityGPS extends Activity implements LocationListener{ private LocationManager mgr; private TextView output; private String public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main_activity_gps); mgr = (LocationManager) getSystemService(LOCATION_SERVICE); output = (TextView) findViewById(R.id.output); log("Location providers:"); dumpProviders(); //helper method to display the data

The following methods must be implemented for LocationListener Criteria c = new Criteria(); best = mgr.getBestProvider(c, true); //helper method to display the data log("\nBest provider is:" + best); log("\nLocation (starting with last known):"); if(best != null){ Location loc = mgr.getLastKnownLocation(best); log(loc.toString()); }

private void dumpProviders() { List providers = mgr.getAllProviders(); for(int i = 0 ; i < providers.size(); i++){ log(providers.get(i).toString()); } private void log(String string) { output.append(string); } //required public void onLocationChanged(Location location) { log("\n" + location.toString()); } //required public void onStatusChanged(String provider, int status, Bundle extras) { log("\n" + lprovider.toString()); }

Suggested apps Build an app to log the GPS coordinates of the device The app must have – Start/stop/pause – Export / coordinates – Map coordinates – Clear/reset