Welcome to the program.
Chapter, and that is the stupid name of the application that I came up with or the name that I came
up with, it's actually a clone of treadle that we're going to build, of course.
So let's go ahead and build this screen, which basically just uses a background and then has a font
here, a custom font that says Proj Monash or manage or approach, manage however you want to pronounce
it.
So basically, it's a project management tool.
That's the idea behind it.
And we're going to build this screen for now.
And this should be the splash screen.
So the splash screen is usually displayed for two to three seconds and then it moves over to the main
activity or the login activity or whatever activity you want to display afterwards.
So let's get started with this.
Therefore, let's go ahead and create a new project.
And I'm going to call this one project ménage.
So empty activity,
Roget, Monash.
OK, just like that, and I think it doesn't have to be at the end, even then it would be more of a
manager than a manager.
So let's go ahead and create a project.
Once the project loaded, let's go ahead and create a new activity.
So I'm just going to create a new activity, which is going to be an empty activity as well, and I'm
just going to give it the name splash activity as we had no action bar in this activity.
As you can see, we only display the image we have here.
I want to have the same design, of course.
So let's go over to our resources folder there in values and styles like smell, let's go ahead and
create a new style.
So I'm just going to create this style called No Action Bar.
So style name theme.
No action bar.
And what I want to have in this is an item called Window Action are said to false.
Then another item called Window No title set to true.
This will allow us, of course, to have no action bar and no title there at the top.
So let's go out to our handwrote manifest because here we have two activities.
Now we have the main activity and the splash activity.
And I want us to to have the screen orientation of portrait.
So Android screen orientation portrait.
And the theme, at least for display activity, should be our new theme that we just created.
So our theme, though, action, Mark.
And then this Internet filter that we had in the main activity is what I want to have for my splash
activity.
So this Internet filter pretty much just set up activity here or splash activity as the launch or activity
and also as the main activity.
So pretty much as the starting point of our application.
OK, so now if we start our application, it will go to the splash activity instead of going to the
main activity.
Now let's go to our activity, splash and style it, so I don't want to use a constraint layout, I'm
just going to use a basic linear layout, keep it super simple and inside of the linear layout.
I just want to have a text to you.
So here, text view.
Which has the rap content as the with rap content as the height it's centered, so gravity should be
center as well as the text should be a text that we create.
So let's go ahead and go to.
Well, actually, we can just use the project app.
So Heartstring Apne.
The text color there, I'm going to use white, so here at Android color slash white.
And then the text is going to make it what the style is going to be bold if it gives me the style first,
but now text size, this one will be 70 Aspy.
And that is maybe something that we want to define in a separate file as well.
So let's go over to our project here and to our values.
So we need a new value here.
And you file values resource file and I'm gonna call this one Dimond's.
So it's going to have all of our dimensions.
So let's go ahead and create a new dimension in here.
I'm just going to call this one splash screen title, text size, and I'm going to set that value to
70 Hespe.
All right, so this is our dimension.
We can use it in our activities.
So here I'm going to go and say at Diemen Splash screen title Tex's.
All right, and then let's close this text to you.
Now we can give it an idea just to be complete here, even though we probably won't need it, but in
case we still want to use it later on, we will be able to access it via this identifier called TV.
Eyup name.
All right, that's going to have this design here, as you can see, project manager, it's just this
white text right now.
It's not perfectly positioned as I would like it.
So we need to go back to the code and finalize our linear layout here as well.
So we need to give it a layout height.
Well, that's fine.
Much apparent, but then the gravity should also be centered, OK.
And then finally, I'm also going to add a background here, and therefore we need, of course, an
image.
So, of course, we didn't copy any images in here, but that's what you can do by downloading the project
assigned to this chapter.
And then you can just download the whole thing and also find the splash background there.
And in this case, I'm just going to drag the ping here to keep it simple.
So I'm just going to use one image, even though, of course, we should have the six different images
for the different screen sizes.
Right.
OK, so here this is the background and I want to use that, of course, in my activity splash.
So let's just add that had trouble and there we have our I see.
Splash background.
All right, let's look at this design once again so you can see Projet Menasche here and our background.
So let's also test this application.
Actually, before we can test that, we should go to the splash activity and make some minor changes
here because we still have to set up a little bit so that we don't have the bar at the top.
All right.
And also so that we use our custom font, because currently, if we look at our background here, we
can see where in this activity splash.
I could see we're using a default font, not a special font that I would like to use.
OK, so let's go ahead.
And first of all, set the window flag.
So window set flags.
And here I'm going to use the window manager.
That layout Hiram's flag underscore full screen.
And another time.
So you need to pass this twice.
And now import window manager, of course.
So that this works.
OK, so setting the flags high is the status bar and makes our splash activity full screen pretty much.
OK, so this is what these two or three lines here do, OK?
And then if you want to use a custom font, what you need to have is, of course, a folder where you
have the font in.
So new folder Hassad folder.
So I'm just going to leave it as it is.
So there we have our assets folder, and that's where you need to drag in the form that you want to
use.
Now, when it comes to funds, there is this website called 1001 Forbes.com.
There's also stuff on dotcom and plenty of other fund websites.
The thing is, when you use a fund, you have to be careful.
Because potentially you will have to buy the license to use it, depending on the font, of course.
So in this case, I'm using this carbon font and it might not be the perfect font for this application,
but it's good enough, in my opinion, at least for this purpose to put currently at.
So if you want to use a custom font, then you can go to, for example, this website.
You can select the font that you want to use.
So in my case, I went for the free fonts, for commercial use that HTML.
So it's just a bunch of free fonts.
You can see there are five thousand fonts here.
You can even decide which kind of style they should have, should it be a headline, a sensory serif
and so forth.
So I just went through and on the third page I found this carbon black, which I liked.
And when you hover over it says free for commercial use, but even though you still need to be careful.
So once you have clicked on this, you can read through the details here.
And here's this hypodermic Forbes.com slash carbon.
That's where you can find information about license because it says these fonts include a license that
allows free commercial use.
So sometimes referred to as desktop license.
This allows you to install the fonts on a computer and use them to create posters, web graphics, game
graphics, T-shirts, videos, signs, logos and more retail license agreement for details.
So then this is interesting for us.
If you'd like to embed these funds in an app ebook on the web or anything that's not covered by the
desktop license agreement, visit the link below.
You'll find distributors who offer different types of license or you can contact me for help.
OK, so then you can check out this website and actually I have it here already and then you can go
to the details about the license.
Right.
And then Phonte, embedding in apps.
If you're making an application and you're using my phone to create a title or some other graphic elements,
the regular desktop license is sufficient.
Sometimes you need to include or encode the actual font file data inside the application.
This requires an app license.
There are two types of application licenses.
So you see you have to have the license for the font or you can try to find some other free royalty
free fonts that you are allowed to use in your application.
OK, so this is not going to be relevant if you just test this on your phone and you're not distributing
it anywhere.
All right.
No one's going to be bothered by this.
But once you make money with it and you distribute it in the application or use it in your application
and hundreds of thousands of people use your application, then it might be a different situation.
So this person might find this font in your application and then he will investigate whether you have
a license or not.
And potentially you would have done to.
Um, yeah.
Pay fees.
All right, so that's something that you have to keep in mind, the general, when you use stuff from
the Internet.
Always be sure that you are allowed to use it in your application and especially that it's allowed to
use commercially as well.
All right, so at this point, you can go ahead and download this font or any font you like and you
are allowed to use.
So I'm just going to why I just started in my project folder there, you'll find the zip file and inside
of the zip file you will find those four files.
So if you want to read more about terms and so forth, you can check this out.
But other than that, you now have the carbon PLDT.
So what you need to do is you need to drag it into your project now to be more specific into the assets
folder, so then you can copy it from here with either.
Right, click and copy.
Or with control them and then go to the assets folder, click on it and then control the or click paste.
OK, so then it will create this asset with a new directory.
So it's going to store it inside of the project.
Cobwebby Altaf.
And now if you want to use that specific typeface or that specific font, you need to go to.
Your activity or the activity in which you want to use it, so I'm just going to create a new type face
object and it will be of type type face.
OK, so then in order to create this typeface, you need to import it.
All right, then.
Typeface that create from asset.
And here you need to say where to find the file.
And it's in our assets folder.
Those folders called assets, right.
By default.
Then you enter the path.
So in our case, it's directly in the parent folder and it's called Carbon B.L., Dot T.F..
OK, so here this name you could see no underscore nothing, just an empty space in between and still
don't understand it.
OK, so carbon jetfighter or carbon PRL Tartuffe and that is going to be the path for the asset.
Now we can use that typeface so you can go ahead and access the TV app name and use the typeface or
set the typeface to be the typeface that we prepare.
So this one here, which, of course, is our fault, so now it will use this font just for this one
text like, OK, and they already see what was useful to give it an ID.
So this text for you here.
OK, now let's test it and let's see what our application will look like and that we are.
So now that's how it looks.
Mannagh.
And we have our splash screen, all right.
So this was just the beginning of our application, of course, but we're going to build it up step
by step, even though probably when you would build this application yourself without going through
this course, then you would not start with a splash screen, I'd guess.
So I think this is something that you probably would add towards the end of the project, so to speak,
because you, first of all, want, of course, to have all of the core features, which means the logging
in functionality or register and log functionality, then storing any kind of data in the cloud and
so forth.
All right.
But of course, we're going to look into all of that.
So see you in the next one.