Author | Stephan Miller
Translator| Ma Kewei Planning| Tian Xiaoxu This is a story with a complete aftermath. As a full-stack web developer with almost sixteen years of development experience, the author knows all the technologies required to build web applications. In recent years of work projects, the author became an Android developer for the first time. After a period of running-in, the author realized that the developer’s thinking also needs to be transformed from web development to Android and mobile application development. Most of the wrong paths for the newbies of Android development can be solved by refactoring or modifying the build process in the later stage of the project, and continue to polish until the unit test perfectly covers all the situations required and can also handle some small errors. But the rest of the missing fish are not so easy to solve. These are enough to have a lasting impact in the life of the app and make people want to overthrow the entire project. Some of the mistakes even make the author ashamed to say that he has made mistakes. Pass them. The following will provide some tips to prevent the time paradox (laughs) when you want to go back to the past and redo the project. I hope it can help you prevent the bad troubles that are hard to get rid of. Add in-app update immediately. It wasn’t until a year after it was released that we plugged the update notification function into our app. If the built-in update reminder function is added at the beginning of the project, then the process is fairly simple, but if it is delayed until later, it will inevitably cause a lot of problems, including: the need to build a custom process manually, and the user to try it on his own Skip the update. Believe me, this feature will be a breakthrough change for your app. Existing users of the app may have become accustomed to the in-app update function through other apps, and even take it for granted that this should be one of the features of the mobile platform. But in fact, it wasn’t until I personally experienced Android development that I knew that this feature had to be manually added by the developer. When your app unfortunately stops running, users will not look for software update packages, they will only uninstall and then install them, or even worse, they will leave comments in the app store. Restrict API key Let the program run first, and then apply a patch if something goes wrong. Maybe you also have this habit, but please don’t continue to delay. Point out an article about API keys on Google Cloud Platform, but for other platforms, the same applies. For GCP (Google Cloud Platform), we only need to log in to the Google account and select the API key to be restricted, and the system will jump to the key attribute interface. Select the Android application in “App Restrictions” and click “+” to add the package name to the API key that needs to be restricted. As for adding certificate fingerprints, you can directly copy the commands on the page and follow the instructions on the right side of the page. It only takes a few minutes to complete. We only started restricting API keys two years after the app was shipped. However, after the restriction, a map function of the app went on strike. After rolling back the changes, it took us a lot of work to find the problem. Most of the official Google software packages used by the app can be perfectly adapted to the code behind the restricted API key. Only one of the maps needs to rewrite the other set of API call codes. If we can consider the limitation of the API key at the beginning of the project and write it into the source code, this will undoubtedly increase the development time, but in the later stage, we can no longer worry about the limitation. The story does not end here. In order to ensure the normal operation of the map and limit the API key, we have to perform a mandatory update. We have background statistics to monitor the user’s update process, and the data shows that 90% of users update only a few weeks after receiving the update notification, while the other 10% still choose when the map is almost completely out of order. Without updating, I don’t know how they endure this kind of bug. Internal API version control When I was still focusing on web development, I never understood why someone would want to do this. After updating the front-end code, why keep the old version of the API? No matter how you think it is useless waste. However, when the software version used by the user is different, a major update of the API may cause a large-scale software crash. The method of in-app update can help alleviate this problem, but the process will be extremely long. Dividing API versions is more like a quick and simple solution for this kind of software crashes, rather than over-engineering as I once thought. Want to go offline beforehand Our app has practical goals. When we received feedback from users that the app reacted stuck and the response timed out, I was just a novice in mobile app development, and I just came across a new term: Offline First. If the user fails to connect to the Internet, all unuploaded and unsaved things will be lost, and when the connection is restored, they will have to re-enter all the content. The priority offline structure will write the changes to the local database, and then synchronize when there is a network connection. In this way, the user can use the app offline, and the response will be faster when connected to the Internet. The user no longer has to wait for the server to send back a response before proceeding to the next step.
You must log in to post a comment.