1 00:00:05,270 --> 00:00:05,530 OK. 2 00:00:05,570 --> 00:00:10,100 So I was going to talk a bit about Compatibility, and how Google have made the Material Design 3 00:00:10,100 --> 00:00:15,580 concepts available in earlier versions of Android, even though they didn't introduce Material Design until 4 00:00:15,590 --> 00:00:16,420 Lollipop. 5 00:00:16,460 --> 00:00:21,500 So Google made some pretty radical design changes when they released Android Lollipop, but they also 6 00:00:21,500 --> 00:00:27,530 spent an enormous amount of time trying to ensure that the functionality also works in previous Android 7 00:00:27,530 --> 00:00:33,620 versions. Now maintaining Compatibility with old versions is an issue with any operating system, be it 8 00:00:33,680 --> 00:00:34,270 Android, 9 00:00:34,280 --> 00:00:36,170 IOS, or Windows, for example. 10 00:00:36,260 --> 00:00:38,470 In fact, throughout 2016, 11 00:00:38,700 --> 00:00:44,040 Microsoft went to a lot of trouble to persuade people to upgrade from Windows 7 and 8 to Windows 10. 12 00:00:44,420 --> 00:00:50,180 So it was better for Microsoft to offer a free upgrade, than to continue supporting millions of computers 13 00:00:50,180 --> 00:00:51,880 running the older versions. 14 00:00:51,980 --> 00:00:57,110 Now Microsoft Windows is one example of an operating system where they went to great pains to make 15 00:00:57,110 --> 00:01:02,870 sure that an app that was working in, say, Windows XP, would work in Windows 2000, for example. 16 00:01:02,870 --> 00:01:08,210 They even added a Compatibility Mode in several versions of Windows, so that older programs would continue 17 00:01:08,210 --> 00:01:09,250 to work. 18 00:01:09,260 --> 00:01:14,450 So in other words, they made sure that the current edition didn't alienate all these old applications that 19 00:01:14,450 --> 00:01:16,840 worked on previous versions of Windows. 20 00:01:16,850 --> 00:01:19,030 So now Android is much the same. 21 00:01:19,030 --> 00:01:23,660 Now it's not fully automatic, but with only a little bit of work, you really can have your cake and eat 22 00:01:23,660 --> 00:01:24,430 it too. 23 00:01:24,800 --> 00:01:29,630 So in other words you can create an app that takes advantage of the functionality, and the great new 24 00:01:29,630 --> 00:01:36,240 features, in Android Oreo, but still have those applications working in previous versions of Android. 25 00:01:36,290 --> 00:01:38,050 Now there's some work involved in this. 26 00:01:38,150 --> 00:01:42,590 So it's certainly not 100 percent automatic, and some of the functionality may not be available in older 27 00:01:42,590 --> 00:01:44,900 versions, but the apps will still work. 28 00:01:45,110 --> 00:01:48,050 But that said, there's also not a lot of work. 29 00:01:48,140 --> 00:01:54,440 So Google have actually produced a ton of support libraries, to make sure that older Android devices, running 30 00:01:54,530 --> 00:01:59,110 older versions of Android, can still take advantage of some of these newer features. 31 00:01:59,160 --> 00:02:03,560 Now you do have to tell Android that you want to support these older devices, and we've seen a bit 32 00:02:03,560 --> 00:02:04,470 of that 33 00:02:04,640 --> 00:02:10,520 when we checked the Compatibility box when creating new projects in Android studio. And I've also pointed 34 00:02:10,520 --> 00:02:16,670 out that our activities have been extending AppCompatActivity rather than Activity, which makes sure that 35 00:02:16,670 --> 00:02:21,740 they use the compatibility library, so that they'll therefore work on earlier versions. 36 00:02:21,740 --> 00:02:26,630 Now there's another compatibility library that handles Material Design on older versions of Android, 37 00:02:26,720 --> 00:02:30,560 so we'll be using that in our Flickr Browser app, to see what's involved. 38 00:02:30,560 --> 00:02:33,200 So bottom line, it's not a huge job but it is a change, 39 00:02:33,260 --> 00:02:39,040 so you need to make sure that you are specifically telling Android how to do that. So why bother? 40 00:02:39,440 --> 00:02:44,750 Well, think of it this way - the vast number of users take a long time to upgrade their phones to a new 41 00:02:44,750 --> 00:02:47,370 version of Android, and some frankly may never upgrade. 42 00:02:47,380 --> 00:02:53,600 Now there's lots of Android devices, for example, that don't enable upgrades or can't be upgraded 43 00:02:53,600 --> 00:02:55,820 past a specific version. 44 00:02:55,820 --> 00:03:01,310 So if you don't support those users in some way, shape or form, then they may never get to see your apps. 45 00:03:01,390 --> 00:03:06,950 So possibly you could be alienating yourself from a large percentage, and probably the majority of Android 46 00:03:06,950 --> 00:03:10,540 users, if you don't support at least some previous versions. 47 00:03:10,880 --> 00:03:16,310 And the way that Google Play works for your users, they won't even see your app to download unless their devices 48 00:03:16,550 --> 00:03:17,980 support your version. 49 00:03:18,290 --> 00:03:22,880 So in other words, if you're only producing an Android Oreo version of your app, it could be the best game 50 00:03:22,880 --> 00:03:24,740 out there or the best application, 51 00:03:24,980 --> 00:03:29,600 but if a potential downloader is running an older version of Android, they won't even see it listed 52 00:03:29,900 --> 00:03:31,310 in the Google Play Store. 53 00:03:31,700 --> 00:03:37,200 So Google make sure that you only see a filtered version of what can be downloaded onto their devices. 54 00:03:37,370 --> 00:03:39,780 So really, you know, this to me is a no-brainer. 55 00:03:39,980 --> 00:03:45,170 You need to be focusing on making sure that you support at least a certain percentage of these previous 56 00:03:45,190 --> 00:03:47,220 users on older devices, 57 00:03:47,510 --> 00:03:53,660 and I'd go as far as to say, it's essential for you to be doing this. And again, with only a little bit more work, 58 00:03:53,720 --> 00:03:57,910 you can support and potentially get downloads of your app from a pile of users. 59 00:03:57,950 --> 00:04:02,150 So we're going to be using this from this point forward in the course, so that you can apply the concepts 60 00:04:02,150 --> 00:04:05,280 you learn to your apps that you're developing yourself. 61 00:04:05,350 --> 00:04:09,980 Alright so Google have got a pretty good description and discussion of the Support Library at the link 62 00:04:09,980 --> 00:04:10,780 on the screen, 63 00:04:10,910 --> 00:04:14,620 so let's actually swing over to a browser and check that out. 64 00:04:14,620 --> 00:04:19,850 Alright, so we're on that page now, and the Android Support Library serves three purposes. 65 00:04:19,850 --> 00:04:24,220 Firstly it offers backward compatible versions of new features. 66 00:04:24,230 --> 00:04:30,440 It also provides useful UI elements that aren't included in the framework, such as the recycler view that we're using 67 00:04:30,460 --> 00:04:35,390 in the Flickr app, and also provides a range of utilities that apps can use as needed. 68 00:04:35,630 --> 00:04:40,490 So it's actually worth having a read through this document, and also following the links to learn a bit 69 00:04:40,490 --> 00:04:43,380 more about the features of the Support Library. 70 00:04:43,440 --> 00:04:50,700 So scrolling down a little bit, we get to this title here, Using Support versus Framework APIs. 71 00:04:50,930 --> 00:04:55,980 So that gives you some guidelines on when you should use the support libraries, the compat version of things 72 00:04:56,010 --> 00:04:56,880 in your app. 73 00:04:56,910 --> 00:05:00,890 Now the third paragraph here may not make sense immediately. 74 00:05:00,930 --> 00:05:06,710 It's basically saying that you can use compat classes to take advantage of features that aren't yet 75 00:05:06,720 --> 00:05:07,460 available. 76 00:05:07,620 --> 00:05:14,430 So if you use ActivityCompact instead of Activity, then you can add new features to your app without 77 00:05:14,430 --> 00:05:15,860 having to make huge changes. 78 00:05:15,960 --> 00:05:21,470 And we'll actually be seeing that in a later section. Now the note's also interesting, down here - not every 79 00:05:21,480 --> 00:05:23,740 class has an equivalent in the support library. 80 00:05:23,790 --> 00:05:28,790 So there may be some things introduced with newer Android versions that won't work on earlier versions. 81 00:05:28,800 --> 00:05:33,510 Now you can either stop supporting the older version, changing the min SDK level to a higher version, 82 00:05:33,780 --> 00:05:35,900 or test the version of Android in your code. 83 00:05:36,090 --> 00:05:41,100 So that lets you make extra functionality available on your versions, while still allowing the rest of 84 00:05:41,100 --> 00:05:43,200 the app to work on older versions. 85 00:05:43,200 --> 00:05:45,300 Now there's another page that's actually worth looking at. 86 00:05:45,320 --> 00:05:49,890 So I'm just going to open that in a new tab. 87 00:05:49,890 --> 00:05:55,600 Now this is an old blog post, going back from, or back to May 2015. 88 00:05:55,830 --> 00:05:58,970 But that's when Material Design was introduced to Android. 89 00:05:59,160 --> 00:06:03,210 So if you scroll down and have a look it actually contains lots of good information and sample code, 90 00:06:03,210 --> 00:06:09,710 and even some videos demonstrating the effects. So definitely spend some time with the documentation 91 00:06:10,010 --> 00:06:15,020 because that's how you'll learn about cool new things, and also how to really use the existing features 92 00:06:15,350 --> 00:06:19,040 and get the most from the classes and widgets that Android provides. 93 00:06:19,050 --> 00:06:23,210 Alright so I'm going to finish the video here. In the next video we're going to start work on modifying 94 00:06:23,210 --> 00:06:28,790 the user interface for the app, and see how to use Material Design in a compatible way, to make the app 95 00:06:28,790 --> 00:06:31,930 look good on all the versions of Android that we'll be supporting. 96 00:06:31,940 --> 00:06:33,460 So I'll see you in the next video.