1
00:00:00,180 --> 00:00:06,630
Hire everyone in this theater Tauriel we're going to go ahead and create our 19th Android application.

2
00:00:06,930 --> 00:00:10,410
And in this story I want to talk about enhanced for loop.

3
00:00:10,410 --> 00:00:10,980
OK.

4
00:00:11,310 --> 00:00:17,880
So let's just create a new Android studio project and here we need to actually specify a name for our

5
00:00:17,880 --> 00:00:19,350
Android application.

6
00:00:19,410 --> 00:00:23,580
So just type in here app 19 and then click on next.

7
00:00:23,670 --> 00:00:31,260
And here we need to actually specify the API 16 Android 4.1 Jelly Bean for minimum STK OK.

8
00:00:31,410 --> 00:00:38,220
And then click on next blank activity next and here click on finish.

9
00:00:38,640 --> 00:00:44,850
OK so now let's actually select this hello world takes you here and then press on delete key on your

10
00:00:44,850 --> 00:00:52,350
keyboard and now it's actually double click on this race folder here and then double click on the folder

11
00:00:52,710 --> 00:00:57,960
and then double click on this activity underline minute example and then select this filleting action

12
00:00:57,960 --> 00:01:01,560
button here and then press undelete key on your keyboard.

13
00:01:01,790 --> 00:01:02,320
OK.

14
00:01:02,580 --> 00:01:05,880
So now let's ask you to go back inside this content underline minute example.

15
00:01:06,180 --> 00:01:13,080
And then I actually double click on these content underline that example tab here in order to make this

16
00:01:13,080 --> 00:01:14,340
area wider.

17
00:01:14,340 --> 00:01:18,450
So now I can actually design my user interface for this application.

18
00:01:18,480 --> 00:01:19,240
OK.

19
00:01:19,440 --> 00:01:25,230
So first of all it's actually like a linearly afterwards they call into this relatively here and then

20
00:01:25,230 --> 00:01:29,980
put this linearly outwards equal at the center of this relatively.

21
00:01:30,000 --> 00:01:32,930
OK so now this is our linear layout.

22
00:01:33,360 --> 00:01:38,800
And then there's actually the right of vertical scroll view into these linearly outward circle.

23
00:01:38,880 --> 00:01:43,360
And now it's actually right a large takes you into this scroll view here.

24
00:01:43,530 --> 00:01:44,150
OK.

25
00:01:44,610 --> 00:01:46,710
So as you can see here this is our text view.

26
00:01:46,830 --> 00:01:51,330
So just double the candlesticks view and then delete the text of this text we have here.

27
00:01:51,640 --> 00:01:56,640
And for the ID just type in here TXI the country names.

28
00:01:57,610 --> 00:01:58,600
OK.

29
00:01:59,580 --> 00:02:02,300
And then press on until key on your keyboard.

30
00:02:02,730 --> 00:02:08,100
So let's actually go back and say this main activity the double file here and then actually delete these

31
00:02:08,190 --> 00:02:12,480
lines of code that are actually related to the Options menu button.

32
00:02:12,540 --> 00:02:13,240
OK.

33
00:02:13,530 --> 00:02:18,150
And then there's actually delete delete this block of code that is actually related to the floating

34
00:02:18,150 --> 00:02:19,510
action button here.

35
00:02:19,680 --> 00:02:20,490
OK.

36
00:02:21,300 --> 00:02:25,180
And now we can actually start putting our own code here.

37
00:02:25,230 --> 00:02:25,730
OK.

38
00:02:25,950 --> 00:02:30,110
So now I want to actually create an army of streambed values.

39
00:02:30,260 --> 00:02:30,960
OK.

40
00:02:31,170 --> 00:02:39,250
But before that let's actually create an object of type text view so takes beauty UTX the country names.

41
00:02:39,830 --> 00:02:40,630
OK.

42
00:02:41,160 --> 00:02:47,610
Assignment operator and then let's actually cast this object to a text view object find view by ID or

43
00:02:47,640 --> 00:02:50,160
that Id dot the country name.

44
00:02:50,220 --> 00:02:50,980
OK.

45
00:02:51,210 --> 00:02:54,650
And then you need to actually put a semicolon at the end of your statement.

46
00:02:54,690 --> 00:02:58,020
And then let's actually create an array of string values.

47
00:02:58,020 --> 00:03:02,820
So first of all I need to actually specify the type of my array and then I need to actually put in a

48
00:03:02,820 --> 00:03:08,390
pair of brackets after my type name in order to specify that I want to create an array.

49
00:03:08,400 --> 00:03:09,070
OK.

50
00:03:09,210 --> 00:03:13,170
And then for the name of this Aure just type in here country names.

51
00:03:13,310 --> 00:03:15,760
OK assignments operator.

52
00:03:15,930 --> 00:03:22,100
And then here inside of these these curly braces I want to actually put some country names.

53
00:03:22,110 --> 00:03:22,700
OK.

54
00:03:23,100 --> 00:03:28,230
So here I just pasting some country names inside of these curly braces here.

55
00:03:28,380 --> 00:03:34,190
So as you can see here these are my country names here as you can see that I actually put in of these

56
00:03:34,200 --> 00:03:35,760
curly braces of this area.

57
00:03:36,150 --> 00:03:42,810
And I notice that I actually put a putting a new line character after each country name here as you

58
00:03:42,810 --> 00:03:44,860
can see by Slash and.

59
00:03:44,910 --> 00:03:45,320
OK.

60
00:03:45,390 --> 00:03:51,330
In order to actually create a new like charity after each country name so that we can actually see these

61
00:03:51,330 --> 00:03:52,540
values on the screen.

62
00:03:52,560 --> 00:03:53,420
OK.

63
00:03:53,760 --> 00:03:59,280
And then I need to actually put in a semicolon at the end of my statement here.

64
00:03:59,280 --> 00:04:07,020
And let's actually create another strange object or keystream and the name of my object is all country

65
00:04:07,020 --> 00:04:08,110
names.

66
00:04:08,840 --> 00:04:09,460
OK.

67
00:04:09,700 --> 00:04:14,820
Assignment operator and then assign an empty value to this object here.

68
00:04:15,000 --> 00:04:15,680
OK.

69
00:04:15,960 --> 00:04:16,460
OK.

70
00:04:16,620 --> 00:04:19,340
Now I want you to create a for loop.

71
00:04:19,530 --> 00:04:19,960
OK.

72
00:04:20,010 --> 00:04:26,310
In order to iterate over each of these values each of these string values that are actually the inside

73
00:04:26,310 --> 00:04:28,150
of this country names are.

74
00:04:28,160 --> 00:04:28,580
OK.

75
00:04:28,770 --> 00:04:32,770
But this time I want to actually use an enhanced for loop.

76
00:04:32,970 --> 00:04:35,530
So in order to create an enhanced for loop.

77
00:04:35,640 --> 00:04:39,900
First of all I need to actually type in for and in say the.

78
00:04:40,080 --> 00:04:43,230
Let's actually create a strange value stream.

79
00:04:43,320 --> 00:04:47,470
And the name of my string object is for example Contarini.

80
00:04:47,530 --> 00:04:47,990
OK.

81
00:04:48,030 --> 00:04:50,750
And then I need to put in a colon here.

82
00:04:51,150 --> 00:04:51,750
OK.

83
00:04:51,930 --> 00:04:56,910
And then I need to actually refer to the name of this country names as a country names.

84
00:04:57,180 --> 00:05:01,790
And then I need to open and close this by using these curly braces.

85
00:05:01,910 --> 00:05:08,530
So as you can see here in sight of this prentices I actually created first of all a string object or

86
00:05:08,540 --> 00:05:11,390
case containing colon country names.

87
00:05:11,690 --> 00:05:17,870
In this way it can actually either get is right or that each of these values that are actually inside

88
00:05:17,870 --> 00:05:19,030
of these country names.

89
00:05:19,270 --> 00:05:19,680
OK.

90
00:05:19,760 --> 00:05:26,060
It's going to be either 8 sequentially or they're every each of these values that are actually inside

91
00:05:26,060 --> 00:05:27,680
of these country names.

92
00:05:27,680 --> 00:05:33,040
And then it's going to actually assign that value to this country name object here to this country in

93
00:05:33,050 --> 00:05:38,600
a radio but so here inside of this for loop I can just typing all country names.

94
00:05:38,730 --> 00:05:44,260
OK assignments operator all country names plus country name.

95
00:05:45,780 --> 00:05:51,910
OK so now here again just after this follow up after the end in calibers of this for loop I can just

96
00:05:51,910 --> 00:05:57,470
type in the country names that set text and inside Apprentice's.

97
00:05:57,570 --> 00:06:04,150
I can't just refer to the name of this ol country names object here as I can see all country names.

98
00:06:04,150 --> 00:06:05,500
And now it's actually not.

99
00:06:05,520 --> 00:06:07,750
I'll protect and see what happens.

100
00:06:07,980 --> 00:06:08,450
OK.

101
00:06:08,650 --> 00:06:13,000
Now as you can see our application is actually running on this emulator.

102
00:06:13,180 --> 00:06:15,760
And here you can see these values here.

103
00:06:15,880 --> 00:06:20,500
Outputted actually to the screen and we can actually scroll down the screen to see the other values.

104
00:06:20,500 --> 00:06:21,110
OK.

105
00:06:21,400 --> 00:06:27,700
And these are actually the values that are actually inside of these country names Auret and here and

106
00:06:27,700 --> 00:06:31,170
here we actually created a loop here as you can see in line twenty eight.

107
00:06:31,300 --> 00:06:36,220
In order to either eight or each of these values that are actually inside of this country names are

108
00:06:36,260 --> 00:06:41,320
8 and then it's going to assign each of these values to this country name or object.

109
00:06:41,320 --> 00:06:47,640
And here inside of this for loop we're actually assigned that value to this all Kultury names are actually

110
00:06:47,680 --> 00:06:48,570
the object here.

111
00:06:48,640 --> 00:06:49,270
OK.

112
00:06:49,660 --> 00:06:55,660
These are valuable and we could actually write this code in another way so I can just comment out this

113
00:06:55,660 --> 00:06:56,640
line of code here.

114
00:06:56,890 --> 00:06:58,110
And I will just type in here.

115
00:06:58,150 --> 00:07:01,800
All country names plus equals Contarini.

116
00:07:01,890 --> 00:07:02,390
OK.

117
00:07:02,530 --> 00:07:04,800
And if I run my project again let's see what happens.

118
00:07:04,840 --> 00:07:07,810
So now as you can see again we can see these values here.

119
00:07:07,810 --> 00:07:08,260
OK.

120
00:07:08,380 --> 00:07:12,310
And we can actually scroll down the screen in order to see the other values.

121
00:07:12,310 --> 00:07:16,210
So this is how you actually use the enhanced for loop.

122
00:07:16,210 --> 00:07:18,800
So I think that's enough for this whole deal.

123
00:07:18,880 --> 00:07:23,770
And if you have any questions please post the discussion in the course and then I'll do my best to answer

124
00:07:23,800 --> 00:07:24,950
all of your questions.

125
00:07:25,150 --> 00:07:28,830
Thank you very much for watching and I'll see you in the next tutorial.

