Android notes: use of splash activity, the startup interface of APP application

At present, more mature applications basically display a startup interface when entering the application. This startup interface is simple, complex, simple, gorgeous, with different intentions and styles. Let's take a look at the startup interfaces of several popular applications

1. Shop around. Take Tencent QQ, Sina Weibo, UC browser, game Temple Escape and other seven applications as examples:

2. The original intention of the element startup interface is to cover up the background buffer loading with a friendly user interface, so that users can enter the normal application interface with a peaceful waiting mood. However, because the startup interface is placed at the beginning, more things can be done at this special point, such as application publicity, display of copyright, display of advertising, etc. Therefore, the elements of the startup interface can be more or less, It depends on your intention and needs. Let me list some common elements: (1) application name (2). Application version (3). Application icon (4). Copyright (5). One sentence description (6). Progress bar (7). Additional information, such as market special edition, exclusive launch, etc

3. Advantages: considering the launch interface comprehensively, at least these advantages can be utilized: (1) friendly waiting interface, which is the most basic (2) basic description and publicity introduction of the application (3) dynamic advertising and full screen advertising (4) attribute description of the application, such as version, copyright and other information. Know the basic attributes of the user's current application. From a technical point of view, there are the following: (5) . load time-consuming resources (6). Check the new version (7). Preset conditions (8). Code separation

4. The layout adds all the elements that can be added to make a startup interface without design. The layout is as follows:

5. Code separation is specially emphasized to enhance the awareness of code separation and reduce hybridity. For example, if the operation of checking the new version is placed in the main interface, it is easy to mix the original independent operation with the operation of loading data, which increases the complexity of the main interface code. If it is placed in the startup interface, It will be cleaner and clearer to detect in the startup module (because the detection of the new version should be executed when the application starts), and you can also consider whether to allow the user to enter the main interface (when you decide to completely abandon the old version, you sometimes need to force the user to upgrade to the new version). Other operations may also be optimized to the code structure through such consideration.

6. Asynchronously execute tasks. While starting the friendly display of the interface, the background can do many operations. These background operations can be implemented by asynctask. Other methods are OK, but I think asynctask is the most concise at this time. You don't need asynctask at this time and when to use asynctask.

7. Jump animation in the onpostexecute method, we will eventually jump to another activity and finish ourselves. This jump animation slides in and out left and right by default on my mobile phone. In fact, this animation can be customized, such as using the fade in and fade out jump animation. First, define two animation fades that fade in and out_ In.xml and fade_ Put out.xml in RES / anim folder:

9. Summary the startup interface is a relatively simple topic. For some problems encountered, this paper makes a small arrangement for recording

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>