PES INSTITUTE OF TECHNOLOGY (BSC) IV MCA, Second IA Test, May 2017 Mobile Applications (13MCA456) Solution Set Faculty: Jeny Jijo

Size: px
Start display at page:

Download "PES INSTITUTE OF TECHNOLOGY (BSC) IV MCA, Second IA Test, May 2017 Mobile Applications (13MCA456) Solution Set Faculty: Jeny Jijo"

Transcription

1 PES INSTITUTE OF TECHNOLOGY (BSC) IV MCA, Second IA Test, May 2017 Mobile Applications (13MCA456) Solution Set Faculty: Jeny Jijo 1) Explain the techniques to handle changes in screen orientation in Android [10] Give detailed description of below techniques of screen orientation Anchoring The easiest way is to anchor your views to the four edges of the screen. When the screen orientation changes, the views can anchor neatly to the edges. Resizing and repositioning Whereas anchoring and centralizing are simple techniques to ensure that views can handle changes in screen orientation, the ultimate technique is resizing each and every view according to the current screen orientation. 2 (a) How do you persist the state information during changes in configuration in Android? [5] To preserve the state of an activity, you could always implement the onpause() event, and then use your own ways to preserve the state of your activity, such as using a database, internal or external file storage, etc. onpause() - This event is always fired whenever an activity is killed or pushed into the background. If you simply want to preserve the state of an activity so that it can be restored later when the activity is re-created (such as when the device changes orientation), a much simpler way would be to implement the onsaveinstancestate() method, as it provides a Bundle object as an argument so that you can use it to save your activity s public void onsaveinstancestate(bundle outstate) //---save whatever you need to persist--- outstate.putstring( ID, ); super.onsaveinstancestate(outstate); When an activity is re-created, the oncreate() event is first fired, followed by the onrestoreinstancestate() event, which enables you to retrieve the state that you saved previously in the onsaveinstancestate event through the Bundle object in its public void onrestoreinstancestate(bundle savedinstancestate) super.onrestoreinstancestate(savedinstancestate); //---retrieve the information persisted earlier--- String ID = savedinstancestate.getstring( ID );

2 To extract the saved data, you can extract it in the oncreate() event, using the getlastnonconfigurationinstance() method, like public void oncreate(bundle savedinstancestate) super.oncreate(savedinstancestate); setcontentview(r.layout.main); Log.d( StateInfo, oncreate ); String str =(String)getLastNonConfigurationInstance(); (b) Explain Picker Views briefly. [5] Selecting the date and time is one of the common tasks you need to perform in a mobile application. Android supports this functionality through the TimePicker and DatePicker views. The TimePicker view enables users to select a time of the day, in either 24-hour mode or AM/PM mode. The TimePicker displays a standard UI to enable users to set a time. By default, it displays the time in the AM/PM format. If you wish to display the time in the 24-hour format, you can use the setis24hour View() method. To programmatically get the time set by the user, use the getcurrenthour() and getcurrentminute() methods: Toast.makeText(getBaseContext(), Time selected: +timepicker.getcurrenthour() + : + timepicker.getcurrentminute(), Toast.LENGTH_SHORT).show(); Using the DatePicker, you can enable users to select a particular date on the activity <DatePicker android:layout_width= wrap_content android:layout_height= wrap_content /> 3(a) Explain Spinner View [4 ] The ListView displays a long list of items in an activity, but sometimes you may want your user interface to display other views, and hence you do not have the additional space for a full-screen view like the ListView. In such cases, you should use the SpinnerView. The SpinnerView displays one item at a time from a list and enables users to choose among them. Views can fire events when users interact with them. For example, when a user touches a Button view, you need to service the event so that the appropriate action can be performed. To do so, you need to explicitly register events for views. Button btn1 = (Button)findViewById(R.id.btn1); btn1.setonclicklistener(btnlistener); //create an anonymous class to act as a button clicklistener private OnClickListener btnlistener = new OnClickListener() public void onclick(view v)

3 Toast.makeText(getBaseContext(), ((Button) v).gettext() + was clicked, Toast.LENGTH_LONG).show();; (b) How does Image Switcher work as User Interface in Android? [04] Sometimes you don t want an image to appear abruptly when the user selects it in the Gallery view you might, for example, want to apply some animation to the image when it transits from one image to another. In this case, you need to use the ImageSwitcher together with the Gallery view. <Gallery android:layout_width= fill_parent android:layout_height= wrap_content /> <ImageSwitcher android:layout_width= fill_parent android:layout_height= fill_parent android:layout_alignparentleft= true android:layout_alignparentright= true android:layout_alignparentbottom= true /> imageswitcher = (ImageSwitcher) findviewbyid(r.id.switcher1); imageswitcher.setfactory(this); imageswitcher.setinanimation(animationutils.loadanimation(this, android.r.anim.fade_in)); imageswitcher.setoutanimation(animationutils.loadanimation(this, android.r.anim.fade_out)); Gallery gallery = (Gallery) findviewbyid(r.id.gallery1); gallery.setadapter(new ImageAdapter(this)); gallery.setonitemclicklistener(new OnItemClickListener() public void onitemclick(adapterview<?> parent, View v, int position, long id) imageswitcher.setimageresource(imageids[position]); In the oncreate() method, you get a reference to the ImageSwitcher view and set the animation, specifying how images should fly in and out of the view When an image is selected in the Gallery view, it will appear by fading in. When the next image is selected, the current image will fade out. If you want the image to slide in from the left and slide out to the right when another image is selected, try the following animation: imageswitcher.setinanimation(animationutils.loadanimation(this, android.r.anim.slide_in_left)); imageswitcher.setoutanimation(animationutils.loadanimation(this, android.r.anim.slide_out_right));

4 4) Describe Menus with views in Android [10] Menus are useful for displaying additional options that are not directly visible on the main UI of an application. There are two main types of menus in Android: a. Options menu - Displays information related to the current activity. In Android, you activate the options menu by pressing the MENU key. b. Context menu - Displays information related to a particular view on an activity. In Android,to activate a context menu you tap and hold on to it. The option menu is displayed whenever the user presses the MENU button. The menu items displayed vary according to the current activity that is running. A context menu is that is displayed when the user presses and holds on a hyperlink displayed on the page. The menu items displayed vary according to the component or view currently selected. To activate the context menu, the user selects an item on the screen and either taps and holds it or simply presses the center button on the directional keypad. 5) a Define and describe Content Provider [4] In Android, using a content provider is the recommended way to share data across packages. A content provider behaves very much like a database you can query it, edit its content, as well as add or delete its content. However, unlike a database, a content provider can use different ways to store its data. The data can be stored in a database, in files, or even over a network. Android has many useful content providers Browser - Stores data such as browser bookmarks, browser history, and so on CallLog - Stores data such as missed calls, call details, and so on Contacts - Stores contact details MediaStore - Stores media files such as audio, video and images Settings - Stores the device s settings and preferences We can create our own content providers. To query a content provider, you specify the query string in the form of a URI, with an optional specifier for a particular row. The format of the query URI is as follows: <standard_prefix>://<authority>/<data_path>/<id> The standard prefix for content providers is always content://. The authority specifies the name of the content provider The data path specifies the kind of data requested The id specifies the specific record requested (b) How does Android helps in getting Location Based Data. [6] We can use a GPS receiver to find your location easily. However, GPS requires a clear sky to work and hence does not always work indoors or where satellites can t penetrate. Another effective way to locate your position is through cell tower triangulation. The advantage of cell tower triangulation is that it works indoors, without the need to obtain information from

5 satellites.cell tower triangulation works best in densely populated areas where the cell towers are closely located. A third method of locating your position is to rely on Wi-Fi triangulation. Rather than connect to cell towers, the device connects to a Wi-Fi network and checks the service provider against databases to determine the location serviced by the provider. Of the three methods described here, Wi-Fi triangulation is the least accurate. On the Android, the SDK provides the LocationManager class to help your device determine the user s physical location. In Android, location-based services are provided by the LocationManager class, located in the android.location package. Using the LocationManager class, the application can obtain periodic updates of the device s geographical locations, as well as fire an intent when it enters the proximity of a certain location. To be notified whenever there is a change in location, you need to register a request for location changes so that your program can be notified periodically. This is done via the requestlocationupdates() method: lm.requestlocationupdates(locationmanager.gps_provider,0,0,locationlistener);. 6) Explain the basic ways of persisting data in Android. [10] In Android, you can use the classes in the java.io namespace to do so. Saving to Internal Storage The first way to save files in your Android application is to write to the device s internal storage. To save text into a file, you use the FileOutputStream class. The openfileoutput() method opens a named file for writing, with the mode specified. In this example, you use the MODE_WORLD_READABLE constant to indicate that the file is readable by all other applications: FileOutputStream fout = openfileoutput( textfile.txt, MODE_WORLD_READAB LE); Other modes MODE_PRIVATE MODE_APPEND (for appending to an existing file), and MODE_WORLD_WRITEABLE (all other applications have write access to the file). To convert a character stream into a byte stream, you use an instance of the OutputStreamWriter class, by passing it an instance of the FileOutputStream object: OutputStreamWriter osw = new OutputStreamWriter(fOut); Then the write() method is used to write the string to the file. To ensure that all the bytes are written to the file, use the flush() method. Finally, use the close() method to close the file: osw.write(str); osw.flush(); osw.close(); To read the content of a file, you use the FileInputStream class, together with the InputStreamReader class: FileInputStream fin = openfileinput ( textfile.txt );

6 InputStreamReader isr = new InputStreamReader(fIn); The content is read in blocks of 100 characters into a buffer (character array). The characters read are then copied into a String object. Saving to External Storage (SD Card) Sometimes, it would be useful to save them to external storage (such as an SD card) because of its larger capacity, as well as the capability to share the files easily with other users (by removing the SD card and passing it to somebody else). to save the text entered by the user in the SD card, modify the onclick() method of the Save button For saving relational data, using a database is much more efficient. Android uses the SQLite database system. The database that you create for an application is only accessible to itself; other applications will not be able to access it. For Android, the SQLite database that you create programmatically in an application is always stored in the /data/data/<package_name>/databases folder. 7 (a) Explain the basics of Objective-C. [4] Objective-C is an object-oriented language based on the C programming language. Objective-C was created in the early 1980s by Brad Cox and Tom Love, and gained popularity when Steve Jobs and NeXT licensed the language from them, and made Objective- C the main language on NeXT s NextSTEP operating system. Objective-C requires developers to declare a class in an interface and then define the implementation, something that non-c developers find off-putting about the language. Classes The interface of Objective-C classes is defined in a header file for each interface. Usually the filenames of the header match the class name. For example, you can create a header file named Dog : Animal // instance variables // Method You are telling the compiler that a new class named Dog, which is a subclass of animal, is being declared. Any instance variables are declared between the curly brackets, and methods are declared between the end of the curly bracket and keyword. The actual implementation of the Dog class would look like this: #import Dog // method Instance Variables

7 The attributes that are declared between the curly brackets are instance variables. Instance variables are declared like local or global variables, but have a different scope. Instance variables by default are visible in all instance methods of a class and its subclasses. Methods Methods can be declared as either instance methods or class methods. Instance methods are called by sending a message directly to the instance of the class, which means you need to have your own instance of the class before you can call these methods. Instance methods are prefixed with a minus sign (-). -(return_type)method_name:(argumenttype1) argumentname1 joiningargument2:( argumenttype2 )argumentname2... joiningargumentn:( argumenttype n )argumentname n body of the function If Statements if( a < 20 ) /* if condition is true then print the following */ NSLog(@"a is less than 20\n" ); else /* if condition is false then print the following */ NSLog(@"a is not less than 20\n" ); for (int i = 1; i <= 10; i++) NSLog(@"%d", i); To loop through a collection of NSString objects in an NSArray and print them all out, you could use the following format. for (NSString* currentstring in myarrayofstrings) // code that may cause the (NSException *e) //exception is caught and logic should be added to handle the // code that should be executed no matter if an exception has occurred or not. 7(b) Explain the tools required for developing Windows Phone 7 software [5] To develop software for Windows Phone 7 you need a machine running Windows (Vista or Windows 7), Visual Studio 2010, and the Phone SDK, as well as a Windows Phone 7 device to test with. Hardware HTC, Nokia, and Samsung are currently manufacturing Windows Phone 7 devices. Device resolutions are pixels, and most are outfitted with both front- and

8 rear-facing cameras, and screens from 4.3 to 4.7 inches. They are primarily found on GSM carriers. Visual Studio and Windows Phone SDK Code for the Windows Phone is written in the.net Framework, either with XNA (Microsoft s run time for game development), or a custom version of Silverlight (Microsoft s Rich Internet Application framework). User interfaces are created with XAML (extensible Application Markup Language). The Windows Phone SDK works with Visual Studio Express. The SDK also installs a specialized version of Expression Blend set up to work specifically for Windows Phone 7 development. Expression Blend is a tool developed by Microsoft for working with XAML. It provides similar functionality to Visual Studio, though its layout is designed to be more user friendly to designers. The Windows Phone SDK installer includes: Visual Studio 2010 Express for Windows Phone (if you do not have another version of Visual Studio 2010 installed) Windows Phone Emulator Windows Phone SDK Assemblies Silverlight 4 SDK Phone SDK 7.1 Extensions for XNA Game Studio Expression Blend for Windows Phone 7 WCF Data Services Client for Windows Phone Microsoft Advertising SDK To install the Windows Phone SDK you need: Vista (x86 or x64) or Windows 7 (x86 or x64) 4 GB of free disk space 3 GB of RAM DirectX 10 or above capable graphics card with a WDDM 1.1 driver The Windows Phone 7 emulator is a very powerful tool. Not just a simulator, the emulator runs a completely sandboxed virtual machine in order to better mimic the actual device. It also comes with some customization and runtime tools to manipulate sensors that are being emulated on the device, including GPS and accelerometer, as well as provide a way to capture screenshots while testing and developing applications.

(c) Dr Sonia Sail LAJMI College of Computer Sciences & IT (girl Section) 1

(c) Dr Sonia Sail LAJMI College of Computer Sciences & IT (girl Section) 1 Level 5: Baccalaureus in Computer Sciences CHAPTER 4: LAYOUTS AND VIEWS Dr. Sonia Saïd LAJMI PhD in Computer Sciences 1 Layout.xml 2 Computer Sciences & IT (girl Section) 1 Layout Requirements android:layout_width:

More information

Lecture 7: Data Persistence : shared preferences. Lecturer : Ali Kadhim Al-Bermani Mobile Fundamentals and Programming

Lecture 7: Data Persistence : shared preferences. Lecturer : Ali Kadhim Al-Bermani Mobile Fundamentals and Programming University of Babylon College of Information Technology Department of Information Networks Mobile Fundamentals and Programming Lecture 7: Data Persistence : shared preferences Lecturer : Ali Kadhim Al-Bermani

More information

SAVING SIMPLE APPLICATION DATA

SAVING SIMPLE APPLICATION DATA 1 DATA PERSISTENCE OBJECTIVES In this chapter, you will learn how to persist data in your Android applications. Persisting data is an important topic in application development, as users typically expect

More information

ANDROID USER INTERFACE

ANDROID USER INTERFACE 1 ANDROID USER INTERFACE Views FUNDAMENTAL UI DESIGN Visual interface element (controls or widgets) ViewGroup Contains multiple widgets. Layouts inherit the ViewGroup class Activities Screen being displayed

More information

Fragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment

Fragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment FRAGMENTS Fragments An activity is a container for views When you have a larger screen device than a phone like a tablet it can look too simple to use phone interface here. Fragments Mini-activities, each

More information

Minds-on: Android. Session 2

Minds-on: Android. Session 2 Minds-on: Android Session 2 Paulo Baltarejo Sousa Instituto Superior de Engenharia do Porto 2016 Outline Activities UI Events Intents Practice Assignment 1 / 33 2 / 33 Activities Activity An activity provides

More information

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling

Mobile Programming Lecture 2. Layouts, Widgets, Toasts, and Event Handling Mobile Programming Lecture 2 Layouts, Widgets, Toasts, and Event Handling Lecture 1 Review How to edit XML files in Android Studio? What holds all elements (Views) that appear to the user in an Activity?

More information

5Displaying Pictures and Menus with Views

5Displaying Pictures and Menus with Views 5Displaying Pictures and Menus with Views WHAT YOU WILL LEARN IN THIS CHAPTER How to use the Gallery, ImageSwitcher, GridView, and ImageView views to display images How to display options menus and context

More information

Programming in Android. Nick Bopp

Programming in Android. Nick Bopp Programming in Android Nick Bopp nbopp@usc.edu Types of Classes Activity This is the main Android class that you will be using. These are actively displayed on the screen and allow for user interaction.

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 3 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 2 - recap Views and Layouts Events Basic application components Activities Intents 9/15/2014

More information

Introduction To Android

Introduction To Android Introduction To Android Mobile Technologies Symbian OS ios BlackBerry OS Windows Android Introduction to Android Android is an operating system for mobile devices such as smart phones and tablet computers.

More information

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Lecture 3: Android Life Cycle and Permission Android Lifecycle An activity begins its lifecycle when entering the oncreate() state If not

More information

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I) Lecture 3: Android Life Cycle and Permission Entire Lifetime An activity begins its lifecycle when entering the oncreate() state If not interrupted

More information

Atmiya Institute of Technology & Science, Rajkot Department of MCA

Atmiya Institute of Technology & Science, Rajkot Department of MCA Atmiya Institute of Technology & Science, Rajkot Department of MCA Chapter 10 Application Preference (/data/data//shared_prefs/.xml) Private Preference (Data sharing

More information

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH Android Basics - Bhaumik Shukla Android Application Developer @ STEALTH FLASH Introduction to Android Android is a software stack for mobile devices that includes an operating system, middleware and key

More information

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

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology Mobile Application Development Produced by David Drohan (ddrohan@wit.ie) Department of Computing & Mathematics Waterford Institute of Technology http://www.wit.ie User Interface Design" & Development -

More information

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

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml Understand applications and their components activity service broadcast receiver content provider intent AndroidManifest.xml Android Application Written in Java (it s possible to write native code) Good

More information

User Interface: Layout. Asst. Prof. Dr. Kanda Runapongsa Saikaew Computer Engineering Khon Kaen University

User Interface: Layout. Asst. Prof. Dr. Kanda Runapongsa Saikaew Computer Engineering Khon Kaen University User Interface: Layout Asst. Prof. Dr. Kanda Runapongsa Saikaew Computer Engineering Khon Kaen University http://twitter.com/krunapon Agenda User Interface Declaring Layout Common Layouts User Interface

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 3 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 2 -recap Views and Layouts Events Basic application components Activities Intents BroadcastReceivers

More information

Android User Interface Android Smartphone Programming. Outline University of Freiburg

Android User Interface Android Smartphone Programming. Outline University of Freiburg Android Smartphone Programming Matthias Keil Institute for Computer Science Faculty of Engineering 20. Oktober 2014 Outline 1 2 Multi-Language Support 3 Summary Matthias Keil 20. Oktober 2014 2 / 19 From

More information

Android User Interface

Android User Interface Android Smartphone Programming Matthias Keil Institute for Computer Science Faculty of Engineering 20. Oktober 2014 Outline 1 Android User Interface 2 Multi-Language Support 3 Summary Matthias Keil Android

More information

Orientation & Localization

Orientation & Localization Orientation & Localization Overview Lecture: Open Up Your My Pet App Handling Rotations Serializable Landscape Layouts Localization Alert Dialogs 1 Handling Rotations When the device is rotated, the device

More information

ListView Containers. Resources. Creating a ListView

ListView Containers. Resources. Creating a ListView ListView Containers Resources https://developer.android.com/guide/topics/ui/layout/listview.html https://developer.android.com/reference/android/widget/listview.html Creating a ListView A ListView is a

More information

Content Provider. Introduction 01/03/2016. Session objectives. Content providers. Android programming course. Introduction. Built-in Content Provider

Content Provider. Introduction 01/03/2016. Session objectives. Content providers. Android programming course. Introduction. Built-in Content Provider Android programming course Session objectives Introduction Built-in Custom By Võ Văn Hải Faculty of Information Technologies 2 Content providers Introduction Content providers manage access to a structured

More information

Mobile Application Programing: Android. View Persistence

Mobile Application Programing: Android. View Persistence Mobile Application Programing: Android Persistence Activities Apps are composed of activities Activities are self-contained tasks made up of one screen-full of information Activities start one another

More information

Developing Android Applications Introduction to Software Engineering Fall Updated 1st November 2015

Developing Android Applications Introduction to Software Engineering Fall Updated 1st November 2015 Developing Android Applications Introduction to Software Engineering Fall 2015 Updated 1st November 2015 Android Lab 3 & Midterm Additional Concepts No Class Assignment 2 Class Plan Android : Additional

More information

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna Programming with Android: System Architecture Luca Bedogni Marco Di Felice Dipartimento di Scienze dell Informazione Università di Bologna Outline Android Architecture: An Overview Android Dalvik Java

More information

Mobile Programming Lecture 3. Resources, Selection, Activities, Intents

Mobile Programming Lecture 3. Resources, Selection, Activities, Intents Mobile Programming Lecture 3 Resources, Selection, Activities, Intents Lecture 2 Review What widget would you use to allow the user to enter a yes/no value a range of values from 1 to 100 What's the benefit

More information

CS 193A. Activity state and preferences

CS 193A. Activity state and preferences CS 193A Activity state and preferences This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. Activity instance

More information

CSCU9YH: Development with Android

CSCU9YH: Development with Android : Development with Android Computing Science and Mathematics University of Stirling Data Storage and Exchange 1 Preferences: Data Storage Options a lightweight mechanism to store and retrieve keyvalue

More information

CMSC436: Fall 2013 Week 3 Lab

CMSC436: Fall 2013 Week 3 Lab CMSC436: Fall 2013 Week 3 Lab Objectives: Familiarize yourself with the Activity class, the Activity lifecycle, and the Android reconfiguration process. Create and monitor a simple application to observe

More information

Solving an Android Threading Problem

Solving an Android Threading Problem Home Java News Brief Archive OCI Educational Services Solving an Android Threading Problem Introduction by Eric M. Burke, Principal Software Engineer Object Computing, Inc. (OCI) By now, you probably know

More information

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

M.C.A. Semester V Subject: - Mobile Computing (650003) Week : 1 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

More information

Stanislav Rost CSAIL, MIT

Stanislav Rost CSAIL, MIT Session 2: Lifecycles, GUI Stanislav Rost CSAIL, MIT The Plan 1 Activity lifecycle Service lifecycle 2 Selected GUI elements UI Layouts 3 Hands on assignment: RoboChat Application GUI Design Birth, death,

More information

Mobile Application Development Android

Mobile Application Development Android Mobile Application Development Android Lecture 3 MTAT.03.262 Satish Srirama satish.srirama@ut.ee Android Lecture 2 - recap Views and Layouts Events Basic application components Activities Intents 9/22/2017

More information

Mobile and Ubiquitous Computing: Android Programming (part 4)

Mobile and Ubiquitous Computing: Android Programming (part 4) Mobile and Ubiquitous Computing: Android Programming (part 4) Master studies, Winter 2015/2016 Dr Veljko Pejović Veljko.Pejovic@fri.uni-lj.si Examples from: Mobile and Ubiquitous Computing Jo Vermeulen,

More information

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

CS 528 Mobile and Ubiquitous Computing Lecture 3b: Android Activity Lifecycle and Intents Emmanuel Agu CS 528 Mobile and Ubiquitous Computing Lecture 3b: Android Activity Lifecycle and Intents Emmanuel Agu Android Activity LifeCycle Starting Activities Android applications don't start with a call to main(string[])

More information

How-to s and presentations. Be prepared to demo them in class. https://sites.google.com/site/androidhowto/presentati ons

How-to s and presentations. Be prepared to demo them in class. https://sites.google.com/site/androidhowto/presentati ons Upcoming Assignments Readings: Chapter 6 by today Lab 3 due today (complete survey) Lab 4 will be available Friday (due February 5) Friday Quiz in Blackboard 2:10-3pm (Furlough) Vertical Prototype due

More information

Mobile Development Lecture 11: Activity State and Preferences

Mobile Development Lecture 11: Activity State and Preferences Mobile Development Lecture 11: Activity State and Preferences Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com Activity Instance State Instance state: Current state of an activity. Which boxes

More information

Beginning Android 4 Application Development

Beginning Android 4 Application Development Beginning Android 4 Application Development Lee, Wei-Meng ISBN-13: 9781118199541 Table of Contents INTRODUCTION xxi CHAPTER 1: GETTING STARTED WITH ANDROID PROGRAMMING 1 What Is Android? 2 Android Versions

More information

Android File & Storage

Android File & Storage Files Lecture 9 Android File & Storage Android can read/write files from two locations: Internal (built into the device) and external (an SD card or other drive attached to device) storage Both are persistent

More information

Building User Interface for Android Mobile Applications II

Building User Interface for Android Mobile Applications II Building User Interface for Android Mobile Applications II Mobile App Development 1 MVC 2 MVC 1 MVC 2 MVC Android redraw View invalidate Controller tap, key pressed update Model MVC MVC in Android View

More information

CS371m - Mobile Computing. Persistence

CS371m - Mobile Computing. Persistence CS371m - Mobile Computing Persistence Storing Data Multiple options for storing data associated with apps Shared Preferences Internal Storage device memory External Storage SQLite Database Network Connection

More information

Mobile Computing LECTURE # 2

Mobile Computing LECTURE # 2 Mobile Computing LECTURE # 2 The Course Course Code: IT-4545 Course Title: Mobile Computing Instructor: JAWAD AHMAD Email Address: jawadahmad@uoslahore.edu.pk Web Address: http://csandituoslahore.weebly.com/mc.html

More information

Programming with Android: System Architecture. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna

Programming with Android: System Architecture. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna Programming with Android: System Architecture Luca Bedogni Dipartimento di Scienze dell Informazione Università di Bologna Outline Android Architecture: An Overview Android Java Virtual Machine Android

More information

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza Data persistence Shared preferences A method to store primitive data in android as key-value pairs, these saved data will

More information

Lecture 2 Android SDK

Lecture 2 Android SDK Lecture 2 Android SDK This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a

More information

Lab 1: Getting Started With Android Programming

Lab 1: Getting Started With Android Programming Islamic University of Gaza Faculty of Engineering Computer Engineering Dept. Eng. Jehad Aldahdooh Mobile Computing Android Lab Lab 1: Getting Started With Android Programming To create a new Android Project

More information

Eventually, you'll be returned to the AVD Manager. From there, you'll see your new device.

Eventually, you'll be returned to the AVD Manager. From there, you'll see your new device. Let's get started! Start Studio We might have a bit of work to do here Create new project Let's give it a useful name Note the traditional convention for company/package names We don't need C++ support

More information

Spring Lecture 5 Lecturer: Omid Jafarinezhad

Spring Lecture 5 Lecturer: Omid Jafarinezhad Mobile Programming Sharif University of Technology Spring 2016 - Lecture 5 Lecturer: Omid Jafarinezhad Storage Options Android provides several options for you to save persistent application data. The

More information

Change in Orientation. Marco Ronchetti Università degli Studi di Trento

Change in Orientation. Marco Ronchetti Università degli Studi di Trento 1 Change in Orientation Marco Ronchetti Università degli Studi di Trento Change in orientation Change in orientation For devices that support multiple orientations, Android detects a change in orientation:

More information

ANDROID APPS DEVELOPMENT FOR MOBILE GAME

ANDROID APPS DEVELOPMENT FOR MOBILE GAME ANDROID APPS DEVELOPMENT FOR MOBILE GAME Application Components Hold the content of a message (E.g. convey a request for an activity to present an image) Lecture 2: Android Layout and Permission Present

More information

Online Learning Application

Online Learning Application Online Learning Application Objective: It s a known fact that the Average screen sizes of our phones is increasing, thereby encouraging many to read and learn on the move. Keeping this trend in mind, you

More information

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

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle CS378 - Mobile Computing Anatomy of an Android App and the App Lifecycle Application Components five primary components different purposes and different lifecycles Activity single screen with a user interface,

More information

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna Programming with Android: System Architecture Luca Bedogni Marco Di Felice Dipartimento di Scienze dell Informazione Università di Bologna Outline Android Architecture: An Overview Android Dalvik Java

More information

ORACLE UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

ORACLE UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP) Android Syllabus Pre-requisite: C, C++, Java Programming SQL & PL SQL Chapter 1: Introduction to Android Introduction to android operating system History of android operating system Features of Android

More information

Android Basics. Android UI Architecture. Android UI 1

Android Basics. Android UI Architecture. Android UI 1 Android Basics Android UI Architecture Android UI 1 Android Design Constraints Limited resources like memory, processing, battery à Android stops your app when not in use Primarily touch interaction à

More information

Android Application Development

Android Application Development Android Application Development Octav Chipara What is Android A free, open source mobile platform A Linux-based, multiprocess, multithreaded OS Android is not a device or a product It s not even limited

More information

Mobile Development Lecture 10: Fragments

Mobile Development Lecture 10: Fragments Mobile Development Lecture 10: Fragments Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com Situational Layouts Your app can use different layout in different situations: different device type

More information

LTBP INDUSTRIAL TRAINING INSTITUTE

LTBP INDUSTRIAL TRAINING INSTITUTE Java SE Introduction to Java JDK JRE Discussion of Java features and OOPS Concepts Installation of Netbeans IDE Datatypes primitive data types non-primitive data types Variable declaration Operators Control

More information

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

Practical Problem: Create an Android app that having following layouts. Practical No: 1 Practical Problem: Create an Android app that having following layouts. Objective(s) Duration for completion PEO(s) to be achieved PO(s) to be achieved CO(s) to be achieved Solution must

More information

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters Mobile Programming Lecture 5 Composite Views, Activities, Intents and Filters Lecture 4 Review How do you get the value of a string in the strings.xml file? What are the steps to populate a Spinner or

More information

Android Beginners Workshop

Android Beginners Workshop Android Beginners Workshop at the M O B IL E M O N D AY m 2 d 2 D E V E L O P E R D A Y February, 23 th 2010 Sven Woltmann, AndroidPIT Sven Woltmann Studied Computer Science at the TU Ilmenau, 1994-1999

More information

register/unregister for Intent to be activated if device is within a specific distance of of given lat/long

register/unregister for Intent to be activated if device is within a specific distance of of given lat/long stolen from: http://developer.android.com/guide/topics/sensors/index.html Locations and Maps Build using android.location package and google maps libraries Main component to talk to is LocationManager

More information

Data storage and exchange in Android

Data storage and exchange in Android Mobile App Development 1 Overview 2 3 SQLite Overview Implementation 4 Overview Methods to implement URI like SQL 5 Internal storage External storage Overview 1 Overview 2 3 SQLite Overview Implementation

More information

ACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi

ACTIVITY, FRAGMENT, NAVIGATION. Roberto Beraldi ACTIVITY, FRAGMENT, NAVIGATION Roberto Beraldi Introduction An application is composed of at least one Activity GUI It is a software component that stays behind a GUI (screen) Activity It runs inside the

More information

Android Coding. Dr. J.P.E. Hodgson. August 23, Dr. J.P.E. Hodgson () Android Coding August 23, / 27

Android Coding. Dr. J.P.E. Hodgson. August 23, Dr. J.P.E. Hodgson () Android Coding August 23, / 27 Android Coding Dr. J.P.E. Hodgson August 23, 2010 Dr. J.P.E. Hodgson () Android Coding August 23, 2010 1 / 27 Outline Starting a Project 1 Starting a Project 2 Making Buttons Dr. J.P.E. Hodgson () Android

More information

Mobile User Interfaces

Mobile User Interfaces Mobile User Interfaces CS 2046 Mobile Application Development Fall 2010 Announcements Next class = Lab session: Upson B7 Office Hours (starting 10/25): Me: MW 1:15-2:15 PM, Upson 360 Jae (TA): F 11:00

More information

Chapter 7: Reveal! Displaying Pictures in a Gallery

Chapter 7: Reveal! Displaying Pictures in a Gallery Chapter 7: Reveal! Displaying Pictures in a Gallery Objectives In this chapter, you learn to: Create an Android project using a Gallery control Add a Gallery to display a horizontal list of images Reference

More information

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology Android App Development Mr. Michaud ICE Programs Georgia Institute of Technology Android Operating System Created by Android, Inc. Bought by Google in 2005. First Android Device released in 2008 Based

More information

E-Blocks wifi controlled by an Android device

E-Blocks wifi controlled by an Android device E-Blocks wifi controlled by an Android device Benoit Pierret benoit.pierret@insa-lyon.fr Nicolas Stouls nicolas.stouls@insa-lyon.fr Yann Ricotti yann.ricotti@insa-lyon.fr Architecture This solution is

More information

A view is a widget that has an appearance on screen. A view derives from the base class android.view.view.

A view is a widget that has an appearance on screen. A view derives from the base class android.view.view. LAYOUTS Views and ViewGroups An activity contains Views and ViewGroups. A view is a widget that has an appearance on screen. A view derives from the base class android.view.view. One or more views can

More information

Answers to Exercises

Answers to Exercises Answers to Exercises CHAPTER 1 ANSWERS 1. What is an AVD? Ans: An AVD is an Android Virtual Device. It represents an Android emulator, which emulates a particular configuration of an actual Android device.

More information

GUI Widget. Lecture6

GUI Widget. Lecture6 GUI Widget Lecture6 AnalogClock/Digital Clock Button CheckBox DatePicker EditText Gallery ImageView/Button MapView ProgressBar RadioButton Spinner TextView TimePicker WebView Android Widgets Designing

More information

Fragments and the Maps API

Fragments and the Maps API Fragments and the Maps API Alexander Nelson October 6, 2017 University of Arkansas - Department of Computer Science and Computer Engineering Fragments Fragments Fragment A behavior or a portion of a user

More information

Copyright

Copyright Copyright NataliaS@portnov.com 1 Overview: Mobile APPS Categories Types Distribution/Installation/Logs Mobile Test Industry Standards Remote Device Access (RDA) Emulators Simulators Troubleshooting Guide

More information

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.

Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings. Hello World Lab Objectives: Create new Android project in Android Studio Add Button and TextView to layout Learn how to use buttons to call methods. Modify strings.xml What to Turn in: The lab evaluation

More information

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

CS 528 Mobile and Ubiquitous Computing Lecture 3: Android UI, WebView, Android Activity Lifecycle Emmanuel Agu CS 528 Mobile and Ubiquitous Computing Lecture 3: Android UI, WebView, Android Activity Lifecycle Emmanuel Agu Android UI Design Example GeoQuiz App Reference: Android Nerd Ranch, pgs 1 30 App presents

More information

Android Programming Lecture 16 11/4/2011

Android Programming Lecture 16 11/4/2011 Android Programming Lecture 16 11/4/2011 New Assignment Discuss New Assignment for CityApp GetGPS Search Web Service Parse List Coordinates Questions from last class It does not appear that SQLite, in

More information

Android Activities. Akhilesh Tyagi

Android Activities. Akhilesh Tyagi Android Activities Akhilesh Tyagi Apps, memory, and storage storage: Your device has apps and files installed andstoredonitsinternaldisk,sdcard,etc. Settings Storage memory: Some subset of apps might be

More information

Object-Oriented Programming with Objective-C. Lecture 2

Object-Oriented Programming with Objective-C. Lecture 2 Object-Oriented Programming with Objective-C Lecture 2 Objective-C A Little History Originally designed in the 1980s as a fusion of Smalltalk and C Popularized by NeXTSTEP in 1988 (hence the ubiquitous

More information

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio

COPYRIGHTED MATERIAL. Contents. Part I: C# Fundamentals 1. Chapter 1: The.NET Framework 3. Chapter 2: Getting Started with Visual Studio Introduction XXV Part I: C# Fundamentals 1 Chapter 1: The.NET Framework 3 What s the.net Framework? 3 Common Language Runtime 3.NET Framework Class Library 4 Assemblies and the Microsoft Intermediate Language

More information

Introduction to Android

Introduction to Android Introduction to Android Ambient intelligence Alberto Monge Roffarello Politecnico di Torino, 2017/2018 Some slides and figures are taken from the Mobile Application Development (MAD) course Disclaimer

More information

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

android application development CONTENTS 1.1 INTRODUCTION TO O ANDROID OPERATING SYSTEM... TURES Understanding the Android Software Stack... Contents android application development FOR m.tech (jntu - h) i semester - CSE, ii semester - WEB TECHNOLOGIES CONTENTS i UNIT - I [CH. H. - 1] ] [INTRODUCTION TO ANDROID OPERATING SYSTEM]... 1.1-1.32

More information

Vienos veiklos būsena. Theory

Vienos veiklos būsena. Theory Vienos veiklos būsena Theory While application is running, we create new Activities and close old ones, hide the application and open it again and so on, and Activity can process all these events. It is

More information

Android writing files to the external storage device

Android writing files to the external storage device Android writing files to the external storage device The external storage area is what Android knows as the SD card. There is a virtual SD card within the Android file system although this may be of size

More information

Copyright

Copyright Copyright NataliaS@portnov.com 1 Overview: Mobile APPS Categories Types Distribution/Installation/Logs Mobile Test Industry Standards Remote Device Access (RDA) Emulators Simulators Troubleshooting Guide

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu India Summer 2012 Review Session Android and Web Working with Views Working with Views Create a new Android project. The app name should

More information

Terms: MediaPlayer, VideoView, MediaController,

Terms: MediaPlayer, VideoView, MediaController, Terms: MediaPlayer, VideoView, MediaController, Sisoft Technologies Pvt Ltd SRC E7, Shipra Riviera Bazar, Gyan Khand-3, Indirapuram, Ghaziabad Website: www.sisoft.in Email:info@sisoft.in Phone: +91-9999-283-283

More information

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement. CSCE 315: Android Lectures (1/2) Dr. Jaerock Kwon App Development for Mobile Devices Jaerock Kwon, Ph.D. Assistant Professor in Computer Engineering App Development for Mobile Devices Jaerock Kwon, Ph.D.

More information

COSC 3P97 Mobile Computing

COSC 3P97 Mobile Computing COSC 3P97 Mobile Computing Mobile Computing 1.1 COSC 3P97 Prerequisites COSC 2P13, 3P32 Staff instructor: Me! teaching assistant: Steve Tkachuk Lectures (MCD205) Web COSC: http://www.cosc.brocku.ca/ COSC

More information

Services. Marco Ronchetti Università degli Studi di Trento

Services. Marco Ronchetti Università degli Studi di Trento 1 Services Marco Ronchetti Università degli Studi di Trento Service An application component that can perform longrunning operations in the background and does not provide a user interface. So, what s

More information

Introduction p. 1 Getting Started Hello, Real World p. 9 Creating, Deploying, and Profiling an App p. 9 Understanding the App Package p.

Introduction p. 1 Getting Started Hello, Real World p. 9 Creating, Deploying, and Profiling an App p. 9 Understanding the App Package p. Introduction p. 1 Getting Started Hello, Real World p. 9 Creating, Deploying, and Profiling an App p. 9 Understanding the App Package p. 12 Updating XAML and C# Code p. 22 Making the App World-Ready p.

More information

Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial

Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial Wireless Vehicle Bus Adapter (WVA) Android Library Tutorial Revision history 90001431-13 Revision Date Description A October 2014 Original release. B October 2017 Rebranded the document. Edited the document.

More information

UNDERSTANDING ACTIVITIES

UNDERSTANDING ACTIVITIES Activities Activity is a window that contains the user interface of your application. An Android activity is both a unit of user interaction - typically filling the whole screen of an Android mobile device

More information

States of Activities. Active Pause Stop Inactive

States of Activities. Active Pause Stop Inactive noname Conceptual Parts States of Activities Active Pause Stop Inactive Active state The state that the activity is on the most foreground and having a focus. This is in Active state. Active state The

More information

Produced by. Mobile Application Development. Eamonn de Leastar

Produced by. Mobile Application Development. Eamonn de Leastar Mobile Application Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie A First

More information

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

Android. Mobile operating system developed by Google A complete stack. Based on the Linux kernel Open source under the Apache 2 license Android Android Mobile operating system developed by Google A complete stack OS, framework A rich set of applications Email, calendar, browser, maps, text messaging, contacts, camera, dialer, music player,

More information

CS 4518 Mobile and Ubiquitous Computing Lecture 4: WebView (Part 2) Emmanuel Agu

CS 4518 Mobile and Ubiquitous Computing Lecture 4: WebView (Part 2) Emmanuel Agu CS 4518 Mobile and Ubiquitous Computing Lecture 4: WebView (Part 2) Emmanuel Agu WebView Widget WebView Widget A View that displays web pages Can be used for creating your own web browser OR just display

More information

Syllabus- Java + Android. Java Fundamentals

Syllabus- Java + Android. Java Fundamentals Introducing the Java Technology Syllabus- Java + Android Java Fundamentals Key features of the technology and the advantages of using Java Using an Integrated Development Environment (IDE) Introducing

More information