联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2019-05-25 11:15

Assignment 2 – FedUni ISS Tracker

Due Date: 11:55pm, Sunday, 2nd June (end of Week 11)

This assignment will test your Android development skills and is worth 20% (Type A) of your overall course mark.

Android Development


This assignment requires you to develop a simple Android application which uses Google Maps, location services, and sensors. To write the application you will need to use the Android Studio Integrated Development Environment (IDE).

Your application must perform all tasks listed in this document and be capable of running on any Android device with a minimum API version of 23 (i.e. Android 6.0 "Marshmallow") up to the latest version of Android.

Your application should be created to display correctly on an emulated Google Pixel device (1080x1920 pixels in portrait orientation) - however, by using a ConstraintLayout the application should also be able to display correctly on any Android device with any sized screen and resolution.

Do not add any additional activities or features that are not outlined by the specifications to follow. You will not be marked higher for additional functionality, instead you may be penalized for not matching the program specifications!

此作业要求您开发一个使用Google地图,位置服务和传感器的简单Android应用程序。 要编写应用程序,您需要使用Android Studio集成开发环境(IDE)。

您的应用程序必须执行本文档中列出的所有任务,并且能够在最低API版本为23的任何Android设备(即Android 6.0“Marshmallow”)上运行,直到最新版本的Android。

您的应用程序应创建为在模拟的Google Pixel设备上正确显示(纵向1080x1920像素) - 但是,通过使用ConstraintLayout,应用程序还应能够在任何具有任何大小的屏幕和分辨率的Android设备上正确显示。

请勿添加要遵循的规范未列出的任何其他活动或功能。 您不会因为其他功能而被标记为更高,相反,您可能会因为不符合程序规范而受到处罚!

Plagiarism Policy


The Federation University policy on plagiarism can be found at the following location: http://policy.federation.edu.au/university/student_plagiarism/ch01.php


I highly recommend that you familiarise yourself with what is and what is not considered plagiarism, but I'll summarise the key aspects below:

Do NOT share code with fellow students. I mean it. These are individual assignments, not group projects. If the same code is found in multiple students’ projects, you’ll be called in for a chat and risk getting zero for the assignment and having a plagiarism flag put on your record.


You may, and are in fact encouraged to, discuss the project with your fellow students. The goal being that you understand how to create good, high-quality Android applications – and that understanding then flows into the exams where you'll be asked questions on Android application development. Just don't share projects/code – code it yourself, learn from your mistakes, and become a great developer.


Application Specification

Project Settings

Your Android application should have the following settings:

Minimum SDK: API 23

Target / Compilation SDK: API 28

Project/Application Name: FedUni ISS Tracker <YOUR_STUDENT_ID_NUMBER>

For example, FedUni Reddit Client 12345678

Company URL: au.edu.federation.itech3107.feduniisstracker<YOUR_STUDENT_ID>

For example, this would make the package name: au.edu.federation.itech3107.feduniisstracker12345678

Application Description

Your assignment is to write an Android application which will display the current location of the International Space Station (ISS) on a map, along with the location of the device itself. The app should utilise sensors so that the user can scroll the map by tilting the phone (e.g. phone tilts left, map scrolls left). The position of the ISS will be updated on a button click. In addition to the map, the latitude and longitude of both the ISS and device should be displayed in text form, the timestamp of when the ISS location was last updated, the current address of the device, and the distance (in km) between the device and the ISS.


Setting up the project

For this assignment, you should create a new project with the Google Maps Activity template (see Week 8). Follow the instructions in app > values > google_maps_api.xml to obtain a Google Maps API key. Once the key is generated you copy and paste it into the string resource “google_maps_key” – the one that has the default of “YOUR-KEY-HERE”. Once you do that and run the app on your device or even in the emulator, it will open to a map with a marker at Sydney.

You will also need to add Google Play Location Services into build.gradle:

implementation 'com.google.android.gms:play-services-location:16.0.0'


Layout

You will need to create a new layout (ConstraintLayout is recommended) and embed the map in it. You can add a map fragment to a layout as follows:  

您需要创建一个新布局(建议使用ConstraintLayout)并将地图嵌入其中。 您可以将地图片段添加到布局,如下所示:

<fragment

   android:id="@+id/map"

   android:name="com.google.android.gms.maps.SupportMapFragment"

   android:layout_width="0dp"

  android:layout_height="0dp"

   app:layout_constraintBottom_toBottomOf="parent"

   app:layout_constraintEnd_toEndOf="parent"

   app:layout_constraintStart_toStartOf="parent"

   app:layout_constraintTop_toTopOf="parent" />


Don’t forget to update the setContentView() method in onCreate() to point to the new layout. Leave the default code generated by the Map Activity template – you don’t need to do anything else with fragments to complete this assignment (fragments are covered in ITECH3106).

不要忘记更新onCreate()中的setContentView()方法以指向新布局。 保留Map Activity模板生成的默认代码 - 您无需对片段执行任何其他操作即可完成此分配(ITECH3106中介绍了片段)。

Activity 1 – The MapsActivity

This assignment requires only a single Activity, though you may be required to create additional classes to achieve the required functionality. The layout of the MapsActivity is displayed in Figure 1. It consists of the map (taking up half the height), several TextViews, and a button.

此分配只需要一个Activity,但您可能需要创建其他类来实现所需的功能。 MapsActivity的布局如图1所示。它由地图(占据一半高度),几个TextView和一个按钮组成。


Figure 1: The layout of MapsActivity.

Map

When the application is first loaded, the map should be loaded too (using the default code provided by the Map Activity template – though you should remove the default Sydney marker!). You are expected to do some additional research into the use of maps within Android in order to move the map when sensor events occur, and to display markers with custom icons.

首次加载应用程序时,也应该加载地图(使用Map活动模板提供的默认代码 - 尽管您应该删除默认的Sydney标记!)。 您需要对Android中的地图使用进行一些额外的研究,以便在传感器事件发生时移动地图,并显示带有自定义图标的标记。


Scrolling the map with sensors

A key feature of the app is that the map can be scrolled/moved by tilting the device. For example, assume the map state is currently identical to the map shown in Figure 2. If the device is tilted to the left and forward, the map should start scrolling towards India and Thailand. If the device is tilted downwards, the map should scroll towards Antarctica. When the device is placed onto a flat surface, the map should stop scrolling altogether.

To achieve this behaviour you will need to make use of sensors (see Week 7). The Android emulator comes with a suite of virtual sensors that you can use to test sensors such as accelerometer, ambient temperature, magnetometer, proximity, light, and more. There are detailed instructions available in the Android docs: https://developer.android.com/studio/run/emulator.html#extended.

该应用程序的一个关键功能是可以通过倾斜设备来滚动/移动地图。 例如,假设地图状态当前与图2中所示的地图相同。如果设备向左和向前倾斜,则地图应开始向印度和泰国滚动。 如果设备向下倾斜,地图应滚动到南极洲。 将设备放置在平坦表面上时,地图应完全停止滚动。

要实现此行为,您需要使用传感器(请参阅第7周)。 Android模拟器附带一套虚拟传感器,可用于测试传感器,如加速度计,环境温度,磁力计,接近度,光线等。 Android文档中提供了详细说明:https://developer.android.com/studio/run/emulator.html#extended。


Figure 2: A closer look at the map.

Refresh Button

The interface contains one button – “Refresh” (see Figure 1). When this button is clicked, it should trigger several behaviours in the app:

The current location of the ISS should be obtained from the API (specified in the next section). Once the location has been obtained, it should be plotted onto the map using a custom marker. The latitude, longitude and timestamp should also be displayed in the appropriate TextViews.

界面包含一个按钮 - “刷新”(参见图1)。 单击此按钮时,它应在应用程序中触发多个行为:

ISS的当前位置应从API获得(在下一节中指定)。 获得位置后,应使用自定义标记将其绘制到地图上。 纬度,经度和时间戳也应显示在相应的TextView中。


The current location of the device should be obtained using the location manager. Another marker should be added to the map to display the current location of the user, and the latitude and longitude updated in the relevant TextView. The current address of the user should be displayed in the relevant TextView (suburb and country is enough).


Use the following code to convert the timestamp into a readable format:

应使用位置管理器获取设备的当前位置。 应将另一个标记添加到地图中以显示用户的当前位置,并在相关TextView中更新纬度和经度。 用户的当前地址应显示在相关的TextView中(郊区和国家就足够了)。


使用以下代码将时间戳转换为可读格式:

   public static String formatUnixTimestamp(long unixSeconds) {

           // convert seconds to milliseconds

         Date date = new Date(unixSeconds*1000L);

   // set a format for the date

   SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss dd/MM/yyyy");

   // set the timezone

  sdf.setTimeZone(TimeZone.getTimeZone("GMT+11"));

   // return the formatted date

   return sdf.format(date);

            }


The distance in km should be calculated between the ISS and the user, and this value should be displayed in the relevant TextView. Hint: Explore the methods available in the Location class!

On repeated clicks of the Refresh button, the behaviour should repeat, but any map markers should be cleared first so that only the latest locations are displayed in the map. Figure 3 displays the text fields.

应在ISS和用户之间计算以km为单位的距离,该值应显示在相关的TextView中。 提示:探索Location类中可用的方法!

在重复单击“刷新”按钮时,应重复该行为,但应首先清除任何地图标记,以便仅在地图中显示最新位置。 图3显示了文本字段。


Figure 3: A closer look at the text fields.


Obtaining the current location of the ISS

To obtain the current location of the ISS you will need to connect to the following API:

要获取ISS的当前位置,您需要连接到以下API

http://api.open-notify.org/iss-now.json

The API returns a JSON object with the following properties:

iss_position: a JSON object that contains a latitude property and a longitude property which reflect the current position of the ISS;

message: whether the data was returned successfully (we should expect to see “success” if so);

timestamp: a UNIX timestamp in milliseconds to indicate the time that the ISS was at the returned position.

API返回具有以下属性的JSON对象:

iss_position:一个JSON对象,包含反映ISS当前位置的纬度属性和经度属性;

message:数据是否成功返回(如果是这样,我们应该看到“成功”);

timestamp:UNIX时间戳(以毫秒为单位),用于指示ISS处于返回位置的时间。

Note: The ISS is moving at close to 28,000 km/h, so its location changes really fast! This means that every time you call the API you will get a new location. Some additional information about the API is available here: http://open-notify.org/Open-Notify-API/ISS-Location-Now/.


Additional Classes / Requirements

You may be required to include additional classes in your application to achieve the requirements in an elegant manner – in fact we would expect to see some additional classes based on the examples we have provided in class. Thus, there is no limit to the number of additional classes you can include in your app. That said, you may be marked down for including unnecessary features and/or code that do not achieve the requirements listed in this document!

You should also follow the best practices we have discussed in class, such as not hardcoding strings into layout files, and pausing/resuming sensor and location listeners as the app moves between the background and foreground.

您可能需要在应用程序中包含其他类以优雅的方式实现这些要求 - 事实上,我们希望根据我们在课堂上提供的示例看到一些其他类。 因此,您可以在应用中包含的其他课程数量没有限制。 也就是说,您可能会被标记为包含不符合本文档中所列要求的不必要的功能和/或代码!

您还应该遵循我们在课堂上讨论的最佳实践,例如不将字符串硬编码到布局文件中,以及当应用程序在背景和前景之间移动时暂停/恢复传感器和位置监听器。

Robustness

Your app might do all of the things required of it in the specs but still not be robust. It might break or behave unexpectedly in certain conditions (e.g. what if the user doesn’t provide all of the permissions required, or quickly clicks the refresh button 50 times?). The challenge is to ensure that the program behaves gracefully in all conditions.

I will attempt to break your app. If I can’t do it then it is robust and you will get a good mark for this section.您的应用可能会在规范中完成所需的所有操作但仍然不健壮。 在某些情况下它可能会中断或出现意外行为(例如,如果用户未提供所需的所有权限,或者快速单击刷新按钮50次,该怎么办?)。 挑战在于确保程序在所有条件下都能正常运行。

我会尝试打破你的应用程序。 如果我不能这样做那么它很强大,你会得到这个部分的好标记。

Submission and marking process

Create a single zip file containing the Android Studio project of your FedUni ISS Tracker application and upload it to the upload location on Moodle for Assignment 2 of this course. You can easily export your project as a zip by selecting File > Export to Zip File…. There is no written component to this assessment besides the code in the completed project.

创建一个包含FedUni ISS Tracker应用程序的Android Studio项目的zip文件,并将其上传到本课程Moodle for Assignment 2的上传位置。 通过选择“文件”>“导出到Zip文件...”,可以轻松地将项目导出为zip。 除了已完成项目中的代码之外,此评估没有书面组件。

Assignments will be marked on the basis of fulfilment of the requirements as specified in the marking guide (which can be found on the last page of this document). You may be required to attend an interview with your marker to discuss certain aspects of your assignment.

In addition to the marking criteria, marks may be deducted for failure to comply with the assignment requirements, including (but not limited to):

Incomplete functionality,

Incomplete submissions (e.g. missing files)

Refer to the course description for details of the policy on marking of late assignments.

Any applications for extensions or special consideration should be made as early as possible, and in all cases prior to the deadline for submission.

分配将根据标记指南中规定的要求的实现进行标记(可在本文档的最后一页上找到)。 您可能需要参加与您的标记的面谈,以讨论您的任务的某些方面。

除标记标准外,还可能因未能遵守指配要求而扣除标记,包括(但不限于):

功能不完整,

提交不完整(例如丢失文件)

有关延迟分配标记政策的详细信息,请参阅课程说明。

任何延期或特别考虑的申请应尽早提出,并且在提交截止日期之前的所有情况下都应如此。


Credit

Icons made by Freepik from www.flaticon.com are licensed by CC 3.0 BY


ITECH3107 Assignment 2 Marking Criteria

Student Name:

Student ID:                                                                    

RequirementWeightMark

Correct setup of the AndroidManifest.xml and build.gradle files

Marking: 5 = perfect, 2.5 = reasonable (some omissions), 0 = many omissions or not completed at all. 5

Generation and use of a valid Google API key

Marking: 5 = key generated and usable, 0 = no key generated5

Correct construction and layout of the MapsActivity (i.e. contains all required elements which function as per the assignment specification)

Marking: 5 = perfect, 2.5 = reasonable (some omissions), 0 = many omissions or not completed at all.5

Runtime permissions are handled correctly

Marking: 5 marks = perfect, 2.5 = some issues, 0 = not completed.5

Location of ISS obtained from remote API

Marking: 10 = perfect, 5 = mostly / with issues, 0 = not at all.10

Map markers and textual information is correctly displayed after refresh button clicked

Marking: 10 = perfect, 5 = mostly / with issues, 0 = not at all.10

Sensor correctly used to scroll the map

Marking: 10 = perfect, 5 = mostly / with issues, 0 = not at all.10

Location manager used to correctly obtain the current location of the device

Marking: 10 = perfect, 5 = mostly / with issues, 0 = not at all.10

Location of device is correctly converted into a readable address


Marking: 5 = perfect, 2.5 = mostly / with issues, 0 = not at all.5

Sensors and location services stopped/resumed using appropriate lifecycle callbacks

Marking: 5 = perfect, 2.5 = mostly / with issues, 0 = not at all.5

GeneralWeightMark

Use of additional classes.

Marking: 5 marks = additional classes used where necessary, 2.5 = additional classes used with some issues, 0 = no additional classes used.5

Correct usage of strings.xml to define all hard-coded text content.

Marking: 5 marks = all in xml, 2.5 = some in xml, 0 = none in xml.5

Code style and comments.

Marking: 10 marks = beautiful code and layout, 5 = some good / some a bit rough, 1 = very poor.10

Robustness of code (e.g. can I break it?)

Marking: 10 marks = highly robust, 5 = mostly robust but will occasionally break or behave unexpectedly in certain conditions, 0 = crashes and breaks easily.10

Assignment mark total (out of 100)              

Contribution to course (out of 20 marks)              


Feedback:


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp