Two improvements
1. Some transaction parameters are made persistent, that is, (rate, other fees, etc.) and are automatically saved. You do not need to enter them again when you start the program next time.
Android standalone data persistence is generally used in three methods: 1. file stream. 2. (simple) SQLite database. 3. Use the SharedPreferences. Editor method to save it as an xml file and read it using SharedPreference.
The third method is the most convenient
The Editor has two Save Methods: apply and commit. The specific differences are as follows:
1. If no return value is applied, and a boolean value is returned by commit, it indicates whether the modification is submitted successfully.
2. apply is to submit the modified data atom to the memory, and then asynchronously submit it to the hardware disk, while commit is to submit it to the hardware disk synchronously. Therefore, when multiple concurrent commit commits, they will wait for the processed commit to be saved to the disk before the operation, thus reducing the efficiency. The "apply" function only submits atomic data to the content. The function that calls the "apply" function will directly overwrite the preceding memory data, which improves the efficiency to a certain extent.
3. The apply method does not prompt any failure prompts.
Because sharedPreference is a single instance in a process, there is generally no concurrency conflict. If you do not care about the submitted results, we recommend that you use apply. Of course, you must ensure that the submission is successful and there are subsequent operations, you still need to use commit.
For subsequent expansion, choose commit.
Ii. Added convertible bond computing
The calculation method is similar to that of other types of securities. The only difference is that the commission rate cannot exceed 1‰. You must determine the rate in advance. Finished Product download source code