Posted: April 4th, 2015

Fragments and BroadcastReceiver

Fragments and BroadcastReceiver

Paper details:
please check the file attached for the instructions. The program needs to be in “Java”. Also, i need the program to work in “Android Studio” program.

CIS372: Mobile (Android) Programming
Homework 4 – Fragments and BroadcastReceiver

For this homework you will build an application that catches SMS intents and searches them for several keywords.
REQUIREMENTS
? Version – your app should work for Android 4.0.3 or above (Minimum API 15)
? Make the orientation of your app Landscape Mode
? You will need
? 1 Activity
¦ MainActivity
? this will control both (2) Fragments since Landscape mode is good to show two Fragments side-by-side
? 2 Fragments
¦ UrlListFragment
? this will show a list of URLs
? it should have at least 3 default entries in the list, e.g.
? http://www.fontbonne.edu
? http://www.google.com
? http://my-favoriate-website.com
? clicking on an item in the List should open up the website in the MyWebFragment
¦ MyWebFragment
? this will load URLs that have been clicked in UrlListFragment
? 1 BroadcastReceiver
¦ SmsReceiver
¦ use an intent filter to listen for SMS_RECEIVED, register the receiver inside of the Android Manifest file, not dynamically
¦ when an SMS is received, your code should get the message from the SMS
? We will assume that you will only receive messages containing URLs
¦ your receiver should then launch a new instance of your Activity, which will add the new URL to the default list AND open the website immediately in the WebView
¦ all entries (including the new one) should still be clickable
¦ Your app should support SMS messages with URLs in any valid format, i.e.
? http://www.example.com (Don’t need to modify)
? http://example.com (Don’t need to modify)
? www.example.com (Need to prepend http://)
? example.com (Need to prepend only http:// , NOT www)
THINGS TO NOTE
? I don’t want to take the joy of figuring things out away from you, but if you can’t figure out
? Ask me or your classmates
? If anything is unclear, please ask me. I’m very willing to help
? Successive SMS messages WILL NOT contain any URLs in the UrlListFragment except for the default entries and the new entry (So never more than 4 entries in this example). That is OK.
? For Example
? if your default list contains
? www.google.com
? www.apple.com
? www.amazon.com
? Receiving an SMS message with www.microsoft.com will cause your list to now be
? www.google.com
? www.apple.com
? www.amazon.com
? www.microsoft.com
? Receiving any additional SMS messages such as www.samsung.com will cause your list to now be
? www.google.com
? www.apple.com
? www.amazon.com
? www.samsung.com
? It is OK if your app works this way
? You can spoof SMS messages to the emulator. (This is part of your assignment)
? When you want to “update” your listview, you will probably need to do it by replacing the current visible UrlListFragment with a new instance of it.
? This means that when you create a new instance of UrlListFragment, you will need to pass the data to it at that point using setArguments
? When UrlListFragment has been started (in its onActivityCreated method), you will need to get the new entry at that point, add it to the list, and then set the list adapter
Extra credits (10 points)
1 Have your app support Portrait Mode. In Portrait Mode, you can follow this design:
? MainActivity will only support UrlListFragment
? you should have a second Activity WebActivity to support the MyWebFragment
? In Portrait mode, you should show the UrlListFragment alone at first
¦ When an item is clicked, it should launch a new Intent to start WebActivity
¦ WebActivity will in turn launch the MyWebFragment
? either dynamically or by way of the fragment tag in XML
? You will need 2 additional Layout XML files, 3 in total
¦ one for supporting MainActivity and UrlListFragment in Portrait mode
¦ one for supporting WebActivity and MyWebFragment in Portrait mode
¦ one for supporting MainActivity, UrlListFragment, and MyWebFragment in Landscape mode
EXAMPLE
This is the app when it is first launched. The 3 entries in the list are the default entries.
This is the app after clicking on the first item in the list on the left
This is the app after receiving an SMS message where the contents of the message was “www.yahoo.com”

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Live Chat+1-631-333-0101EmailWhatsApp