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

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.

主站蜘蛛池模板: 夏津县| 绥阳县| 郯城县| 饶河县| 陆川县| 宜昌市| 惠安县| 泸定县| 海宁市| 密山市| 晋宁县| 永登县| 通城县| 九台市| 乌鲁木齐县| 十堰市| 凌海市| 太湖县| 敦煌市| 新巴尔虎左旗| 屯留县| 许昌县| 巴马| 东阳市| 阳西县| 浪卡子县| 调兵山市| 竹溪县| 荔波县| 扎赉特旗| 通州市| 綦江县| 丹巴县| 祥云县| 同心县| 玉田县| 左云县| 柞水县| 江陵县| 依兰县| 罗城|