So now as you can see here our application is running on this emulator and here you can see that I changed
the color of this tattoo spot to this color and this is the theme of my application.
OK.
I'm not saying that this is a good theme but I just wanted to show you that you can customize the theme
of your application OK however you want whatever you want.
Right.
So now let's actually go and let's actually add the Java codes to our application and make this application
actually an application and applicable application.
OK.
Now it doesn't work right if they actually change this search bar or if we they actually enter a value
here.
It doesn't work here.
We just we just need to actually put the logic to Java codes and then we can actually expect that this
application to work.
So now let's actually go inside this main activity that you have a file here.
And as you can see if you have this class main activity that actually inherits all of the features and
behaviors that are inside this app compare the activity.
We have this uncreate method which you are already familiar with.
And now we can actually go inside this main activity class and I'm going to paste some lines of code
here and then I'm going to explain to you what's going on here.
So now I'm going to pasting some lines of code here and then I'm going to explain to you what's going
on here.
So now I am actually inside this main activity class and I pasted these lines of code here.
First of all in line number 10 I have actually an object and this object is actually type private.
The access modifier of this object is private.
And this object is actually static.
OK.
And this object is final.
And this means that this is actually a constant and Data Type of this object is number format.
Right.
So let's actually open our web browser and let's go to the Android documentation here.
And then let's actually search for non-bird for math class number format on here.
As you can see inside this package Android that ICU that takes that number format.
OK.
Just choose this one here.
Choose this class.
So as you can see here it says we have our dialogue and it says this class requires AP level 24 or higher.
This thug is hidden because you're selected API level for the documentation is to free.
You can change the documentation level API level with the selector above the left navigation.
So now let's actually click on this.
OK make this page visible and here as you can see it's at the top.
We can see this value AP 8:24 API level 24.
And here we have this class number format.
And this is actually a public abstract class and this class actually extends this for math class.
So let's actually read the descriptions.
And here it says are ice use repleat replacement for number format Misfit's field and other functionality
specific to I.S. you are labeled ICU number format is the abstract base class for all number formats.
This class provides the interface for formatting and parsing numbers.
OK.
Number format also provides methods for determining which locales have number formats and what their
names are.
Number format helps you to format and parse numbers for any locale.
Your code can be completely independent of the lockout conventions for decimal points thousand separators
or even to particular the single digits used or whether the number format is even similar to format
and number for the current lookout locale.
Use one of the factory class methods.
So for example we have this thing value number format that get instance that formats my number so it
can actually give us the specific value the specific value that is actually related to that specific
locale.
And then we can actually get there.
For example we have different countries in the world and then it's going to give us the perfect value
that is that is suitable for other countries.
OK.
So it can actually format that value and it's going to give us the perfect value for that specific locale.
If you are formatting multiple numbers it is more efficient to get there format and use it multiple
times so that the system doesn't have to fetch the information about the local language and country
conventions multiple times.
So here we have some examples here.
And now let's look at some of the effects and here as you can see we have these constants so let's look
at them if it's the public methods.
We have this Meffert clone or the rights clone and now we can see this in a format Nefert and it says
formats a big integer.
OK.
And here we have some other format Moffats as you can see with available locales return the list of
locales for which numbered formats are available get currency returns the currency object used to display
currency amounts.
And here it says get currency instance returns a currency format for the specific for a specified locale.
Get currency instance.
This one actually accepts an argument of type your locale and this returns a currency format for the
specified locale.
And here you have the Smiffy returns that gets currency instance the returns currency format for the
current default format locale.
Get instant returns the default default number format for the current default format locale.
And we have some lots of misfits here which you can actually rate them.
But let's go back to our code and here we have this number for a math class.
And actually this is the name of my object currency format's value assignment operator number format.
OK I actually furter the name of this class number format that gets currency instance.
So let's go back to our documentation in order to find the Smurfette gets currency instance as you can
see here.
So here is the Merfeld get good currency instance.
So this is the method returns a currency format for the current default format locale.
OK this method returns a currency format for the current default format locale so we can actually get
the specifics to get the specific cut format of the specific locale.
For example we have different different countries and then it's going to give us the perfect value that
is actually suitable for other countries.
OK.
Number format that get currency instance.
So here we have that actually that object that helps us to get the specific locale get the specific
format that is actually related to that specific locale and in line number 11 as you can see private
static final again number format pearlescent formats value and this this time I want to actually for
example get the format specific format of the person's character that is actually suitable for other
locales.
For example U.S. or Europe countries or other countries of the world.
So person format value assignment operator number format that gets percent instance.
OK.
So here we have those values.
And now again inside this main activity class I'm going to paste in some lines of code here and then
I'm going to explain to you what's going on here.
So as you can see here these are the lines of code that I pasted here.
And as you can see here in line number 16 I have actually a double variable and the access modifier
of this value is actually private the data type is double and the name of this variable is actually
bill amount.
So here as you can see I assigned this value zero point zero to this a variable.
And because the data type of this variable is double he had assigned this double value.
Does this number to this value bet right.
So low number 17.
We have another variable which is actually private double Tepe percent.
So the name of this variable is two percent assignment operator and he and as you can see I assign this
value number 25 percent.
As you can see here number 0.25 here as you can see.
So this is my value that I assigned to this double variable.
And here in line 18 I actually declared this takes view object private takes few th amount private takes
buty 63 percent of inline 20 as you can see takes few takes the tip in line to anyone private takes
few takes the total bill amount and inline 20 free as you can see here private double total salary assignment
operator zero point zero in line 24 private double savings percent assignment operator 0.25 and in line
25 as you can see here.
It takes you to the same percent and in line at 26 as you can see private takes you.
It takes the money saved.
Right.
So you actually declared these objects here and these variables.
And in order to actually initialize these objects and then use them for our for example tip calculator
app.
And for our savings calculator app.
So let's go inside this uncreate Meffert and initialize some of these objects that we declared inside
this class.
OK.
So make sure to actually write all of these codes here inside this main activity class.
And now let's go inside this uncreate method and let's actually do our job here.