# Cautions
# 1. Memory
# 1.1 Memory requirements
It must not exceed 35M, and CPU usage over 90% of the time period should not exceed 10% overall.
# 1.2 Principles of memory utilization
- The maximum amount of memory that can be used by a single application is 48M, exceeding this amount will result in a memory overflow report.
- Use memory allocation under native with caution to prevent memory leaks.
- Disable large memory requests in native to circumvent the 48M memory limit.
- Images are used in as modest a size as possible, and resource caching is used appropriately.
- Minimize the ways in which background services run as separate processes.
- Reuse the system's own resources.
- Avoid performing object creation inside the onDraw method.
- Optimize the layout hierarchy to reduce memory consumption and ensure that the View is not overdrawn.
# 2. Power consumption optimization
# 2.1 Foundation requirements
- Use the wake lock with caution and always remember to release it after special needs use.
- For services that need to request the network must be careful to detect the condition of the network, to avoid constantly retrying the work.
- Backend services consolidate or reduce necessary wakeup efforts.
- Avoid situations where the screen is always on, and have a time limit on how long it stays on.
- Minimize log printing.
- Avoid static broadcast listening.
# 2.2 Power consumption optimization
- Small battery devices that need to minimize usage power and standby power consumption.
- In-app standby, no wake-up operations such as network requests.
- Prohibit long connections in the background, and prohibit bailout.
- Disable idle apps from accessing the camera, microphone, and sensors.
- Holding locks without reason and interfering with system hibernation is prohibited.
# 2.3 Power Consumption Recommendations
- The background color is as dark as possible.
- Minimize animation.
- Sound effects don't play all the time, even at volume 0, there are tens of milliamps of current.
- Network data interactions are aligned in time as much as possible. For example, if there are two requests, one is requested at the 0s moment and the other is requested at the 5s moment, if it is possible to request both requests at the 0s moment, the power consumption on the network side will be reduced by half.
# 3. Installation package size
- Watch ROM up to 4G and above models: the size of the installation package does not exceed 30M, and the space occupied after installation does not exceed 40M.
- Watch ROM for 512M models: the size of the installation package does not exceed 10M, and the space occupied after installation does not exceed 15M.
# 4. Do not allow hot updates
All new features are subject to review by the imoo App Store and hot updates are not allowed.
# 5. Storage norms
- Requires the app to be uninstalled to completely delete the data associated with the app.
- Third-party application storage can only be in the /sdcard/Android/data/third-party-package-name/ or /data/data/package- name directory.
- Third parties are responsible for their own handling of matters following the deletion of data, e.g. if downloaded music is deleted, playlists should not be shown, etc.
- When the user clears space, the watch deletes the directories under /sdcard/Android/data/package-name/ and data/data/package-name.
- In principle, after the user clears the space, the amount of space occupied by third-party applications should be the same as the initial installation.
# 6. Use of Cellular Data
Cellular data consumption is a major concern for users, so it is important to support cellular data alerts and control.
# 6.1 Cellular Data Usage Reminders and Restrictions
The first time a user uses cellular data, he or she must be Toast alerted.
When disconnecting from the network, you need to pause the playback of audio, when coming to the network does not allow to continue to play, still maintain the pause state.
In principle, we try to cache the frequently played audio, and when we cut the audio quickly, we need to call the stop of media Player to cancel the buffering of the previous audio, so as to reduce the traffic consumption.
# 6.2 Cellular data switches
The imoo App can currently control the flow switch of individual apps on the watch, and the apps need to focus on the experience of using the watch when the flow is disabled.
- Cellular data Switch Related
Documents See attached "flow switch java"
- Code to determine if currently disabled
Note: Before calling the following code, please determine if the current watch network is a cellular data network, if it is a WiFi case, don't call it!!!! Otherwise there may be incorrect logic.
NetworkPolicyForApp networkPolicyForApp = new NetworkPolicyForApp(context);
boolean isDisabled = networkPolicyForApp.isMobileTrafficDisabled("packageName");
# 7. Audio focus conflict
# 7.1 Apps with sound playback should properly handle the gain and loss of audio focus
Gets the audio focus before starting playback, loses audio focus to pause playback.
# 7.2 Audio Playback Sequence
- The watch does not allow simultaneous audio playback.
- Audio playback follows a sequential order, with audio focus applied later and actively paused earlier.
# 7.3 Audio Buffering Issues
Asynchronous buffering is now easy to anr, and the preferred method of using synchronous buffering is to turn on subthread synchronous buffering.