查看完整版本 : 安卓8.0代码重写,将成为最流畅的系统

煙民母親生賤種 2017-11-26 02:33 PM

安卓8.0代码重写,将成为最流畅的系统

新一代Android 8.0主要优化了手机的续航能力,谷歌表示新系统加大了对后台的限制。APP在后台沉默一段时间后,如果用户不对它进行操作,[color=Blue][u][b]那系统将会令APP进入“睡眠”状态[/b][/u][/color][b][u],直至用户再次将它唤醒。[/u][/b]据安卓的工程师描述:“这次的安卓8.0系统将会是史上最流畅的系统,关于代码已经全部重新编写。”


看似合理, 諗深一層, 係咪老點 D 唔識寫 code 既豬用戶? :fst_008:

咩叫後臺沉點一段時間後進入睡眼狀態? 得既話, 十年前以經做左啦! 咩叫後臺? 就係 D 要有 timer 自動檢測系統變化, 又或一 D processes , 而又係其他前臺的 dependent process 來。咁既情況下, 點可以讓其進入睡眠?? 如果可以睡眠的, 一般都唔會佔用 cpu 時間, 又何來用電?? :fst_008:

有諗辦法 2017-11-26 10:57 PM

我寫過係個 service 係一直 listen 住系統有 broadcast 先做嘢,乜唔係已經係正路咩。仲有咩要優化?

煙民母親生賤種 2017-11-27 01:17 AM

[quote]原帖由 [i]有諗辦法[/i] 於 2017-11-26 10:57 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=471503468&ptid=27083722][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
我寫過係個 service 係一直 listen 住系統有 broadcast 先做嘢,乜唔係已經係正路咩。仲有咩要優化? [/quote]你見唔見又有人比隻豬我!? :fst_008:邊個咁 Q 無良?? :fst_016:

wtf_name 2017-11-27 12:52 PM

[quote]原帖由 [i]煙民母親生賤種[/i] 於 2017-11-27 01:17 AM 發表 [url=http://www.discuss.com.hk/redirect.php?goto=findpost&pid=471509983&ptid=27083722][img]http://www.discuss.com.hk/images/common/back.gif[/img][/url]
你見唔見又有人比隻豬我!? :fst_008:邊個咁 Q 無良?? :fst_016: [/quote]
送翻個心俾你

xianrenb 2017-11-27 01:32 PM

[quote]原帖由 [i]煙民母親生賤種[/i] 於 2017-11-26 02:33 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=471478417&ptid=27083722][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
新一代Android 8.0主要优化了手机的续航能力,谷歌表示新系统加大了对后台的限制。APP在后台沉默一段时间后,如果用户不对它进行操作,那系统将ߩ ... [/quote]

我都俾左個心你㗎!

[url=https://developer.android.com/about/versions/oreo/background.html]https://developer.android.com/about/versions/oreo/background.html[/url]
[quote]...While an app is in the foreground, it can create and run both foreground and background services freely. When an app goes into the background, it has a window of several minutes in which it is still allowed to create and use services. At the end of that window, the app is considered to be idle. At this time, the system stops the app's background services, just as if the app had called the services' Service.stopSelf() methods....In many cases, your app can replace background services with JobScheduler jobs. For example, CoolPhotoApp needs to check whether the user has received shared photos from friends, even if the app isn't running in the foreground. Previously, the app used a background service which checked with the app's cloud storage. To migrate to Android 8.0 (API level 26), the developer replaces the background service with a scheduled job, which is launched periodically, queries the server, then quits....[/quote]
如果無理解錯,換句話說,等同於 Android 8.0 無一直 run 的 background app 。
要用 JobScheduler jobs 代替。

Susan﹏汪汪 2017-11-27 01:53 PM

咁汪汪比多隻豬:lol

Susan﹏汪汪 2017-11-27 01:54 PM

[quote]原帖由 [i]xianrenb[/i] 於 2017-11-27 01:32 PM 發表 [url=http://www.discuss.com.hk/redirect.php?goto=findpost&pid=471528842&ptid=27083722][img]http://www.discuss.com.hk/images/common/back.gif[/img][/url]


我都俾左個心你㗎!

https://developer.android.com/about/versions/oreo/background.html

如果無理解錯,換句話說,等同於 Android 8.0 無一直 run 的 background app 。
要用 JobScheduler jobs  ... [/quote]
其實就係改為iOS 的做法

所有background app都有個life time
超時就停左佢

ncream 2017-11-27 01:58 PM

[quote]原帖由 [i]Susan﹏汪汪[/i] 於 2017-11-27 01:53 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=471529675&ptid=27083722][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
咁汪汪比多隻豬:lol [/quote]

好鬼死衰。:lol:lol

煙民母親生賤種 2017-11-28 12:59 AM

[quote]原帖由 [i]Susan﹏汪汪[/i] 於 2017-11-27 01:53 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=471529675&ptid=27083722][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
咁汪汪比多隻豬:lol [/quote]你願意俾你隻豬我喇!? :fst_002::fst_002::fst_002:

煙民母親生賤種 2017-11-28 01:05 AM

[quote]原帖由 [i]xianrenb[/i] 於 2017-11-27 01:32 PM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=471528842&ptid=27083722][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]


我都俾左個心你㗎!

[url=https://developer.android.com/about/versions/oreo/background.html]https://developer.android.com/about/versions/oreo/background.html[/url]

如果無理解錯,換句話說,等同於 Android 8.0 無一直 run 的 background app 。
要用 JobScheduler jobs  ... [/quote]咁 service 咪即係變左 cron job?等同降格!:fst_008:

form5 2017-11-28 09:37 PM

[quote]原帖由 [i]煙民母親生賤種[/i] 於 2017-11-28 12:59 AM 發表 [url=http://computer.discuss.com.hk/redirect.php?goto=findpost&pid=471559830&ptid=27083722][img]http://computer.discuss.com.hk/images/common/back.gif[/img][/url]
你願意俾你隻豬我喇!? :fst_002::fst_002::fst_002: [/quote]
:smile_30: :smile_30:

實在太隨便肋:smile_30:

[[i] 本帖最後由 form5 於 2017-11-28 10:45 PM 編輯 [/i]]

sinson123 2017-11-30 03:23 PM

咁2不離3啦:lol我又比隻豬
頁: [1]
查看完整版本: 安卓8.0代码重写,将成为最流畅的系统