1
00:00:00,500 --> 00:00:06,110
So now as you can see here our application is running on this emulator and here you can see that I changed

2
00:00:06,410 --> 00:00:11,990
the color of this tattoo spot to this color and this is the theme of my application.

3
00:00:11,990 --> 00:00:12,470
OK.

4
00:00:12,650 --> 00:00:18,410
I'm not saying that this is a good theme but I just wanted to show you that you can customize the theme

5
00:00:18,410 --> 00:00:22,210
of your application OK however you want whatever you want.

6
00:00:22,250 --> 00:00:23,070
Right.

7
00:00:23,330 --> 00:00:31,580
So now let's actually go and let's actually add the Java codes to our application and make this application

8
00:00:31,820 --> 00:00:34,520
actually an application and applicable application.

9
00:00:34,520 --> 00:00:35,560
OK.

10
00:00:35,750 --> 00:00:41,330
Now it doesn't work right if they actually change this search bar or if we they actually enter a value

11
00:00:41,330 --> 00:00:41,990
here.

12
00:00:41,990 --> 00:00:43,040
It doesn't work here.

13
00:00:43,160 --> 00:00:50,780
We just we just need to actually put the logic to Java codes and then we can actually expect that this

14
00:00:50,780 --> 00:00:52,150
application to work.

15
00:00:52,370 --> 00:00:56,780
So now let's actually go inside this main activity that you have a file here.

16
00:00:57,080 --> 00:01:02,240
And as you can see if you have this class main activity that actually inherits all of the features and

17
00:01:02,240 --> 00:01:05,010
behaviors that are inside this app compare the activity.

18
00:01:05,300 --> 00:01:08,440
We have this uncreate method which you are already familiar with.

19
00:01:08,660 --> 00:01:13,670
And now we can actually go inside this main activity class and I'm going to paste some lines of code

20
00:01:13,670 --> 00:01:18,700
here and then I'm going to explain to you what's going on here.

21
00:01:18,740 --> 00:01:24,290
So now I'm going to pasting some lines of code here and then I'm going to explain to you what's going

22
00:01:24,290 --> 00:01:25,290
on here.

23
00:01:25,760 --> 00:01:30,670
So now I am actually inside this main activity class and I pasted these lines of code here.

24
00:01:30,860 --> 00:01:38,360
First of all in line number 10 I have actually an object and this object is actually type private.

25
00:01:38,390 --> 00:01:40,860
The access modifier of this object is private.

26
00:01:41,360 --> 00:01:43,540
And this object is actually static.

27
00:01:43,760 --> 00:01:44,400
OK.

28
00:01:44,660 --> 00:01:46,660
And this object is final.

29
00:01:46,670 --> 00:01:52,370
And this means that this is actually a constant and Data Type of this object is number format.

30
00:01:52,370 --> 00:01:52,940
Right.

31
00:01:52,940 --> 00:01:58,260
So let's actually open our web browser and let's go to the Android documentation here.

32
00:01:58,790 --> 00:02:06,930
And then let's actually search for non-bird for math class number format on here.

33
00:02:06,950 --> 00:02:12,430
As you can see inside this package Android that ICU that takes that number format.

34
00:02:12,490 --> 00:02:13,070
OK.

35
00:02:13,130 --> 00:02:14,800
Just choose this one here.

36
00:02:17,080 --> 00:02:18,150
Choose this class.

37
00:02:18,220 --> 00:02:26,600
So as you can see here it says we have our dialogue and it says this class requires AP level 24 or higher.

38
00:02:26,680 --> 00:02:32,000
This thug is hidden because you're selected API level for the documentation is to free.

39
00:02:32,050 --> 00:02:38,680
You can change the documentation level API level with the selector above the left navigation.

40
00:02:38,680 --> 00:02:40,610
So now let's actually click on this.

41
00:02:40,630 --> 00:02:46,660
OK make this page visible and here as you can see it's at the top.

42
00:02:46,670 --> 00:02:50,240
We can see this value AP 8:24 API level 24.

43
00:02:50,350 --> 00:02:52,720
And here we have this class number format.

44
00:02:53,080 --> 00:03:00,130
And this is actually a public abstract class and this class actually extends this for math class.

45
00:03:00,130 --> 00:03:02,460
So let's actually read the descriptions.

46
00:03:02,710 --> 00:03:10,510
And here it says are ice use repleat replacement for number format Misfit's field and other functionality

47
00:03:10,510 --> 00:03:18,630
specific to I.S. you are labeled ICU number format is the abstract base class for all number formats.

48
00:03:18,640 --> 00:03:24,350
This class provides the interface for formatting and parsing numbers.

49
00:03:24,610 --> 00:03:25,350
OK.

50
00:03:25,630 --> 00:03:32,800
Number format also provides methods for determining which locales have number formats and what their

51
00:03:32,800 --> 00:03:33,710
names are.

52
00:03:33,910 --> 00:03:39,580
Number format helps you to format and parse numbers for any locale.

53
00:03:39,670 --> 00:03:47,140
Your code can be completely independent of the lockout conventions for decimal points thousand separators

54
00:03:47,350 --> 00:03:53,590
or even to particular the single digits used or whether the number format is even similar to format

55
00:03:53,630 --> 00:03:56,210
and number for the current lookout locale.

56
00:03:56,260 --> 00:03:57,980
Use one of the factory class methods.

57
00:03:58,060 --> 00:04:04,460
So for example we have this thing value number format that get instance that formats my number so it

58
00:04:04,460 --> 00:04:10,090
can actually give us the specific value the specific value that is actually related to that specific

59
00:04:10,090 --> 00:04:10,900
locale.

60
00:04:11,200 --> 00:04:12,910
And then we can actually get there.

61
00:04:13,000 --> 00:04:18,700
For example we have different countries in the world and then it's going to give us the perfect value

62
00:04:18,700 --> 00:04:21,410
that is that is suitable for other countries.

63
00:04:21,460 --> 00:04:21,980
OK.

64
00:04:22,210 --> 00:04:27,750
So it can actually format that value and it's going to give us the perfect value for that specific locale.

65
00:04:27,970 --> 00:04:33,760
If you are formatting multiple numbers it is more efficient to get there format and use it multiple

66
00:04:33,760 --> 00:04:38,590
times so that the system doesn't have to fetch the information about the local language and country

67
00:04:38,590 --> 00:04:40,820
conventions multiple times.

68
00:04:40,840 --> 00:04:43,280
So here we have some examples here.

69
00:04:43,440 --> 00:04:50,360
And now let's look at some of the effects and here as you can see we have these constants so let's look

70
00:04:50,360 --> 00:04:51,760
at them if it's the public methods.

71
00:04:51,770 --> 00:04:58,550
We have this Meffert clone or the rights clone and now we can see this in a format Nefert and it says

72
00:04:58,700 --> 00:05:00,690
formats a big integer.

73
00:05:01,070 --> 00:05:01,740
OK.

74
00:05:02,150 --> 00:05:09,350
And here we have some other format Moffats as you can see with available locales return the list of

75
00:05:09,410 --> 00:05:17,330
locales for which numbered formats are available get currency returns the currency object used to display

76
00:05:17,330 --> 00:05:19,800
currency amounts.

77
00:05:19,910 --> 00:05:27,300
And here it says get currency instance returns a currency format for the specific for a specified locale.

78
00:05:27,530 --> 00:05:28,790
Get currency instance.

79
00:05:28,790 --> 00:05:35,720
This one actually accepts an argument of type your locale and this returns a currency format for the

80
00:05:35,720 --> 00:05:37,360
specified locale.

81
00:05:38,000 --> 00:05:44,780
And here you have the Smiffy returns that gets currency instance the returns currency format for the

82
00:05:44,780 --> 00:05:47,130
current default format locale.

83
00:05:47,270 --> 00:05:53,010
Get instant returns the default default number format for the current default format locale.

84
00:05:53,180 --> 00:05:57,470
And we have some lots of misfits here which you can actually rate them.

85
00:05:57,650 --> 00:06:02,210
But let's go back to our code and here we have this number for a math class.

86
00:06:02,210 --> 00:06:09,190
And actually this is the name of my object currency format's value assignment operator number format.

87
00:06:09,200 --> 00:06:13,980
OK I actually furter the name of this class number format that gets currency instance.

88
00:06:14,000 --> 00:06:20,330
So let's go back to our documentation in order to find the Smurfette gets currency instance as you can

89
00:06:20,330 --> 00:06:20,970
see here.

90
00:06:22,390 --> 00:06:28,330
So here is the Merfeld get good currency instance.

91
00:06:28,360 --> 00:06:34,640
So this is the method returns a currency format for the current default format locale.

92
00:06:34,950 --> 00:06:42,340
OK this method returns a currency format for the current default format locale so we can actually get

93
00:06:42,340 --> 00:06:47,510
the specifics to get the specific cut format of the specific locale.

94
00:06:47,530 --> 00:06:52,660
For example we have different different countries and then it's going to give us the perfect value that

95
00:06:52,660 --> 00:06:55,020
is actually suitable for other countries.

96
00:06:55,080 --> 00:06:55,460
OK.

97
00:06:55,480 --> 00:06:58,000
Number format that get currency instance.

98
00:06:58,000 --> 00:07:04,840
So here we have that actually that object that helps us to get the specific locale get the specific

99
00:07:04,840 --> 00:07:12,310
format that is actually related to that specific locale and in line number 11 as you can see private

100
00:07:12,310 --> 00:07:18,700
static final again number format pearlescent formats value and this this time I want to actually for

101
00:07:18,700 --> 00:07:25,810
example get the format specific format of the person's character that is actually suitable for other

102
00:07:25,810 --> 00:07:26,380
locales.

103
00:07:26,380 --> 00:07:31,590
For example U.S. or Europe countries or other countries of the world.

104
00:07:31,870 --> 00:07:37,050
So person format value assignment operator number format that gets percent instance.

105
00:07:37,230 --> 00:07:37,670
OK.

106
00:07:37,780 --> 00:07:40,350
So here we have those values.

107
00:07:40,780 --> 00:07:46,630
And now again inside this main activity class I'm going to paste in some lines of code here and then

108
00:07:46,660 --> 00:07:49,870
I'm going to explain to you what's going on here.

109
00:07:49,900 --> 00:07:54,610
So as you can see here these are the lines of code that I pasted here.

110
00:07:54,850 --> 00:08:01,060
And as you can see here in line number 16 I have actually a double variable and the access modifier

111
00:08:01,060 --> 00:08:06,450
of this value is actually private the data type is double and the name of this variable is actually

112
00:08:06,460 --> 00:08:07,680
bill amount.

113
00:08:07,690 --> 00:08:12,900
So here as you can see I assigned this value zero point zero to this a variable.

114
00:08:13,090 --> 00:08:17,680
And because the data type of this variable is double he had assigned this double value.

115
00:08:17,690 --> 00:08:20,310
Does this number to this value bet right.

116
00:08:20,710 --> 00:08:22,410
So low number 17.

117
00:08:22,470 --> 00:08:26,980
We have another variable which is actually private double Tepe percent.

118
00:08:26,980 --> 00:08:32,580
So the name of this variable is two percent assignment operator and he and as you can see I assign this

119
00:08:32,580 --> 00:08:36,750
value number 25 percent.

120
00:08:36,880 --> 00:08:41,500
As you can see here number 0.25 here as you can see.

121
00:08:41,680 --> 00:08:45,630
So this is my value that I assigned to this double variable.

122
00:08:46,060 --> 00:08:55,210
And here in line 18 I actually declared this takes view object private takes few th amount private takes

123
00:08:55,210 --> 00:09:02,140
buty 63 percent of inline 20 as you can see takes few takes the tip in line to anyone private takes

124
00:09:02,160 --> 00:09:09,400
few takes the total bill amount and inline 20 free as you can see here private double total salary assignment

125
00:09:09,400 --> 00:09:19,210
operator zero point zero in line 24 private double savings percent assignment operator 0.25 and in line

126
00:09:19,210 --> 00:09:20,620
25 as you can see here.

127
00:09:20,760 --> 00:09:27,000
It takes you to the same percent and in line at 26 as you can see private takes you.

128
00:09:27,210 --> 00:09:29,040
It takes the money saved.

129
00:09:29,110 --> 00:09:29,770
Right.

130
00:09:30,190 --> 00:09:34,870
So you actually declared these objects here and these variables.

131
00:09:35,080 --> 00:09:41,410
And in order to actually initialize these objects and then use them for our for example tip calculator

132
00:09:41,410 --> 00:09:41,720
app.

133
00:09:41,740 --> 00:09:44,850
And for our savings calculator app.

134
00:09:44,860 --> 00:09:49,870
So let's go inside this uncreate Meffert and initialize some of these objects that we declared inside

135
00:09:49,870 --> 00:09:50,680
this class.

136
00:09:50,890 --> 00:09:51,630
OK.

137
00:09:51,910 --> 00:09:56,540
So make sure to actually write all of these codes here inside this main activity class.

138
00:09:56,740 --> 00:10:02,420
And now let's go inside this uncreate method and let's actually do our job here.

