Key flows

How the app starts, downloads its data and moves between screens.

Startup decision flow

  1. App opens on a themed splash, then the language screen.
  2. If no language has been chosen, the user must pick English, Telugu or Tamil. Otherwise skip.
  3. If there is no Bridge account on the device, show login. Cancel closes the app. Success continues at step 5.
  4. If there is an account:
    • All mandatory downloads done (PREF_KEY_ALL_SYNCS_COMPLETE) → Home.
    • Else a VO was chosen earlier → resume Data download (Cadre).
    • Else → step 5.
  5. Fresh login: no internet → error, OK closes the app.
  6. Fetch user profile and roles. Failure → error, OK closes the app.
  7. Tenant is ap.gov → download the Village → Habitation → VO tree.
    • Failure → error, OK wipes app data and restarts.
    • Role contains unit-incharge or fmt_l1 → Data download (Unit).
    • Otherwise → Village/Habitation/VO selection (device registration first if DEVICE_BINDING_EXTERNAL_SWITCH = 1) → Data download (Cadre).
  8. Downloads complete → Home.
  9. On Home (release builds): device registration and remote actions run on top; automatic date/time must be on; app update check; session-expired check.

Data download: Cadre

#ItemMandatoryRuns
1App ConfigsYesIn sequence
2Product MasterYesIn sequence
3Practice MasterYesIn sequence
4FarmersYes (partial OK)In sequence
5IE Role MapYesIn sequence
6Farmer Assets → Farmer Asset AttachmentsNoIn parallel with 7, 8
7Portfolio → Portfolio AttachmentsNoIn parallel
8Farming Model → Farming Model AttachmentsNoIn parallel

Rules:

  • Starts automatically unless opened in load-more mode.
  • Farmers: count first; zero → "No farmers found for the selected work node".
  • Farmer page size = FARMERS_PAGINATION (default 250).
  • Resume: the current farmer page is saved; the next run with the same VO continues from the failed page.
  • Any farmer page succeeded before an error → PARTIAL_SUCCESS, which counts as done.
  • No farmers in the database → remaining items marked SUCCESS.
  • Attachments need their parent item to be SUCCESS.
  • Go to Home when every item is SUCCESS or ERROR and all mandatory items succeeded.
  • Refresh of App Configs, Product Master, Practice Master and IE Role Map is ignored within SETUP_CACHE_DURATION_IN_MINUTES.
  • Chunk sizes: role map 30; assets ASSET_LAND_DETAILS_PAGINATION (30); asset attachments ASSET_ATTACHMENT_PAGINATION (50); portfolio 30; portfolio attachments 50; farming model 30.

Data download: Unit / FMT L1

#ItemMandatory
1App ConfigsYes
2Product MasterYes
3Practice MasterYes
4Farmers (every assigned VO)Yes (partial OK)
5Farmer AssetsNo
6PortfolioNo
7Portfolio AttachmentsNo
8Compact Block (every VO, page size 100)No

Rules:

  • Farmers and Compact Blocks download per VO with saved progress.
  • When every VO is complete, progress resets so the next run is a full refresh.
  • Assets and Portfolio run in parallel. No asset attachments or farming model.
  • Done → Home in Unit mode.
  • Load more is blocked until every queued sync item has been attempted at least once.
  • Launcher splash
    • Select language (skipped once chosen)
      • Splash logic
        • Login (if no account)
        • Home (if all synced)
        • Data download (Cadre) (if VO chosen, not complete)
        • Fresh setup
          • Unit → Data download (Unit) → Home (Unit)
          • Cadre → Village/Habitation/VO selection (+ Device registration) → Data download (Cadre) → Home
  • Home (+ Device registration on top in release builds)
    • Content
      • Farmer list (Cadre)
        • Farmer → Farmer hub → Profile, Land, Livestock, Crop Plan, Crop Actual, ATM, KAP, Annual plan, Kitchen Garden, Surveys, Certification, Comments, Inventory
        • Bell → Notifications → Farmer hub
        • Partial-data banner → Data download (load more)
      • VO tabs (Unit) → Endorsement, Survey, Compact Block
    • Bottom bar
      • Sync → Pending sync
      • Sync error → Sync error log → ATM or Crop Actual
      • Analytics → Dashboard → Yesterday / Monthly / Overall MIS → Farmer list
      • Disabled land
      • Instruction video
    • Side menu
      • My Plan & Profile → Farmer hub (user mode)
      • Analytics (Unit) → Dashboard
      • Program Configuration, Program Instructions, Login History
      • Activity Tracker (Cadre)
      • Endorsements (Unit) → VO tabs
      • Settings
        • Change language → Home restart
        • Load more data → Data download (load more) → Change → VO selection; or Unit download
        • Force sync, Report sync issues, Backup
        • Notifications web page, Privacy, Terms
        • Open source licenses
      • Logout → Splash
  • Device registration → (conflict) Pending sync, Login here, or Logout → Splash