Sample app to list the transactions and allow user to change the state of transactions
The app takes in the data from the JsonBlobApi. The link to the data is: The link to data is: https://jsonblob.com/563e061ce4b01190df3ef64a
You can clone the repo: git clone --recursive https://github.com/pgiitu/westerosBudget.git
Features:
- Allows user to see a list of transactions fetched from the API
- Allows the user to change the state of any transaction among these three states(Unverified, Verfied, Fraud)
- There are only two categories of transactions (Recharge, Taxi). App allows user to filter the transactions
- Allows user to do swipe to refresh the data.
- App also polls the server every 1 minute to look for new data only when it is in the foreground.
- I have added some toast messages so that it is easy to understand what is going on.
Third Party Library Used:
- Volley(added as a submodule): for the netwrok requests
- gson: for parsing the JsonResponse to the Java Object and vice versa.
Assumptions
- The transaction status cannot be changed from any where else. So when the no of transactions changes then only will the app populate the new data.
- Category and State fields are mandatory.
- At one point of time only one transaction state can be changed.
TODO
- Right now if there is no network or we don't get any data from the server the app will just say no transactions present. We can easily handle the type of error and show the customized error to the user.
- When the state of a transaction is being updated we can show a loading spinner till we hear back from the server.
- We can also look for network change updates and refresh the data once the user is connected to the network.