How to save sequence number state across multiple invocations of an Android app?

I am working on an Android printing application that works with a thermal printer. The app works well (prints desired output). However, I am not sure how to set the running number (sequence number) for the receipt. For example, Running number start from 001 -> 002 -> 003. Once I close my application and restart it, it starts over with 001 -> 002 and so on. I would like the running number to continue from the last used number even if the app is closed and restarted. How can I achieve this?