官术网_书友最值得收藏!

A simplified explanation of the Android lifecycle

If you have ever used an Android device, you have probably noticed it works quite differently than many other operating systems. For example, you can be using an app, say you're checking what people are doing on Facebook. Then you get an e-mail notification and you tap the e-mail icon to read it. Mid-way through reading the e-mail you might get a Twitter notification, and because you're waiting on important news from someone you follow, you interrupt your e-mail reading and change apps to Twitter, with one touch.

After reading the tweet, you fancy a game of Angry Birds, but mid-way through the first daring fling you suddenly remember that Facebook post. So you quit Angry Birds and tap the Facebook icon.

Then you resume Facebook, probably at the same point you left it. You could have resumed reading the e-mail, decided to reply to the tweet, or started an entirely new app.

All this backwards and forwards takes quite a lot of management on the part of the operating system, apparently independent from the individual apps themselves.

The difference between, say, a Windows PC and Android in the context we have just discussed is this: with Android, although the user decides which app they are using, the OS decides if and when to actually close down (destroy) an application, and our user's data (like the hypothetical note) along with it. We just need to consider this when coding our apps.

主站蜘蛛池模板: 河源市| 广饶县| 沽源县| 林甸县| 长海县| 榆林市| 丰城市| 体育| 东方市| 泰顺县| 平阳县| 来宾市| 宽甸| 安丘市| 合江县| 明星| 微山县| 昭苏县| 海盐县| 郑州市| 阆中市| 阿尔山市| 于都县| 龙陵县| 青铜峡市| 惠水县| 威信县| 元氏县| 丰顺县| 英德市| 南乐县| 重庆市| 扬州市| 紫云| 宜川县| 垦利县| 泰来县| 太仓市| 稷山县| 台北市| 山西省|