M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 1

Similar documents
1. Implementation of Inheritance with objects, methods. 2. Implementing Interface in a simple java class. 3. To create java class with polymorphism

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

GUJARAT TECHNOLOGICAL UNIVERSITY

Android App Development

CS 528 Mobile and Ubiquitous Computing Lecture 3b: Android Activity Lifecycle and Intents Emmanuel Agu

This lecture. The BrowserIntent Example (cont d)

Android Programming Lecture 2 9/7/2011

Android Programming (5 Days)

CMSC436: Fall 2013 Week 3 Lab

android application development CONTENTS 1.1 INTRODUCTION TO O ANDROID OPERATING SYSTEM... TURES Understanding the Android Software Stack...

Pro Android 2. Sayed Y. Hashimi Satya Komatineni Dave Mac Lean. Apress

ANDROID SYLLABUS. Advanced Android

Android Exam AND-401 Android Application Development Version: 7.0 [ Total Questions: 129 ]

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

MC Android Programming

Understanding Application

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 2

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle

ACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi

Android Fundamentals - Part 1

Lecture 2 Android SDK

CS 4518 Mobile and Ubiquitous Computing Lecture 5: Rotating Device, Saving Data, Intents and Fragments Emmanuel Agu

INTRODUCTION TO ANDROID

In this Class Mark shows you how to put applications into packages and how to run them through the command line.

Introduction to Android

Android Application Development

Practical Problem: Create an Android app that having following layouts.

Diploma in Android Programming (DAP)

Hybrid Apps Combining HTML5 + JAVASCRIPT + ANDROID

Activities and Fragments

CS 528 Mobile and Ubiquitous Computing Lecture 4a: Fragments, Camera Emmanuel Agu

UNDERSTANDING ACTIVITIES

CS 370 Android Basics D R. M I C H A E L J. R E A L E F A L L

Syllabus- Java + Android. Java Fundamentals

Android User Interface

Mobile OS. Symbian. BlackBerry. ios. Window mobile. Android

CIS 408 Internet Computing Sunnie Chung

CS378 -Mobile Computing. Anatomy of and Android App and the App Lifecycle

The World of Android Development

Programming Mobile Applications with Android Lab2

CS378 -Mobile Computing. User Interface Basics

Android Online Training

CS 528 Mobile and Ubiquitous Computing Lecture 3: Android UI, WebView, Android Activity Lifecycle Emmanuel Agu

Android Application Development 101. Jason Chen Google I/O 2008

Android Essentials with Java

ANDROID COURSE BROCHURE

Upon completion of the second part of the lab the students will have:

Android development. Outline. Android Studio. Setting up Android Studio. 1. Set up Android Studio. Tiberiu Vilcu. 2.

XML Tutorial. NOTE: This course is for basic concepts of XML in line with our existing Android Studio project.

The Internet. CS 2046 Mobile Application Development Fall Jeff Davidson CS 2046

Mobila applikationer och trådlösa nät, HI1033, HT2012

Embedded Systems Programming - PA8001

Android. Mobile operating system developed by Google A complete stack. Based on the Linux kernel Open source under the Apache 2 license

ACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi

Minds-on: Android. Session 2

Agenda. Overview of Xamarin and Xamarin.Android Xamarin.Android fundamentals Creating a detail screen

Programming in Android. Nick Bopp

University of Babylon - College of IT SW Dep. - Android Assist. Lect. Wadhah R. Baiee Activities

The Suggest Example layout (cont ed)

Android User Interface Android Smartphone Programming. Outline University of Freiburg

Application Fundamentals

Java Training Center - Android Application Development

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

ANDROID DEVELOPMENT. Course Details

Android Development Crash Course

Mobile Application Development Android

IGEEKS TECHNOLOGIES. Software Training Division. Academic Live Projects For BE,ME,MCA,BCA and PHD Students

Mobile Application Development

Required Core Java for Android application development

ITG Software Engineering

UI, Continued. CS 2046 Mobile Application Development Fall Jeff Davidson CS 2046

Lab 1 - Setting up the User s Profile UI

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

CORE JAVA& ANDROID SYLLABUS

COSC 3P97 Mobile Computing

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Introduction to Android Programming. Emmanuel Agu

Android AND-401. Android Application Development. Download Full Version :

Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard.

Lab 1: Getting Started With Android Programming

Mobile Application Development - Android

CS 4518 Mobile and Ubiquitous Computing Lecture 4: Data-Driven Views, Android Components & Android Activity Lifecycle Emmanuel Agu

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

States of Activities. Active Pause Stop Inactive

Overview of Activities

ORACLE UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Course Learning Outcomes (CLO): Student Outcomes (SO):

Applications. Marco Ronchetti Università degli Studi di Trento

BCA 6. Question Bank

Android Overview. Most of the material in this section comes from

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Getting started with Tabris.js Tutorial Ebook

Android Components. Android Smartphone Programming. Matthias Keil. University of Freiburg

Orientation & Localization

Spring Lecture 5 Lecturer: Omid Jafarinezhad

Developer s overview of the Android platform

The Basis of Data. Steven R. Bagley

CS 528 Mobile and Ubiquitous Computing Lecture 2a: Android UI Design in XML + Examples. Emmanuel Agu

IT6503 WEB PROGRAMMING. Unit-I


Android Activities. Akhilesh Tyagi

Transcription:

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 1 1) Explain underlying architecture of Android Platform. (Unit :- 1, Chapter :- 1) Suggested Answer:- Draw Figure: 1.8 from textbook given on Pg. No. 24 Points Linux OS as Hardware abstraction layer. Each application considered as OS users & benefit of it. Application security using permission. Concept of Dalvik VM. 2) What is activity? How android manages activities? Explain lifecycle of activity in android. (Unit :-2, Chapter :- 4) What is activity? Definition of activity. How android manages activities? Activity management by Android done using Activity Stack (Draw Figure: 4.2 from textbook given on Pg. No. 72 without icons) Lifecycle of an activity Draw Figure: 4.3 from textbook given on Pg. No. 73 Explain following methods of activity lifecycle. o oncrate() Called when: first method to be called. Single parameter Bundle, initially null. Bundle contains info when activity is restarted. Appropriate place to code for: any startup, layout setup & data binding. o onresume() 1

Called when: Background activity comes on top of stack and becomes foreground activity. Appropriate place to code for: To retrieve any resources required by activity to run. o onpause() Called when: When any activity is pushed down the stack i.e. Activity migrates from foreground to background. Appropriate place to code for: Stop any audio, video, animation, deactivate resources such as database cursor, clean up & release any resource. o ondestory() Called when: When activity is being destroyed (Due to two reason : voluntarily or forcefully by platform.) o onsaveinstancestate() & onrestoreinstancestate() Saving & retrieving information state to bundle object. 3) Explain managing following resources with example. (Unit :-2, Chapter :- 6) o Color o Dimension o Menu For every resource explain purpose, subfolder & xml file name to be saved under application s resource folder, xml file tags, how to retrieve resource programmatically in java file, example. Color o Purpose : To define colors which can be applied to other screen elements. o Define in : /res/values/colors.xml o Color value starts with #. List color formats (RGB, ARGB, RRGGBB, AARRGGBB) o <resource> parent tag, <color> sub tag o getresources.getcolor() java method o Example 2

Dimension o Purpose : to define dimension resource used to draw control on layout. o Defined in : /res/values/dimen.xml o Dimension values can be any dimension unit measurement support o <resource> parent tag, <dimen> sub tag o gerresources().getdimension() java method o Example Menu o Purpose : to create items for menu resource, can be reused in menu control. o Defined in : /res/menu/menu1.xml o <menu> parent tag, <item> sub tag o Override oncreateoptionsmenu() use getmenuinflater.inflate() method. 4) Write an android application which allows user to reserve room for ABC Hotel. Get details such as name, phno length filter for 10 digits, email id, room type (Gold, Silver Spinner), Booking date from (Date picker control), No. of days. When user Submit these details it should goto next activity & display it as summary. (Spinner, EditText, TextView, Button, DatePicker, Moving from one activity to other). (Unit :-2, Chapter :- 7) Tasks to be done Design interface (XML layout) Retrieve all widgets in java file using findviewbyid() method. Name, Phno, Email id, No. of days are EditText use gettext() method and store all it in one String variable (use + for string concatenation) For phno length filter use setfilters() method of EditText & InputFilter.LengthFilter() method. (Ref. pg no. 142). For spinner set entries using /res/array/roomtype.xml file (Create roomtype.xml file as string-array. To retrieve selected item from spinner use getselectedview() and cast it to TextView (Ref. pg. no. 144). For booking date get getyear(), getmonth() & getdayofmonth() method of datepicker widget. 3

Store all above retrieved information in string variable & set that string variable s value using settext() method to TextView as summary. 5) Write android application to have button to draw various shapes like Circle, Rectangle, Rounded rectangle, Oval, Circle, Text on screen using Paint Class. Provide Radio buttons for linear, radial & Sweep gradient effect to these shapes. (Using Canvas class methods) (Unit :- 2, Chapter :- 9) Create a class that should extend View Import appropriate packages Override ondraw(canvas c) method. Create object of paint To draw circle use drawcircle() method of Canvas. To draw Rectangle use drawrect() method of Canvas. To draw Rounded Rectangle use drawroundrect() method of Canvas. To draw Oval use drawoval() method of Canvas. To draw Circle use drawcircle() method of Canvas. To draw Text use drawtext() method of Canvas. In main class that extends activity set the instance of newly created class using setcontentview(<instance of new class>). 6) Write an android application to provide two button Write data & Read data to the user. Write data should write information entered by user in edit text to text file and Read data should read data from text file and display it into the textview. (Unit :-3, Chapter:- 10) Write Data (Ref. pg. no. 236) o Creating & saving file to default directory at /data/data/<package name>/files/ o Create instance of FileOutputStream with appropriate argument filename, mode MODE_PRIVATE. o Use write method of FileOutputStream object to write data to files. o Close the file using close() method. 4

o Note: To append data only change is in mode i.e. 2 nd argument of creating instance MODE_APPEND) Reading Data (Ref. pg. no. 37) o Create instance of FileInputStream with filename as argument. o Create instance of StringBuffer & DataInputStream with FileInputStream instance as argument. o Use readline() method to read data and store it in string buffer. o Close the file using close() method. o Use settext() method to display String data to TextView. 7) Write android application to get information about content located on specific URL & read display the data from that url. (Unit :- 3, Chapter :- 12) Get Information about Content o Create instance of URL with the url from which content needs to be retrieved. o Create instance of HttpURLConnection. (use openconnection() method of url class) o Use getcontentlength() & getcontenttype() method of HttpURLConnectin class. Read data located on internet o Create instance of URL with the url from which content needs to be retrieved. o Create instance of InputStream class (use openconnection() method of url class) o Use read() method of InputStream Class, use no. of bytes to be read as parameter. Task requires permission mention it in manifest file o android.permission.internet 5

8) Write an android application to display html content in webview. Html file should have welcome message and prompts user name. When user clicks on Display message button alert user with welcome <username>. (Unit :- 3, Chapter :- 13) Create & store html file in assets folder Write a code for html file to design interface and <script> tag in <head> tag to create function display_message() which alerts, call this function in button click in html. Design layout file (put <WebView> widget) Retrieve instance of webview. Create instance of WebSettings using webview instance s getsettings() method. Use it to enable javascript using setjavascriptenabled(true). Use loadurl() method of Webview to load the html file stored in html (Argument will be file://android_asset/test.html) 9) Write an android application which allows user to enter any number and when user clicks on dial button, phone call should be made to that number, allow user to view call log history from your application. (Unit :- 3, Chapter :- 16) Placing Call. Write permission tag in manifest file to place a call. o android.permission.call_phone Create instance of URI, provide phone no. to dial as argument of parse. Create instance of Intent pass arguments o Intent action (Intent.ACTION_DIAL : launches dialer / Intent.ACTION_CALL places call directly) o Uri instance 6 Viewing Call Log (Ref. pg. no. 262) Write mangedquery() method pass arguments

o CallLog.Calls.CONTENT_URI, requestedcolumns o CallLog.Calls.CACHED_NUMBER_LABEL Retrieve that information in a Cursor object, use movetofirst(), movetonext() for positioning,and getstring() methods to retrieve info. and display it in textview using settext() method. 10) What steps developer must consider before packaging android application? Explain in brief. (Unit :- 4, Chapter :- 29) Setting application name & icon Versioning the application Verifying target platforms Configure android manifest file Disable debugging Verifying application permission 7