android-ui - Android app离线模式,需不需要冻结UI?
天蓬老师
天蓬老师 2017-04-17 17:13:50
0
4
410

大家好,最近在开发公司app 的离线下载数据功能。就像:网易新闻,腾讯新闻中的离线模式一样。

功能上都实现了。想请教一下资深的安卓开发工程师,在下载离线数据的时候,需不需要冻结UI(在下载完成之前不让用户使用app的其他功能)?因为测试后,发现不冻结UI,程序也能正常使用,只是慢了点(应该是排队读写数据引起的)。但是上面提到的二个app都冻结了UI ,是有其他的原因吗?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(4)
洪涛

The so-called frozen UI, I think the questioner means to prohibit any operation before the data is loaded. If it is offline, the data is loaded locally. If it is loaded in pages, the data loading speed should be very fast, but it must be done asynchronously. Loading is better. For the entire interface, if there are elements that need to be loaded before the data can be operated, then they are disabled. Other available element controls do not need to be disabled. Of course, as the questioner said, in fact, most of them are after the data is loaded. Only allowed. First of all, this can avoid having to confirm one by one which operations can only be performed after the data is loaded and which ones are not, which will be more cumbersome. Unified banning will save a lot of work, and loading will be faster without affecting the experience.

Of course, if the data is loading slowly, the first thing to do is not to freeze the UI. If the data cannot be loaded within 10 seconds (offline), the actual consideration should be whether there is a problem with the design, whether the data is loaded too much, or There is too much data saved locally, etc. The local database applications I have made here basically lock the interface, because the data that needs to be displayed can be loaded in one screen in less than 1 second, and there is no need to control each element.

伊谢尔伦

What do you mean by frozen ui? When I use NetEase News to download offline news, it does not affect my use of other functions! Offline downloading must be performed asynchronously in the background, and threads must be started to achieve it without interfering with other activities.

黄舟

Nowadays, software puts user experience first. You must not freeze the UI. If you want to download data, you can download it asynchronously in the background. There should be no impact on user operations. Are the queuing of reading and writing data that you are talking about not done well in concurrency, leading to congestion?

Peter_Zhu

If concurrency feels slow, modify the priority of the thread.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!