How to remove Parcel from Android app storage and verify draft recovery
A draft should be restored with the values the user saved. Seeing a familiar screen after reopening the app is not enough to verify this requirement: you need to compare the original fields with the data read from persistent storage. We will examine one save path in a completely fictional Android app called Draft, using only our own synthetic records. The result will be storage format requirements and observable acceptance criteria for this path.
Why Parcel must be removed from persistent storage
Parcelable and Bundle are intended for passing data across process boundaries, between Activity instances, and for temporary state during configuration changes. Parcel supports efficient IPC and is not a general-purpose serialization mechanism. The Android documentation explicitly prohibits saving Parcel data to disk or sending it over a network: using it for persistent local storage can lead to data incompatibility or loss.
The ability to reconstruct an object from Parcel using Parcelable does not change this limitation. Even if the current read check passes, that does not make Parcel a suitable persistent format. The fix must address the actual writing of the draft to persistent storage; using Parcelable for temporary data transfer should be assessed separately.
Trace one path from saving to display
In our fictional app, the user edits a record and taps Save. Suppose the selected path converts the draft object into a Parcel and writes the resulting bytes to a file. When the record is opened, the app reads that file and reconstructs the object. This is a hypothetical example for discussion, not a description of a real product or incident.
Our proposed editorial check begins with this save command. Trace which fields are passed along, where they become bytes, where they are written, and which reader returns them to the screen. Record the point where Parcel is written to disk. The acceptance criterion for the fix is that the selected path no longer writes Parcel data to persistent storage, and reading uses an agreed separate format.
Define the persistent format through the draft fields
For this example, we will define four fields: an identifier—a required nonempty string; a title and body—required strings that may be empty; and a completion flag—a required boolean. We will treat a missing field as a format violation and distinguish an empty string from a missing value. These are proposed requirements for the fictional app, not an Android requirement for a specific storage schema.
Before changing the code, document the chosen persistent format, the representation of these fields, and the reading rules. Describe how the reader recognizes a valid record and what it does when a record does not comply. Then replace conversion to Parcel and the corresponding read operation with an implementation of this contract. Choosing a library or storage system does not, by itself, replace requirements for the saved values; no specific tool is prescribed here.
Check normal saving and process termination
The following steps are an original editorial check, not an official Android procedure. Create your own synthetic draft: identifier “draft-017”, title “Note outline”, body “First paragraph”, and completion flag false. Record the original values separately, save the record through the selected path, and read it back. Compare every field, including the identifier and boolean flag.
Then terminate the app process, restart the app, and load the same record from persistent storage. Confirm that loading went through the reader being checked, and compare all four fields with the originals again. Displaying a screen or a successful-save message does not, by itself, confirm the result. Acceptance requires both matching values and confirmation that reading used the selected storage path.
Check empty text, Unicode, and invalid format
Repeat the proposed check using your own records with empty text and with Unicode, such as “Чай, café, ☕”. For each record, save it, read it, terminate the process, and reload it. Valid values must match the originals without transformations that the format contract does not specify.
Separately, pass the selected reader a synthetic record whose completion flag is represented as a string instead of the agreed boolean. Define the expected response in advance: the record is rejected, the app displays a read-error state, and it does not present the record as a successfully restored draft. Observe this specific result, rather than merely the absence of a crash. These are local acceptance criteria for the selected path.
Validate at the read boundary
The documentation recommends treating serialized data as untrusted and potentially malicious. In the path under review, the trust boundary therefore lies where the stored representation becomes data accepted by the app. Validation must establish that it matches the expected class and format; reading from the app’s own storage does not replace that validation.
The priorities for the fix are concrete: remove Parcel writes, define a persistent representation of the fields, agree on reader behavior, and run the recovery checks. For each check, retain the original values, the values read, and the comparison result. This allows the developer and product owner to accept the selected path based on an observable outcome.
Limits of the result and the next step
Passing these checks confirms that the defined conditions were met for the selected synthetic data. One restart does not prove compatibility with future versions, and rejecting one invalid record does not establish the overall security of deserialization. This discussion does not cover the type contract for an incoming Bundle, IPC sender validation, implementation of migration for old files, backups, or encryption configuration.
The outcome is a documented persistent format and a verified path for recovering a draft after process termination. If the product has a website or web component, you can start with a free audit of that part through CheckMyApp. Its scope should be agreed separately from the Android storage check described here.