Mobile Programming
Semester VI · BCA 352 · 3 credits
0 / 7
chapters done
-
The syllabus asks for
- The mobile landscape
- Android architecture
- iOS architecture in outline
- Constraints that shape mobile design
- Screen density arithmetic
- Setting up an Android project
- The platform you can see: hardware, pixels and screens
Key points
- Android and iOS dominate; native, web, PWA, hybrid and cross-platform approaches trade cost against fidelity.
- Android layers: Linux kernel, HAL, native libraries and ART, Java API framework, apps; each app is sandboxed in its own process and can be killed in the background.
- iOS layers: Core OS, Core Services, Media, Cocoa Touch; concepts map one-to-one to Android.
- Mobile constraints (battery, memory, screens, intermittent network, interruptions) shape design; in Nepal, low-end devices, offline use and Nepali support matter most.
- px = dp × dpi/160; image memory = width × height × bytes per pixel; sample down large images.
-
The syllabus asks for
- Application components
- Intents
- The Activity lifecycle
- Configuration changes and saving state
- Tasks, back stack and launch modes
- Services, receivers and providers in outline
- Seeing the lifecycle: states, stacks and intents
Key points
- An app is a set of components (Activity, Service, BroadcastReceiver, ContentProvider) declared in the manifest and started by the system.
- Intents are messages; explicit Intents name a class, implicit Intents describe an action matched by intent filters; extras must be small.
- The Activity lifecycle (onCreate … onDestroy) is driven by the system; the back stack keeps stopped activities; rotation destroys and recreates the activity.
- Survive rotation with ViewModel and onSaveInstanceState; survive everything with persistent storage.
- Launch modes control instance reuse; services, receivers and providers have narrow, battery-aware roles.
-
The syllabus asks for
- Views and layouts
- Handling events and input
- RecyclerView
- Fragments
- Jetpack Compose in outline
- Seeing the interface: tools, trees, lists and panes
Key points
- UIs are trees of Views in ViewGroups; ConstraintLayout gives flat, responsive screens; resource qualifiers supply Nepali text, dark mode, tablets and density-specific assets.
- All UI work runs on the main thread; blocking it risks an ANR, so I/O goes to background threads.
- RecyclerView recycles a handful of ViewHolders (15 here instead of 10,000); DiffUtil computes the minimal list updates (n + m − 2·LCS operations).
- Fragments are lifecycle-aware UI pieces; drop view references in onDestroyView; Navigation manages destinations.
- Compose describes UI as functions of state.
-
The syllabus asks for
- Choosing a storage mechanism
- Preferences and files
- SQLite and SQL
- Room
- Testing business logic off the device
- Security of stored data
- Seeing where data lives: flash, files, tables and keys
Key points
- Match storage to data: DataStore for settings, files for blobs, Room/SQLite for records, content providers for sharing, a server for the source of truth.
- SQL queries use parameter binding; transactions roll back on failure (the executed example left row 1 at 450).
- Room provides Entity, DAO and Database with compile-time-checked queries, Flow updates and migrations.
- Pure business logic is testable on a JVM (the EMI example); keep Android classes thin.
- Encrypt sensitive data and keep secrets off the device.
-
The syllabus asks for
- HTTP and REST in brief
- JSON
- Keeping the main thread free
- Retry and backoff
- Background work that must finish
- Seeing the network: towers, requests, states and retries
Key points
- HTTP methods, status codes and REST resources; use HTTPS, tokens and timeouts.
- JSON is parsed into objects defensively (missing fields, pagination, compression); the sample parse gave 3 items totalling Rs 1570.
- Network and disk run off the main thread: coroutines with ViewModel and a Loading/Ok/Error state.
- Retry only transient, idempotent failures with exponential backoff (1, 2, 4, 8, 16, 30, 30 seconds).
- WorkManager runs deferrable work reliably under constraints; respect Doze and battery.
-
The syllabus asks for
- Permissions
- Sensors
- Location
- Camera, media and sensors of the environment
- Notifications
- Seeing the sensors: chips, satellites, curves and prompts
Key points
- Permissions are normal, dangerous (runtime), special or signature; ask minimally, in context, with a rationale and a fallback.
- Sensors deliver noisy values at chosen rates; unregister listeners in onPause; a magnitude-threshold step detector counted 20 steps in the simulated walk.
- Location uses GPS, network and fused providers; the haversine formula gives great-circle distance; trade accuracy against battery.
- CameraX, photo picker, QR scanning and Bluetooth/NFC extend the device's reach with their own permissions.
- Notifications need channels, a PendingIntent and (recent Android) a runtime permission; FCM delivers push messages.
-
The syllabus asks for
- Cross-platform frameworks
- Testing and quality
- Packaging: APK, AAB and shrinking
- Signing
- Versioning and release
- A development checklist
- Seeing the release: frameworks, tests, packages and keys
Key points
- Cross-platform frameworks (Flutter, React Native, Kotlin Multiplatform, PWAs) trade one code base against size, fidelity and plugin dependence; choose by team skills and requirements.
- Test mostly with fast JVM unit tests, some integration tests and few UI tests; test on low-end devices, slow networks and Nepali locale.
- Release as a shrunk (R8) AAB; Play generates device-specific APKs; keep download size low.
- Signing proves authorship and integrity; v2 signs chunk digests of the whole file (tampering flips the root digest); protect the key.
- versionCode must increase (major × 10,000 + minor × 100 + patch); publish through staged tracks with a complete listing.
No chapter matches. Try another word.
The paper
TU assessment: 60% final examination set by the university, 40% internal (assignments, lab work, attendance). Confirm the split in your college's notice.
Where the hours go
Teaching hours are the board's guide to how much of the paper each part carries.
- Unit 2 · Android Components, Intents and the Activity Lifecycle8 h
- Unit 3 · User Interface - Layouts, RecyclerView and Fragments8 h
- Unit 4 · Data Storage - Preferences, Files, SQLite and Room7 h
- Unit 5 · Networking, JSON and Background Work7 h
- Unit 1 · Mobile Platforms and Application Architecture6 h
- Unit 6 · Sensors, Location, Permissions and Notifications6 h
- Unit 7 · Cross-Platform Development, Testing and Publishing6 h