CIS 470 Homework 6is Fall 2011 Android Multi-Threading Write an Android application to implement the core of an investment game that operates as follows: 1.. CIS470 Mobile Application
Trang 1CIS 470 Homework 6is
Fall 2011 Android Multi-Threading
Write an Android application to implement the core of an investment game that operates as follows:
1 Assume $100 is placed in an account at a trust fund
2 Two financial advisers known as ‘GoodNews’ and ‘BadNews’ are assigned to the
account Both investors operate independently from one another
3 GoodNews strategy consists in
a think for a while on what to do (it takes a second each time), and
b make an investment decision that always results in a gain The gain is a random value less or equal to $100 The gain is added to the account to increase its value
4 BadNews operates in a similar way; however his decisions always produce a random
loss The loss is at most $100 and should be subtracted from the account’s balance
5 The goal of the game is to see whose strategy ‘succeeds’ first
6 The game is limited to a period of time not to exceed 20 seconds
7 The game could terminate before the allocated time if either
a the current balance reaches $200 (twice the original allocation), or
b the account is depleted and there is no more money
Provide an UI showing the following elements:
c Elapsed time (20sec max) Use a horizontal ProgressBar or a similar visible
control
d Account’s balance Use a ProgressBar initially at the middle of the scale Gains
move the progress to the right (max scale), losses reduce the progress sending the marker to the left (0 point in the relative scale)
e The current value of the account
f A written historical sequence of gains and losses
g A message indicating the result of the game
h Start-Over / Quit buttons
Feel free to change anything that improves the specs Happy computing Have fun!
Trang 2CIS470 Mobile Application Development using Android
Please implement a simple FLASHLIGHT Android application The UI should look - at leatst - like the following
screen-shots
HINT: Use nested Linear Layouts (as discussed in class) to produce the UI for this assignment
Test your application in the Emulator
Document your code (this will impact your grade)
Print the XML LAYOUT and CODE Include SCREENSHOTS showing your application working (use the DDMS screen capture tool)
Extra points for improved design and features !
Trang 3CIS 470 Mobile Application Development using Android
Please implement a PIZZA ORDERING Android application The UI should include the elements given in the sketch below Fill free to improve the design of this interface
Functionality:
After completing the selection the user pushes the ‘Place Order’ button to send a summary of the order At a future time we will deliver a text-message to the vendor At this point simply display the text summarizing the order using the Toast method
Caution:
1 Make sure customer name and phone are provided
2 Default pizza shape to ‘Round Pizza’
3 Make sure at least one topping is chosen
Test your application in the Emulator Document your code (this will impact your grade)
Print the XML LAYOUT and CODE Include SCREENSHOTS showing your application working (use the DDMS screen capture tool)
Extra points for improved design and features !
Trang 4CIS470 Assignment 3 Due: Th 6-Oct
Create an Android application to accomplish the following goal
A drop-down list (Spinner) offers a choice of 2011 vehicles including:
Honda Accord
Honda Civic
Toyota Corolla
Toyota Camry
Chevrolet Corvette
Ford Taurus
(any others of your choice)
When the user clicks on a vehicle name a second screen is displayed showing a picture of that car and a textView box includes price and other characteristics of the vehicle (HP, mpg, …)
A “Back” button on the second screen allows the user to return to the first screen
Trang 5HOMEWORK 3 - Fall 2010 (Due: Thu Oct 28) CIS493 Mobile Application Development Using Android
TODO LIST APPLICATION
Write an Android App to implement a simple TODO list The app displays a ListView showing a numbered
sequence of lines representing tasks that you need to perform
The app is controlled by an OPTION MENU offering the following possibilities:
1 Add new entry to the list
2 Delete a task from the list (ask for number and remove)
3 Update the text of a selected task
4 Save TODO list (fake operation – we still have not done file IO)
5 Close app
The main layout of the TODO list should be similar to the following:
TODO List: Wed Oct 21, 2009 – 1:15 pm
ENTER DATA HERE…
1 Buy milk & bread at the supermarket
2 Pick up clothes from the cleaner
3 Make a tee-time for Friday at Manankiki GC
4 Buy present- wedding anniversary next saturday
Save List Close App
Add entry Delete entry Update entry
Functionality:
1 Type a new task in the top EditText box Press Menu button, click on Add entry
2 Click on a line The text should be displayed on the EditText box
a Write over the text, click Menu > Update entry to modify the TODO list value (clear EditText)
b Click on Menu > Delete entry to remove the task from the list (clear EditText)
3 Click on Save List to fake the writing of the list to disk
4 Click on Close to save list and finish application
Comment Lecture notes on file IO are available as lesson 15 (web page)
ListView with numbered tasks
OPTION MENU EditText box for entering Task’s text or line number
Trang 6HOMEWORK 5 - Fall 2010 (Due: Thu Nov 11) CIS493 Mobile Application Development Using Android
CLEVELAND TOUR - LIST APPLICATION
Using built-in Android actions
In this application a list of Cleveland landmarks is provided When the user clicks on one of them a second screen appears showing two buttons The first button “Map it” display a location map of the selected place, the second button “More Info” takes the user to the site’s webpage
The main application is sketched below:
Visiting Cleveland Landmarks
1 Cleveland Tower City
2 Browns Football Field
3 Cleveland State University
4 Playhouse Square
5 Art Museum
6 …
7 …
Playhouse Square
Map it More Info
Trang 7CIS 493 Project 7 RSS Feeds – SQL Databases
Fall 2010 – V Matos
In this assignment you will produce an Android application to collect headline sports news from any of the professional sport organizations such as the NBA, NFL, LPGA, etc and locally store it into a SQL database For instance the NBA RSS URL is http://www.nba.com/rss/nba_rss.xml This particular source subscribes to the RSS 2.0 standard discussed in class
STEPS
1 Create a SQLLITE database, call it myDB
2 Create the table NBANEWS ( Title, Description, PubDate )
3 You need to transfer and parse the NBA News XML file to your application (see example
discussed in class – Lecture 18)
4 Each item extracted from the feed should be stored in the local SQLLITE database (using insert into nbanews values (….) command)
5 Close the database
6 Reopen the database
7 Use a cursor to visit the data saved in the database table (you must use a SQL “select” statement and a cursor for this step)
8 Use Android’s Toast command to show the items’ titles
An Image of the RSS Feed: NBA Headlines ( http://www.nba.com/rss/nba_rss.xml )
Trang 8A Portion of the corresponding XML file
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>NBA.com: News</title>
<link>http://www.nba.com/news</link>
<description>NBA.com delivers the latest news, video, and scores from around the NBA league.</description>
<language>en-us</language>
<copyright>Copyright (c) 2010NBA Media Ventures, LLC All rights reserved.</copyright>
<managingEditor>webmaster@nba.com</managingEditor>
<pubDate>Wed, 17 Nov 2010 01:09:06 EST</pubDate>
<lastBuildDate>Wed, 17 Nov 2010 01:09:06 EST</lastBuildDate>
<image>
<title>NBA.com</title>
<link>http://www.nba.com/news</link>
<url>http://i.cdn.turner.com/nba/nba/media/nba_rss.jpg</url>
<width>144</width>
<height>38</height>
</image>
<item>
<title><![CDATA[
Wizards' Wall misses game with sprained left foot]]>
</title>
<link>http://www.nba.com/2010/news/11/17/wall-injury/index.html?rss=true
</link>
<description>Washington Wizards rookie point guard John Wall was inactive for Tuesday's game against Toronto with a sprained left foot.</description>
<pubDate>Wed, 17 Nov 2010 01:06:13 EST</pubDate>
</item>
<item>
<title><![CDATA[
Karl says he's evaluating his health this season]]>
</title>
<link>http://www.nba.com/2010/news/11/16/karl-health.ap/index.html?rss=true
</link>
<description>Everybody seems to be talking about where Denver Nuggets star Carmelo Anthony will end up next season.</description>
<pubDate>Tue, 16 Nov 2010 21:04:48 EST</pubDate>
</item>
<item>
<title><![CDATA[
Longtime Cavs radio play-by-play man released from hospital]]>
</title>
<link>http://www.nba.com/2010/news/11/16/tait-hospital.ap/index.html?rss=true
</link>
<description>Longtime Cleveland Cavaliers radio play-by-play broadcaster Joe Tait has been released from the hospital.</description>
<pubDate>Tue, 16 Nov 2010 19:18:23 EST</pubDate>
</item>
Trang 9CIS 493 Project 8 Golf GPS – A Geomapping Application
Fall 2010 – V Matos
In this assignment you will produce an Android range-finder application to help avid golfers determine the distance between their current location and the (center, front, back) of the greens; as well as any other relevant land-markers on the course (hazards, bunkers, car pads , etc.) Mapping of the golf course
is provided in the form of a KML file (see sample below)
As a proof of concept we will work only with the first hole of Manakiki Golf Course (Willoughby, Ohio)
Consider you have been hired to complete the work initiated by a colleague who is no longer at the
company An early version of the code is available at:
http://grail.csuohio.edu/~matos/notes/cis-493/2010-fall/Homework/99-Golf-Gps.zip
KML data for Manakiki GC is available at:
http://grail.csuohio.edu/~matos/notes/cis-493/2010-fall/Homework/99-map-info-kml-GOLF.zip
What to do?
1 Get your current GPS coordinates using hardware reading or a software fix (lecture notes 24 - see Skyhook Wireless Technology)
2 Compute distance from your current location to relevant hole's markers held in the kml
resource/sdcard file
3 Provide a reasonable interface(2) showing prominently the distance to center, front, back of the green (ideally to each marker ahead of you)
4 Switch automatically from one hole to the next
5 Beautify your app adding score card, statistics, timing, advice,
Resources:
1 KML Data taken from BBGPSGolf webpage Dec-8-2010
http:www.bbgpsgolf.com/viewcourselistg.php
2 SKY-CADDIE Model SG-4 Information available at
http://www.skygolf.com/products/productDetail.aspx?sku=SG4
3 Google Earth (use it to visualize the contents of the kml file)
Trang 10A fragment of KML code showing the mapping for Hole 1 at Manakiki GC
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Document>
<gcname>Manakiki Golf Course</gcname>
<Placemark>
<name>Tee - Hole 1</name>
<Point>
<coordinates>-81.4324182271957,41.5984273639879,0</coordinates> </Point>
</Placemark>
<Placemark>
<name>Front of Green - Hole 1</name>
<Point>
<coordinates>-81.433182656765,41.5955730479591,0</coordinates> </Point>
</Placemark>
<Placemark>
<name>Middle of Green - Hole 1</name>
<Point>
<coordinates>-81.4331665635109,41.5954647298964,0</coordinates> </Point>
</Placemark>
<Placemark>
<name>Back of Green - Hole 1</name>
<Point>
<coordinates>-81.4331531524658,41.5953664411267,0</coordinates> </Point>
</Placemark>
<Placemark>
<name>Bunker - Hole 1</name>
<Point>
<coordinates>-81.4327722787857,41.5969992188305,0</coordinates> </Point>
</Placemark>
</Document>
</Kml>