Lesson 4 of 4
Networking, storage, performance and publishing
2 min read
Networking
- Android: Retrofit + OkHttp (+ kotlinx.serialization or Moshi). Flutter:
httpor Dio. React Native:fetch/axios with TanStack Query. - Always handle loading, success, empty and error states; show retry options; set timeouts.
- Offline-first: render from the local cache immediately, refresh in the background, queue writes made offline and sync later.
- Pagination for long lists; images through a caching library (Coil, Glide, cached_network_image, FastImage).
Local storage
- Key-value settings: DataStore / SharedPreferences (Android), shared_preferences (Flutter), AsyncStorage/MMKV (RN).
- Structured data: Room (Android), Drift/sqflite/Isar (Flutter), SQLite/WatermelonDB (RN).
- Secrets and tokens: Android Keystore / EncryptedSharedPreferences, iOS Keychain, flutter_secure_storage. Never plain preferences.
Firebase (very common in Indian startups)
Authentication (phone OTP), Firestore (real-time NoSQL database), Cloud Messaging (push notifications), Crashlytics (crash reports), Analytics, Remote Config (feature flags) and App Distribution (test builds).
Performance on budget phones
- Keep the main/UI thread free: heavy work on background threads, coroutines or isolates.
- Lists: lazy/virtualised lists with stable keys; avoid deep nested layouts.
- Images: right-sized, compressed, cached.
- Startup time: defer non-critical initialisation; measure cold start.
- App size: shrink with R8/ProGuard, Android App Bundles, remove unused assets and libraries.
- Battery: batch network calls, avoid frequent wake-ups, use WorkManager constraints.
- Profile with Android Studio Profiler, Flutter DevTools or Flipper/React DevTools.
Security basics
HTTPS only (consider certificate pinning for sensitive apps), no secrets hard-coded in the app (they can be extracted), obfuscation, root/jailbreak checks for banking-grade apps, and validation on the server, not just in the app.
Testing and release
- Unit tests for ViewModels/business logic; UI tests (Espresso, Compose testing, Flutter widget tests, Detox) for key flows.
- CI builds signed releases (Fastlane, Codemagic, GitHub Actions, EAS for Expo).
- Play Store: signed App Bundle, store listing, privacy policy and data safety form, content rating; internal → closed → open testing tracks; staged rollout (5% → 20% → 100%) while watching crash-free rate.
- Force-update or soft-update prompts to retire old versions; backend APIs versioned so old apps keep working.
Portfolio tip
Publish one real, small app on the Play Store (or as an APK with a demo video): a clean architecture, offline support, and a README explaining decisions. It beats five tutorial clones.
Check yourself
- How would you make a job-listing screen work offline?
- Where should an auth token be stored on Android?
- What is a staged rollout and why use it?
Sign up free to save your progress.