1
00:00:00,100 --> 00:00:05,920
Hire everyone in this tutorial we're going to go ahead and create another Android application.

2
00:00:05,940 --> 00:00:06,960
So just click on this.

3
00:00:06,990 --> 00:00:13,260
Start in your Android studio project here and then for the name of your application just type in here

4
00:00:13,270 --> 00:00:14,970
app 45.

5
00:00:15,240 --> 00:00:20,770
And here you can actually specify the company domain package name and product location and then click

6
00:00:20,770 --> 00:00:27,650
on next here for the minimum STK choose AP is 16 Android 4.1 jelly bean.

7
00:00:27,930 --> 00:00:30,000
And then click on next here.

8
00:00:30,210 --> 00:00:31,830
Choose an empty activity.

9
00:00:31,830 --> 00:00:32,490
OK.

10
00:00:32,670 --> 00:00:37,060
So not notice that we have a blank activity and an empty activity.

11
00:00:37,120 --> 00:00:40,630
Choose empty activity OK and then reconnect.

12
00:00:40,710 --> 00:00:42,730
Here don't change anything.

13
00:00:42,870 --> 00:00:44,280
And then we can finish.

14
00:00:44,400 --> 00:00:47,890
So now as you can see our project is actually created.

15
00:00:47,970 --> 00:00:49,770
So it's actually double click on these arrays.

16
00:00:49,770 --> 00:00:50,730
Folder here.

17
00:00:51,030 --> 00:00:56,270
And then double click on this layout folder and then double click on this activity underline main that

18
00:00:56,300 --> 00:00:56,710
examen.

19
00:00:56,730 --> 00:00:57,630
OK.

20
00:00:57,690 --> 00:01:00,270
So here as you can see this is our Excel file.

21
00:01:00,420 --> 00:01:05,380
So just click on this hell over that takes you here and then press on delete key on your keyboard.

22
00:01:05,490 --> 00:01:11,850
So it's actually drag a linearly out vertical at the center of this relatively OK.

23
00:01:12,000 --> 00:01:17,850
So just select this linearly as vertical here inside the layouts folder and then put it at the center

24
00:01:18,120 --> 00:01:20,090
of this relatively out.

25
00:01:20,100 --> 00:01:22,650
So here is our linearly out vertical.

26
00:01:22,650 --> 00:01:27,730
So now let's actually direct our button into this linearly at vertical.

27
00:01:27,780 --> 00:01:29,210
So just select this button here.

28
00:01:29,220 --> 00:01:35,110
Inside this we just fold there and then put it at the center of this linearly L2 vertical.

29
00:01:35,160 --> 00:01:35,780
OK.

30
00:01:36,120 --> 00:01:42,930
And then just for the layout is assigned a value match Pallant here and double click on this button

31
00:01:42,930 --> 00:01:45,810
here for the text just typing in here.

32
00:01:45,870 --> 00:01:54,090
Let's open UDMA that come OK.

33
00:01:54,150 --> 00:02:03,690
And for the idea to step in here of PTEN open you the me and then press on Enter key on your keyboard.

34
00:02:04,260 --> 00:02:10,110
And now let's actually drag and other a button into this linearly out vertical and for the layout.

35
00:02:10,110 --> 00:02:16,970
We've assigned a value match Pallant here and double click on it here for the text just typing here

36
00:02:16,980 --> 00:02:30,420
let's search the google and then for the ID just typing here Pythian search Google and then press on

37
00:02:30,630 --> 00:02:32,550
until key on your keyboard.

38
00:02:32,610 --> 00:02:36,960
So now it's actually drag another button into this linearly as vertical.

39
00:02:36,960 --> 00:02:43,550
So just put it at the center of this linearly alphabetical OK and for the layout we assign the value

40
00:02:43,560 --> 00:02:44,540
match parent.

41
00:02:44,580 --> 00:02:48,480
Here and Now double click on it.

42
00:02:48,480 --> 00:02:54,360
So now for the text just typing here let's call someone.

43
00:02:55,200 --> 00:03:01,030
And for the ID just type in here between call and then person Enter key on your keyboard.

44
00:03:01,170 --> 00:03:07,470
And now let's actually drag another repotted into this linearly out vertical and put it at the center

45
00:03:07,710 --> 00:03:10,050
of this linearly vertical OK.

46
00:03:10,290 --> 00:03:15,600
And for the layout we assign the value match parent and double click on it.

47
00:03:15,600 --> 00:03:27,620
So for the text just typing in here lets access the dial pad and for the ID just typing here between

48
00:03:27,900 --> 00:03:30,420
access dial pad

49
00:03:33,430 --> 00:03:37,220
OK and then a person Enter key on your keyboard.

50
00:03:37,730 --> 00:03:43,070
So now let's actually select all of these buttons here.

51
00:03:43,430 --> 00:03:44,080
OK.

52
00:03:44,450 --> 00:03:48,280
And now let's actually find out the background attributes.

53
00:03:48,290 --> 00:03:53,540
So here as you can see this is the the this is the background attribute that is related to all of these

54
00:03:53,930 --> 00:03:57,490
buttons here and here I want to actually assign a color.

55
00:03:57,530 --> 00:04:06,260
So here I just need to put in hash tag and put this value here at 0 0 F F F F and then press on until

56
00:04:06,260 --> 00:04:07,940
key on your keyboard.

57
00:04:07,940 --> 00:04:12,080
So now as you can see the color back in and color of these buttons changed.

58
00:04:12,200 --> 00:04:15,060
So now let's actually select this linearly or vertical.

59
00:04:15,140 --> 00:04:20,570
And here I want to actually change the background color of this linearly alphabetical.

60
00:04:20,600 --> 00:04:28,720
So here again just typing here hashtag and here just type in here 45 F F D 5.

61
00:04:29,120 --> 00:04:31,910
And then press on Enter key on your keyboard.

62
00:04:31,910 --> 00:04:38,050
So as you can see here now I actually changed the background color of this nearly 20 code.

63
00:04:38,180 --> 00:04:44,040
So now let's actually run our project and see the user interface of our application.

64
00:04:44,060 --> 00:04:49,570
So here it actually changed the image emulator to Nexus 5.

65
00:04:49,690 --> 00:04:50,110
OK.

66
00:04:50,180 --> 00:04:57,140
So here I just need to choose this lunch emulate it and then I can select between these emulators.

67
00:04:57,140 --> 00:05:05,390
So here I was Nexus 5 API 23 and then I actually checked the search box here that says Use Sainty file

68
00:05:05,440 --> 00:05:09,380
save device for future launches and then press on.

69
00:05:09,470 --> 00:05:10,580
OK here.

70
00:05:10,850 --> 00:05:14,650
So now it's going to actually launch the emulator for me.

71
00:05:15,050 --> 00:05:19,330
So now as you can see our application is running on this emulator.

72
00:05:19,430 --> 00:05:22,830
And here is the design of our application.

73
00:05:22,850 --> 00:05:27,640
So now let's actually go back to our main activity that java file here and here we can actually put

74
00:05:27,650 --> 00:05:29,230
in our own codes here.

75
00:05:29,480 --> 00:05:36,440
So first of all because we want to actually access the Internet and the Carleen feature of our device

76
00:05:36,470 --> 00:05:39,650
first mini to actually open the manifest file.

77
00:05:39,950 --> 00:05:46,070
And here after the application tag here we want to actually specify that we want to use some of the

78
00:05:46,070 --> 00:05:50,660
features of Android and we to actually use those permissions.

79
00:05:50,660 --> 00:05:58,340
So here I just need to open a tag here and here I can just type in users permission and here I want

80
00:05:58,340 --> 00:06:02,760
to specify that I want to actually call someone call someone.

81
00:06:02,780 --> 00:06:05,370
So here I can just type in call form.

82
00:06:05,570 --> 00:06:12,890
OK and then our press Enter key on my keyboard and in here I need to actually close this task here.

83
00:06:13,220 --> 00:06:19,340
So here I am actually specifying that you want to call a phone and you need to actually access that

84
00:06:19,340 --> 00:06:20,300
permission.

85
00:06:20,480 --> 00:06:28,100
Again I want to actually use another permission user's permission access network state.

86
00:06:28,100 --> 00:06:34,430
So here is the access network state permission and then he had to select it and then person and Turkey

87
00:06:34,460 --> 00:06:38,280
on my keyboard and then I need to actually close this take here.

88
00:06:38,840 --> 00:06:39,770
OK.

89
00:06:39,770 --> 00:06:43,200
And here again we want to actually access the Internet.

90
00:06:43,220 --> 00:06:52,610
So here I just need to open attack user's permission and here I am just typing Internet and then press

91
00:06:52,760 --> 00:06:55,940
enter key on my keyboard and then close the stack.

92
00:06:56,030 --> 00:06:56,930
OK.

93
00:06:56,930 --> 00:07:02,150
So here in our main activity that double file we need to actually again put putting some lines of code

94
00:07:02,150 --> 00:07:05,170
regarding the permission to phone call.

95
00:07:05,180 --> 00:07:05,670
OK.

96
00:07:05,810 --> 00:07:11,780
Because we want to actually call someone in our application we need to actually put some lines of code

97
00:07:11,780 --> 00:07:19,910
here in order to ask the user whether they want to actually application whether they allow the application

98
00:07:20,210 --> 00:07:22,850
to call someone else or not.

99
00:07:22,920 --> 00:07:29,060
OK so here I want to put those lines of code here and I'm going to paste them and then explain to you

100
00:07:29,060 --> 00:07:30,390
what's going on here.

101
00:07:30,410 --> 00:07:36,680
So here in our main activity class first of all we need to specify what is going to be the request code

102
00:07:36,830 --> 00:07:37,910
for our permission.

103
00:07:37,970 --> 00:07:38,510
OK.

104
00:07:38,600 --> 00:07:41,110
So here I'm going to paste in this line of code here.

105
00:07:41,150 --> 00:07:48,000
As you can see the access modifier of this of this constant is private.

106
00:07:48,050 --> 00:07:50,230
This constant is actually static.

107
00:07:50,350 --> 00:07:51,300
OK.

108
00:07:51,350 --> 00:07:58,340
And this is actually the final constant the data type of this constant is integer and the name of this

109
00:07:58,340 --> 00:07:59,640
constant is called.

110
00:07:59,660 --> 00:08:00,270
OK.

111
00:08:00,500 --> 00:08:03,420
And I assigned disvalue number one to this constant.

112
00:08:03,440 --> 00:08:11,390
So this is going to be the request code OK for our calling permission OK because we want to call someone

113
00:08:11,630 --> 00:08:17,320
we need to actually create our request code that is actually specific for that past.

114
00:08:17,330 --> 00:08:23,120
OK so whenever the user clicks on this for example on this button here let's call someone.

115
00:08:23,300 --> 00:08:27,040
This request code is specifically related to this.

116
00:08:27,050 --> 00:08:32,630
But in our case with this feature that I want to actually call that someone OK.

117
00:08:32,730 --> 00:08:39,780
So this is very important and now so because there are user interface components may want to actually

118
00:08:40,110 --> 00:08:49,080
access the call and call someone of any to actually provide specific request codes for those user interface

119
00:08:49,080 --> 00:08:50,070
components.

120
00:08:50,070 --> 00:08:57,300
But this man this using this call request called here is going to be only for these let's call them

121
00:08:57,300 --> 00:08:58,860
once someone butts in here.

122
00:08:58,860 --> 00:08:59,310
OK.

123
00:08:59,340 --> 00:09:06,750
So whenever the user touches this button here it is going to call someone OK it is going to access the

124
00:09:06,750 --> 00:09:12,660
card feature of the device and can someone and that's request code and that request could hear inside

125
00:09:12,690 --> 00:09:16,970
our main activity here is going to be only specific to that button.

126
00:09:17,040 --> 00:09:17,860
OK.

127
00:09:18,120 --> 00:09:24,420
So now I have a request code and the name of the request code is call and I assigned this value number

128
00:09:24,420 --> 00:09:27,340
one to this because it's called here to this constant.

129
00:09:27,630 --> 00:09:30,330
So here I'm going to paste in some lines of code here.

130
00:09:30,840 --> 00:09:34,920
So as you can see here I actually pasted these lines of code here.

131
00:09:34,980 --> 00:09:35,810
OK.

132
00:09:35,850 --> 00:09:37,900
And now I'm going to explain to you what's going on here.

133
00:09:38,070 --> 00:09:41,550
So here I actually created an array.

134
00:09:41,710 --> 00:09:41,880
OK.

135
00:09:42,030 --> 00:09:46,090
And array of type string and the name of my address is permissions.

136
00:09:46,110 --> 00:09:50,490
So as you can see here the access modifier of my address is private.

137
00:09:50,490 --> 00:09:52,190
My address is static.

138
00:09:52,260 --> 00:09:52,870
OK.

139
00:09:53,100 --> 00:09:58,320
And here inside inside my array I have only one value.

140
00:09:58,650 --> 00:10:02,090
OK manifest that permission that calls someone.

141
00:10:02,280 --> 00:10:04,530
OK so let me actually did that come here.

142
00:10:04,770 --> 00:10:09,070
So I have only one value one permission manifest that permission.

143
00:10:09,080 --> 00:10:09,640
That code.

144
00:10:09,660 --> 00:10:12,870
So I want to actually access the call feature of my device.

145
00:10:12,870 --> 00:10:13,280
OK.

146
00:10:13,350 --> 00:10:20,730
So here I need to ask the user whether they want to allow my application to access the call feature

147
00:10:20,760 --> 00:10:22,290
of the device or not.

148
00:10:22,560 --> 00:10:23,940
If they allow me.

149
00:10:24,030 --> 00:10:24,580
OK.

150
00:10:24,780 --> 00:10:28,180
If they allow me I can call someone if they don't allow me.

151
00:10:28,220 --> 00:10:30,230
I would not be able to call someone.

152
00:10:30,300 --> 00:10:30,760
OK.

153
00:10:30,810 --> 00:10:37,020
So here I have this method in order to ask the user whether they allow me to call someone or not.

