美文网首页
讲解:G53MDP、Running Tracker、Java、J

讲解:G53MDP、Running Tracker、Java、J

作者: huobaishi | 来源:发表于2020-01-09 09:27 被阅读0次

    G53MDP Coursework 2 – Running TrackerSummaryIn this exercise you are required to build an Android running tracking application, anddocument its design and architecture in a report. This is an assessed exercise and will accountfor 40% of your final module mark. This is an individual coursework, and your submissionmust be entirely your own work – please pay particular attention to the section of thisdocument regarding plagiarism. This is a sizeable and open-ended coursework compared tothe previous assessed exercises. This document sets out general requirements that yourapplication should meet rather than specific instructions.Your application and report should be submitted no later than:• 3pm on Monday the 13th of January 2020Submissions should be made electronically via Moodle. Standard penalties of 5% per workingday will be applied to late submissions.Your coursework should be submitted as a .zip or .tar.gz file containing your report andapplication, including all relevant source code, configuration and related files, and a compiled.apk file – i.e. the contents of the directory containing your Android Studio project. Do notsubmit RAR files.SpecificationThe Quantified Self or life-logging movement has been around for a number of years, butadvances in mobile and wearable computing have increased the ability of people to collectdata about their physical activities. The most common of these track activity as it happens forfitness, health or gamification purposes, for example displaying comparisons with previousactivities, keeping track of best time or longest distances etc.ApplicationThe goal of this coursework is to design and implement a mobile application that functions asa basic Running Tracker, in that it should allow the user to track their movement when theydecide to walk, run or jog, principally by logging the change in physical location using GPS.The application should allow the user to inspect this data in a useful manner. The user mightexpect to want to be able to ask simple questions of the data such as “how far have I run sofar today?”, “how far have I run this month?” or “have I run faster than my best time today?”.The application should allow the user to annotate their data. They might expect to be able totag a particular exercise activity as good, or bad, or note something about the weatherconditions, or they might want to associate a photograph with the exercise activity.At the minimum, your application should support:• Logging the movement of a user when they go running or walking• Saving the movement data in an appropriate manner• Allowing the user to inspect their data in an appropriate manner• Allowing the user to annotate their data in a useful mannerHow you approach building this application is up to you, however in principle appropriate useof all four major Android application components is expected:• Activity• Service• Content Provider• Broadcast ReceiverFor this reason, it is important to consider how the task can be broken down into multipleatomic components, how they communicate with one another, and how their variouslifecycles should interact. There is no requirement that your components will be accessed bycomponents outside of the application, however it is good practice to consider how yourcomponents might be made available to other processes for subsequent reuse.Some hints and tips regarding getting started with location services / GPS monitoring areprovided below.Your application must be written in Java or Kotlin and make use of the Android SDK. Thereare no requirements to target a specific Android API version, however you can assume thatyour application will be tested on an emulated device (1080 x 1920 420dpi) running AndroidAPI version 29 (Android 10.0).Your application should have appropriate comments and variable / class names, so that areader can easily understand how it works at the code level.Adding further additional functionality to the application is encouraged, as are, for example,different interpretations of what it means to log running – you could consider walking, orother kinds of movement activity as might be measured by sensors on an Android device –however as always your application should meet the above specification primarily. Indeed,an appropriate interpretation of the app’s required functionality is an implicit part of thisassessment.ReportYou should provide a report alongside your application that documents its design andtechnical architecture, in particular providing a rationale for the components that you haveimplemented and their communication, and the behaviour of the application from the user’spoint of view.The report should be at minimum 1000 words long, with a maximum length of 1500 words.There is no set structure for the report, however you may wish to include a diagram showingthe components and their relationships, and a short explanation of each one, for examplehow the task is broken down into discrete Activity components, how and when Services arestarted, how data is abstracted from underlying storage etc.PlagiarismN.B. Use of third party assets (tutorials, images, example code, libraries etc.) MUST becredited and referenced, and you MUST be able to demonstrate that they are availableunder a license that allows their reuse.Making significant use of tutorial code while referencing it is poor academic practice, andwill result in a lower mark that reflects the significance of your own original contribution.Copying code from other students, from previous students, from any other source, orsoliciting code from online sources and submitting it as your own is plagiarism and will bepenalized as such. FAILING TO ATTRIBUTE a source will result in a mark of zero – and canpotentially result in failure of coursework, module or degree.All submissions are checked using both plagiarism detection software and manually forsigns of cheating. If you have any doubts, then please ask.Assessment CriteriaMarksAvailableApplication FunctionalityThe application meets the Activity Tracker specification, including noveltyand appropriateness40Application Structure and ImplementationImplementation and appropriate use of Android comp代做G53MDP留学生作业、代写Running Tracker作业、代写Java编程语言作业、代做Java实验作业 代写onents 30Programming styleThe application is easy to understand, with comments explaining eachpart of the code, correct formatting, and meaningful variable names10ReportDescription of the design and architecture 20Total 100Each element of your coursework will be assessed against the standard criteria:https://workspace.nottingham.ac.uk/display/CompSci/Marking+CriteriaThe following areas will be taken into account for each part of the assessment:• Demonstrating knowledge of the area• Quality of the concept, including appropriateness and novelty• Quality of the technological design, including appropriate use of software designconcepts, and appropriate good coding practice (abstraction, commenting, naming)• Quality of the realization, including how well it works and elaborations over and abovethe basic requirements• Including all of the above aspects, clarity of structure, quality of argument / evidence,and insight / noveltyHints and tipsUsing Location / GPS trackingThere are different mechanisms for obtaining the location of the device, including GPS, Wi-Fior cell-tower signal triangulation, and different mechanisms for how this data can be accessedby the device.Increasingly Android is attempting to push this functionality into Google Play services (givingGoogle more control over parts of the Android stack), and this provides a unified approachthat fuses multiple location systems into one to provide an abstraction over multiple piecesof hardware and to reduce battery usage. This requires making use of an emulator with theGoogle APIs installed – generally this will be a different emulator system image.https://developer.android.com/training/location/receive-location-updatesThere is, however, a simpler approach that is perfectly adequate for this coursework, and thatis to use the LocationManager system service to provide GPS (global positioning system)updates that reveal the user’s location.https://developer.android.com/reference/android/location/package-summary.htmlAccessing location requires permission from the user:import android.content.Context;import android.location.Location;import android.location.LocationListener;import android.location.LocationManager;The LocationManager is a system service, and so needs to be retrieved from the servicemanager via getSystemService. Then it can be passed an instance of a LocationListener thatwill receive updates from the GPS provider. The two other parameters specify the minimumfrequency of updates (i.e. we can say that we want at most 1 update every 5 seconds), anddistance between updates (i.e. we can say that we only want to be told when the device hasmoved at least 5 metres). The fastest update frequency for GPS is around 1 second, andaccuracy varies from a few metres upwards depending on environmental conditions.LocationManager locationManager =(LocationManager)getSystemService(Context.LOCATION_SERVICE);MyLocationListener locationListener = new MyLocationListener();try { locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,5, // minimum time interval between updates5, // minimum distance between updates, in metreslocationListener);} catch(SecurityException e) { Log.d(g53mdp, e.toString());}The MyLocationListener class receives these location events by implementing theLocationListener interface as follows:public class MyLocationListener implements LocationListener { @Override public void onLocationChanged(Location location) { Log.d(g53mdp, location.getLatitude() + + location.getLongitude()); } @Override public void onStatusChanged(String provider, int status, Bundle extras) { // information about the signal, i.e. number of satellites Log.d(g53mdp, onStatusChanged: + provider + + status); } @Override public void onProviderEnabled(String provider) { // the user enabled (for example) the GPS Log.d(g53mdp, onProviderEnabled: + provider); } @Override public void onProviderDisabled(String provider) { // the user disabled (for example) the GPS Log.d(g53mdp, onProviderDisabled: + provider); }}onProviderEnabled and onProviderDisabled methods are called when the user enables ordisables the GPS, and onStatusChanged gives information about the status of the GPS signal:https://developer.android.com/reference/android/location/LocationListener.htmlThe important method call is onLocationChanged, which reports the current location as it ismeasured, and provides a Location object that can be inspected to obtain WGS 84 latitude,longitude, altitude (elevation), reported accuracy of the signal etc.https://developer.android.com/reference/android/location/Location.htmlNote that geodesy and global positioning are incredibly complicated subjects in their ownright - the Earth is in no way perfectly spherical, and we like to think of linear distances on a locally flat surface as opposed to degrees around the world – however the Location class hidesmost of this from us. In particular the distanceTo method will calculate the distance betweentwo points given as latitude and longitude: float distance = myLocation.distanceTo(someOtherLocation);Emulating GPSIt is possible to complete this coursework entirely using the emulator – there is no advantageto or necessity of having a physical Android phone. There is also no expectation that youhandle the everyday practical details of GPS – losing signal, inaccurate signals etc. You canassume that it will be tested on an emulated device with “perfect” GPS.The emulator provides a mock GPS device that feeds NMEA (latitude and longitude positionupdates) to the phone where they will be handled by the LocationManager as if they werereal updates, via the extended controls menu. This can be found by clicking “…” on theemulator side bar.Furthermore, the emulator can replay a series of GPS events from a GPX file (a standard logformat for many GPS devices and applications). It is also possible to export from Google Mapsto GPX.Three example GPX files have been uploaded to Moodle for use as “real” latitude andlongitude positions that can be played out.转自:http://www.daixie0.com/contents/9/4659.html

    相关文章

      网友评论

          本文标题:讲解:G53MDP、Running Tracker、Java、J

          本文链接:https://www.haomeiwen.com/subject/myzeactx.html