I am using shared preferences to store my caller details in my app as follows. Whenever there is a call, I am saving the following details of the caller.
sharedPrefCallLog = getSharedPreferences("CallLogPref", Context.MODE_PRIVATE);
editorCallLogPref = sharedPrefCallLog.edit();
editorCallLogPref.putString("name", Name);
editorCallLogPref.putString("num", Number);
editorCallLogPref.putString("city",City);
editorCallLogPref.apply();
Everything works fine for the first call. When the second call is received, the details of the first call are cleared and replaced with the second one. How could I save everything? I would like to save details up to the last 10 calls?
Should I use different approach other than sharedPref?