Download presentation
1
Mobile Programming Midterm Review
2
Agenda Layouts, widgets, toasts, and eventHandling Debuggings
Resources, selections, activities, explicit intent Composite Views, activities, and implicit intent and filter Fragments, permissions, and BroadcastReceiver Dialogs, Menus, SharedPreferences. Notifications, Services, and AsyncTasks. Bound Services, location, sensors, and IntentFilters ContentProviders
3
Layouts Linear, Relative, Table, Tab, FrameLayout.
Draw a picture based on the layout.xml
4
Widgets TextViews, EditText, Button, SeekBar, RadioGroup, etc.
Attributes Id Layout_width Layout_height textSize inputType gravity
5
Toast and EvenHandling
When and how to use Toast? Toast.makeText(context, “text”, Toast.LENGTH_SHORT).show(). How to handle ClickEvent.
6
Selections ListView What is the difference bewteen the two. Spinners
How to populate the spinner Statically and dynamically ArrayAdapter setAdapter(adapter) ListView What is the difference bewteen the two. onItemSelectedListener onItemSelectedListern and onItemClickListener
7
Activity Activity Lifecycle
The sequence of methods being called when a user starts the activity. The sequence of methods being called when the activity loses focus. Why do you need to override these lifecycle methods onPause(), onResume(), onStop(), onDestroy()
8
Pass Data Between Activities
Bundle Check if the bundle is null! Bundle bundle = new Bundle(); bundle.putString("fname","John"); bundle.putString("lname", "Doe"); bundle.putInt("age", 18); intent.putExtras(bundle); startActivity(intent);
9
Explicit Intent vs Implicit Intent
When do you want to use explicit intent When do you use implicit intent Intent Filters
10
Fragments Removing and Replacing fragments Fragments
Neither a view nor activity One activity can have multiple fragments OnCreateView() returns a view. How to pass data between activity and fragment SetArguments(bundle) and getArguments() Class public member variables Removing and Replacing fragments
11
Permissions and BroadcastReceiver
When should you use BroadcastReceivers? Override the onReceive() method How to statistically register your BroadcastReceiver? How to dynamically register your BroadcastReceiver? When do your register When do your unregister
12
Dialogs and Menus SharedPreference Dialogs Menu
optionMenu contextMenu SharedPreference Why do you use sharedPreference How to access to your sharedPreference
13
Notifications What is a notification When do you use notifications?
14
Service What is a service? Service Lifecycle
Perform a longer-running operation Running in the background The service and the UI activity share the same process Service Lifecycle onCreate(), onStartCommand(), onDestroy(), etc Service and IntentService. When do you use which?
15
Service Messenger is parcelable, so it can be put in a bundle.
How to communicate between service and activity Broadcast Intent Pending Result (onActivityResult()) Messenger Messenger is parcelable, so it can be put in a bundle. Override handleMessage(Message msg)
16
Async Task Multi-threading
Allows you to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers. Easy the use of main UI thread Publish the result to the UI when it is needed. What is the difference between using service and Async task?
17
Async Task Multi-threading
Allows you to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers. Easy the use of main UI thread Publish the result to the UI when it is needed. What is the difference between using service and Async task?
18
Bound Service What is a bound service and how to use it. Ibinder
Messenger
19
StartActivity and GetResult
startActivityForResult(intent, PICK_REQUEST); protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == PICK_REQUEST) { if (resultCode == RESULT_OK) { /* result is OK! */ }
20
Midterm Exam Content provider vs sharedPreference? Permissions.
When to use a content provider? ContentResolver Content provider vs sharedPreference? Permissions. Protect your content provider because By default, anyone can read from or write to your content provider. <provider> Android:readPermission=edu.tian.provider.permission.READ Android:writePermission=edu.tian.provider.permission.WRITE <permission android:name=edu.tian.provider.permission.READ>
21
Content Provider Short answers Debugging Development Design
Given a code example, find errors and fix them Development Given a code example, complete the example. Design Extra Credits
22
Debugging Development Design
23
References The Busy Coder's Guide to Android Development - Mark Murphy
Android Developers The Mobile Lab at Florida State University
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.