H W #9 Clues CSCI 571 Spring, H W# 9 P rototype YouTube Link : https://youtu.be/jNoZTuf2VHIhttps://youtu.be/jNoZTuf2VHI.

Slides:



Advertisements
Similar presentations
Application Fundamentals. See: developer.android.com/guide/developing/building/index.html.
Advertisements

Filip Debelić What is it? Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google Android,
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
Hints for HW#8. HW#6 Architecture Result of Query GOOG Browser with web page PHP Script client Apache web server finance.yahoo.com Send query with arguments.
Android Development (Basics)
Chapter 6 DOJO TOOLKITS. Objectives Discuss XML DOM Discuss JSON Discuss Ajax Response in XML, HTML, JSON, and Other Data Type.
Mobile Programming Lecture 1 Getting Started. Today's Agenda About the Eclipse IDE Hello, World! Project Android Project Structure Intro to Activities,
Introduction to Android Programming Content Basic environmental structure Building a simple app Debugging.
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 9: Customize! Navigating with a Master/Detail.
Android: versions Note that: Honeycomb (Android v3.0) A tablet-only release Jelly Bean (Android v4.1) Released on July 09, 2012.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
JavaScript & jQuery the missing manual Chapter 11
CS5103 Software Engineering Lecture 08 Android Development II.
© Keren Kalif Intro to Android Development Written by Keren Kalif, Edited by Liron Blecher Contains slides from Google I/O presentation.
CS378 - Mobile Computing Web - WebView and Web Services.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Concurrency in Android with.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Favorite Twitter® Searches App Android How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2: Simplify! The Android User Interface
Basic Android Tutorial USF’s Association for Computing Machinery.
Networking: Part 2 (Accessing the Internet). The UI Thread When an application is launched, the system creates a “main” UI thread responsible for handling.
1 Announcements Homework #2 due Feb 7 at 1:30pm Submit the entire Eclipse project in Blackboard Please fill out the when2meets when your Project Manager.
Frank Xu Gannon University.  Linear Layout  Relative Layout  Table Layout.
CS378 - Mobile Computing Web - WebView and Web Services.
Chapter 2 The Android User Interface. Objectives  In this chapter, you learn to:  Develop a user interface using the TextView, ImageView, and Button.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
Android Boot Camp for Developers Using Java, 3E
User Interfaces: Part 1 (View Groups and Layouts).
Android Boot Camp for Developers Using Java, Comprehensive: A Guide to Creating Your First Android Apps Chapter 2: Simplify! The Android User Interface.
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Binding Basics.
Android Hello World 1. Click on Start and type eclipse into the textbox 2.
Field Trip #32 Digital Alarm Clock By Keith Lynn.
MAKANI ANDROID APPLICATION Prepared by: Asma’ Hamayel Alaa Shaheen.
NOAA Weather Patrick Wolfram. What it does Allows user to specify a zip code Performs HTTP GET requests on noaa.gov for the specified zip code Displays.
HW#9 Clues CSCI 571 Fall, HW#9 Prototype
Recap of Part 1 Terminology Windows FormsAndroidMVP FormActivityView? ControlViewView? ?ServiceModel? Activities Views / ViewGroups Intents Services.
Building User Interfaces Basic Applications
Lecture 6: Process and Threads Topics: Process, Threads, Worker Thread, Async Task Date: Mar 1, 2016.
ANDROID LAYOUTS AND WIDGETS. Slide 2 Introduction Parts of the Android screen Sizing widgets and fonts Layouts and their characteristics Buttons, checkboxes.
INTRODUCTION TO ANDROID. Slide 2 Introduction I take a top-down approach to describing an application’s anatomy.
USING ANDROID WITH THE INTERNET. Slide 2 Lecture Summary Getting network permissions Working with the HTTP protocol Sending HTTP requests Getting results.
Android apps development - Eclipse, Android SDK, and ADT plugin Introduction of.
Why Learn Android? Largest installation base of any operating system Over 20,000 Android devices exist Businesses will likely move more to device-based.
Introduction to Android Programming
Office 365 Development July 2014.
Chapter 2: Simplify! The Android User Interface
Java FX: Scene Builder.
Open Handset Alliance.
Topics Graphical User Interfaces Using the tkinter Module
CARA 3.10 Major New Features
Android Runtime – Dalvik VM
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
WebView and Web Services
HW#9 IOS Clues CSCI571 Spring 2017
CSE 486/586 Distributed Systems Android Programming --- 2
MAD.
Mobile Application Development Chapter 5 [Persistent Data in Android]
Creation of an Android App By Keith Lynn
Mobile Application Development Chapter 4 [Android Navigation and Interface Design] IT448-Fall 2017 IT448- Fall2017.
HUJI Post PC Workshop 1 Introduction to Android Development Ari Sprung
Android SDK & App Development
CS5103 Software Engineering
Building User Interfaces Basic Applications
Android Topics Asynchronous Callsbacks
Getting Started With Solr
GT Portal v. 2.0 Data Delivery
Emerging Platform#3 Android & Programming an App
Web Application Development Using PHP
Presentation transcript:

H W #9 Clues CSCI 571 Spring, 2016

H W# 9 P rototype YouTube Link :

Tutorials 1. Building your first App Creating a Project with Android Studio 2. Running your first App (on same page see also “Run on the Emulator”)

Tutorials 3. Starting another activity 4. Comprehensive Tutorial / Article on getting started with Android

What is needed You will need to download and install Android Studio Download the Facebook Android SDK Register your new App with Facebook and get an Application ID

HW#9 Architecture Overview PHP pre-processor executes PHP script; PHP script parses XML, makes request for JSON Sends JSON client Apache web Server running on AWS/Google App Engine RESTful WEB SERVICE PROVIDER Eg. Markit on Demand API, Yahoo charts API News (Googe News/Bing News) Posting to Facebook PHP script sends query with arguments retrieve JSON User clicks on Facebook icon Android App send input data to AWS retrieve JSON

HW9 Implementation You will create 2 activities and a Manifest file AndroidManifest.xml MainActivity.java – routine that controls the entire process –Creates the Search Form UI –sets on-click handlers to the buttons –Validateion the user input –Calls AWS/Google App Engine server

HW9 Implementation ResultActivity.java –Creates the Tabbed Layout – Current, Historical and News –Facebook Share –Add to favorites

AndroidManifest.xml File Every application must have an AndroidManifest.xml file in its root directory. The manifest presents essential information about the application to the Android system. Among other things, the manifest does the following: It names the Java package for the application. It describes the components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of. It names the classes that implement each of the components and publishes their capabilities.

AndroidManifest.xml File See Please note that the file is created by default on creation of a new Android project using Android Studio IDE.

UI Controls in Android For the homework exercise, you can use the following widgets (not limited to) : TextView ( i.e., label ) EditText ( i.e., text field ) AutoCompleteTextView ew.html ew.html

UI Controls in Android (Contd.) For the homework exercise, you can use the following widgets (not limited to) : Button RadioButton ImageView Switch ProgressBar

UI Controls in Android (Contd.) ListView TabLayout yout.html yout.html ViewPager ml ml WebView

UI Controls in Android (Contd.) ImageSwitcher ( It is useful to animate an Image on screen) TextSwitcher ( It is useful to animate a label on screen ) TableLayout

UI Controls in Android (Contd.) TableRow RelativeLayout LinearLayout (It arranges “components” in vertical or horizontal order, via orientation attribute.) ScrollView

RelativeLayout RelativeLayout lets you position your component base on the nearby (relative or sibling) component’s position. You can use “above, below, left and right” to arrange the component position.

LinearLayout LinearLayout is a common layout that arranges “component” in vertical or horizontal order, via orientation attribute

MainActivity.java onCreate does the following Display the search UI – AutoCompleteTextView and 2 Buttons. Render the favorites list(ListView), if any stocks have been marked as favorites. Register a event handler with the various UI components– ‘Get Quote’ (Button), ‘Clear’ (Button), ‘Refresh’ (ImageButton) and ‘Auto-Refresh’ (Switch).

MainActivity.java (Contd.) onClickListener for the ‘Get Quote’ Button does the following Validate the user input Build the URL for AWS/Google App Engine Create a new task which is of type AsyncTask to fetch the JSON data. It will initiate an asynchronous call. Execute the task and moves to another activity, if needed!

MainActivity.java (Contd.) onClickListener for the ‘Clear’ Button does the following Clear the AutoComplete Text View onClickListener for the ‘Refresh’ ImageButton does the following Get the updated stock information of all the favorite stocks and re-render the favorite ListView

MainActivity.java (Contd.) onClickListener for the ‘AutoRefresh’ Switch does the following If auto-refresh in OFF, Start getting the favorites stock’s information every 10 seconds and re-renders the favorite list, ListView. You may use Runnable and Handler for repeatedly run a ‘task’ If auto-refresh in ON, you need to stop getting the stop information

MainActivity.java – Remove Favorite Swiping gesture – Deleting the favorite You can swipe left or right, to initiate the process of removing the stock from the favorite list. You then need to confirm for the deletion If the user confirms the deletion, you should remove the stock from the Favorite ListView

MainActivity.java - AsyncTask AsyncTask is an abstract class provided by Android which helps us to use the UI thread properly. This class allows us to perform long/background operations and show its result on the UI thread without having to manipulate threads. AsyncTask has four steps: doInBackground: Code performing long running operation goes in this method. When onClick method is executed on click of button, it calls execute method which accepts parameters and automatically calls doInBackground method with the parameters passed.

MainActivity.java – AsyncTask (Contd.) onPostExecute: This method is called after doInBackground method completes processing. Result from doInBackground is passed to this method. onPreExecute: This method is called before doInBackground method is called. onProgressUpdate: This method is invoked by calling publishProgress anytime from doInBackground call this method.

ResultActivity.java ResultActivity starts with onCreate - onCreate does the following retrieves JSON data which was passed from MainActivity stores the data in a JSONObject Settting up the three tabs – ‘Current’, ‘Historical’ and ‘News’ Rendering the ‘bookmark’ button properly, if the stock had been marked as favorite.

ResultActivity.java - Favorites ResultActivity would also be responsible for marking a stock as favorite Get the selection stock information such as stock name, stock symbol, etc. Save the above information in SharedPreference Use a ‘suitable string’ key for storing your favorite stock You may store your array of favorite stock in the JSON format You may also check if the stock is favorite or not, in a similar fashion – Iterate over your array of favorite stock and check if the current stock is marked as favorite or not.

ResultActivity.java - Current Current Tab would be doing the following: 1.Get the stock information from our script hosted on AWS/Google App Engine 2.Format the values in the desired format. For example, date needed to be in the specified format. 3.Render the ListView with the stock information with the data we got from our script. 4.Also below the listview, we have an ImageView showing the current stock activity. 5.Furthermore, on clicking the ImageView, you need to render the stock activity image in a ‘Dialog’. The image in the dialog should be zoomable.

ResultActivity.java - Historical Historical Tab would be doing the following: 1.Render the WebView with a local HTML file 2.The HTML would be responsible for rendering the HighChart UI.

ResultActivity.java - News News Tab would be doing the following: 1.Get the news information from our script hosted on AWS/Google App Engine 2.Render the ListView with the news information with the data we got from our script.

FACEBOOK POST For the latest versions of Facebook SDK 4.x, share functionality may require following: ● Modifications in AndroidManifest file: ○ Introducing Fb Application Id ○ Adding FacebookActivity <activity android:name="com.facebook.FacebookActivity" android:configChanges= "keyboard|keyboardHidden|screenLayout|screenSize|orientation" />

FACEBOOK POST (Contd.) For the latest versions of Facebook SDK 4.x, share functionality may require following: ● Modifications in AndroidManifest file: ○ Adding Facebook Content Provider <provider android:authorities="com.facebook.app.FacebookContentProvider{app_id}" android:name="com.facebook.FacebookContentProvider” android:exported="true"/>

FACEBOOK POST (Cont.) - To implement the functionality you may use the following approach on click of the fb button: Initialize facebook sdk - Create a ShareDialog - Create LinkContent for the post - Share the LinkContent through ShareDialog - Register Callback for the ShareDialog - Bind onActivityResult for maintaining session

Android Libraries You may find the below libraries useful to implement the features: Google Gson : Apache Commons Lang :

Android Libraries You may find the below libraries useful to implement the features: Nhaarman library for ListView animations : Chrisbanes library for zoomable ImageView :