The question is too broad and it would really have been better if you’d have googled some related topics first. However, if you want to work with databases Google has a tutorial for you here. I think the external storage might be more than sufficient for your problem, so you can find a tutorial here.
solved Creating a calculation in an android app using a database [closed]