DEV Community

Korir Moses
Korir Moses

Posted on • Edited on

2 1 1 1 1

Build A Ussd In DotNet

Pagination in USSD App as implemented in Dotnet framework.
USSD stands for Unstructured Supplementary Service Data.
Most USSD application have a character limit size depending on the network provider they usually range between 160 and 180 characters. This therefore necessitates, the developer to use shorter texts where possible where possible. This however isn't possible in all scenarios hence the need to paginate the responses. Most USSD Response are in form of JSON Strings, plaintexts and xml.
While designing a USSD API we often use state service to navigate through the menus, an example is the USSD that has this given menu
1.Welcome to the App - 1.Register -------------Please Enter Your Username-----Please Enter Your Password
2.Login ---1.Enter Pin

So that Generally is a simple example follow of a registration Process in A USSD APP,ALL those menus are saved in sttes or sessions hen to perform a pagination one would rather implement at the final respose string which won't affect the the flow of the app.
Given An example that this is the response of your USSD

CON Press Services\n Dear Customer you have successfully subscribed to our services in order for you to continue with process or decline \n 1. continue \n2. decline convert to json string

As you can see from the above we have a string with \n chacters for formatting ,to paginate the above we have to take several steps into considations
1.Ensure that we break the string to fit the character size as by the MNO

  1. Ensure that each subsequent string contaion the 'CON' to ensure that the interface allows for further continuity 3.Ensure that while cutting the string it does not split a word should the string fall in the word to ensure that we display full words.

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more