Mobal
Mobal
Telephony
State Machines
Communication Models
Android Networking
Wireless Connectivity
Android Telephony
Android provides a telephony API to manage calls, SMS, and network status.
Call initiation example: Using Intent.ACTION_CALL.
Efficient memory management is crucial for mobile apps due to hardware constraints.
1.
What is the fundamental unit of data transmitted over the Internet? a) Bit
b) Byte
c) Packet
d) Frame
Answer: c) Packet
2.
3.
4.
5.
What does DNS stand for? a) Digital Network System
b) Domain Name System
c) Data Node System
d) Dynamic Name Server
Answer: b) Domain Name System
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
What is an example of Internet telephony? a) Email
b) VoIP
c) SMS
d) Fiber-optic communication
Answer: b) VoIP
16.
17.
18.
19.
20.
1. Introduction
Modes:
o MODE_PRIVATE: Restricts access to the application.
o MODE_PUBLIC: Allows access by other applications.
o MODE_APPEND: Used for appending data.
Key Methods:
Example:
Files saved in internal storage are private and deleted upon app uninstallation.
To write data:
1. Call openFileOutput().
2. Write using write().
3. Close with close().
To read data:
1. Call openFileInput().
2. Read bytes with read().
3. Close with close().
Example:
SQLite is built into Android and used for lightweight, embedded databases.
Creating a database:
o Subclass SQLiteOpenHelper.
o Override onCreate() and onUpgrade().
Database operations:
Example:
Content Providers manage shared app data and allow secure access.
Data can be stored in SQLite, files, or other formats.
Content URI Structure: content://authority/optionalPath/optionalID
Key methods:
a) SharedPreferences
b) SQLite Database
c) XML Storage
d) Internal Storage
a) MODE_APPEND
b) MODE_PRIVATE
c) MODE_PUBLIC
d) MODE_SECURE
Answer: b) MODE_PRIVATE
a) putInt()
b) putFloat()
c) putString()
d) putBoolean()
Answer: c) putString()
a) onUpgrade()
b) onCreate()
c) onDestroy()
d) onSync()
Answer: b) onCreate()
a) remove()
b) delete()
c) erase()
d) clear()
Answer: b) delete()
a) SharedPreferences
b) SQLite Database
c) Internal Storage
d) External Storage
a) SharedPreferences
b) Distributed File System
c) Internal Storage
d) Version Control System
a) File Synchronization
b) Version Control
c) Mirror Computing
d) Cloud Backup
a) getAll()
b) getValues()
c) retrieveData()
d) fetchAll()
Answer: a) getAll()
a) writeFile()
b) openFileOutput()
c) storeData()
d) saveFile()
Answer: b) openFileOutput()
a) Public
b) Private
c) Shared
d) Encrypted
Answer: b) Private
a) add()
b) insert()
c) store()
d) put()
Answer: b) insert()
java
CopyEdit
Reading Assignment: Handlers in threads.
3. Android Animations
Android offers multiple animation systems for enhancing user interfaces.
View Animation: Simple transformations like moving, resizing, and rotation.
Example (Fade In
Fade Out Animatio
java
CopyEdit
java
CopyEdit
Drawable Animation: Uses multiple images in sequence to create animations.
xml
o
o
CopyEdit
o
o
<animation-list
xmlns:android="http://schemas.android.com/apk/res/an
droid"
android:oneshot="false">
<item android:drawable="@drawable/frame1"
android:duration="100"/>
<item android:drawable="@drawable/frame2"
android:duration="100"/>
<item android:drawable="@drawable/frame3"
android:duration="100"/></animation-list>
o
o
o Java Code:
o
java
o
o
CopyEdit
o
o
ImageView imageView =
findViewById(R.id.imageView);
imageView.setBackgroundResource(R.drawable.animat
ion_list);AnimationDrawable animationDrawable =
(AnimationDrawable) imageView.getBackground();
animationDrawable.start();
o
o
o Software entities that move between devices to transfer and process multimedia.
o Can carry, process, and make decisions about multimedia files.
P2P Architecture:
o Devices share files without a central server.
o Each device helps others by sharing storage and processing power.
5. Android Multimedia
Android provides the MediaPlayer class for playing audio and video.
Creating a MediaPlayer
instance:
java
CopyEdit
Key Methods:
o .start() – Starts media playback.
o .pause() – Pauses playback.
o .stop() – Stops playback.
o .release() – Releases MediaPlayer resources.
1. What is multithreading?
a) run()
b) start()
c) execute()
d) begin()
Answer: b) start()
a) RelativeLayout
b) LinearLayout
c) ConstraintLayout
d) FrameLayout
Answer: c) ConstraintLayout
5. What is the best way to avoid UI performance
issues?
a) View Animation
b) Drawable Animation
c) Frame Animation
d) Video Animation
a) AnimationManager
b) AnimationDrawable
c) AnimationView
d) AnimationHandler
Answer: b) AnimationDrawable
a) <animation-list>
b) <frame-animation>
c) <drawable-animation>
d) <image-list>
Answer: a) <animation-list>
a) animation.start()
b) animation.play()
c) animation.begin()
d) animation.run()
Answer: a) animation.start()
a) AudioManager
b) VideoView
c) MediaPlayer
d) MediaManager
Answer: c) MediaPlayer
a) play()
b) begin()
c) start()
d) launch()
Answer: c) start()
a) pause()
b) stop()
c) halt()
d) suspend()
Answer: a) pause()