We are creating a complete City Guide android application. For making that application we have learned how to download and install android studio in the previous tutorial. After that, we will learn how to do an android studio set up and what is the alternate of batch drawable import in this tutorial.
City Guide app helps our application users to get the desired location of a specific city in which the app is launched.
Therefore if you want to learn more about our application you have to see an overview of Get A Way application.
After following this series of tutorials you will become a professional android developer.
Subscribe Our Youtube Channel
Steps for the setup android studio:
In short, this setup will help us to learn how to professionally set up an android studio by doing some simple following steps.
- Download and install android studio
- Create a new project?
- Rename an activity?
- Create a new package or folder?
- Remove an action bar from the activity?
- Remove the status bar from the activity?
- Add colors that will be used in our project?
- Add strings for translating your applications?
- How to add fonts in our application?
- Use a single image for multiple screen sizes or alternate of batch drawable import?
So without wasting time, let’s get started.
1- How to Download and install Android Studio?
Downloading and installing an android studio is the first step for creating an android application.
If you are new to the android studio or want to start learning how to create the android application you have to first download and then install an android studio.
So then to download an android studio and install it, you have to follow our tutorial of downloading and installing the Android studio.
2- How to create a new project in android studio?
Open android studio after the completion of installation.
In the meantime, a window will open from where you can open or create a new project.
a- Start a new Project
So we have to create a new project by clicking on the button called “Start a new android studio project“.
b- Select the template
After that, a new activity will open where you have to select the template of the project. There are 11 templates provided by the android studio.
In this case, we will select an empty activity. so click on it and press the Next button.
c- Configure the project
A new window will open in which we have to configure our project by giving the name of the project such as City Guide.
Next, we will give the package name.
The package name must be unique because the play store identified our application through that package name.
As you have seen we have given the package name as com.myDomainName.ProjectName.
Subsequently, give the location of the application where you want to store in your system
Similarly, select the language in which you want to develop an android studio. It may be Java or Kotlin.
Lastly, select the minimum SDK. What does it mean???
Minimum SDK means that our application which we will develop will run on which version of android.
As I have told you about everything about how to configure your project. So then change your settings according to that.
The configuration of our project is in the following picture.
After configuration click on the Finish button to create a new project.
3- How to Rename an activity in android studio?
Rename an activity is the most important step because sometimes after creating an activity we have to change the name.
So then to change the activity we have to do some clicks.
Right-click on app->java->(project name)->Main Activity.
Now click on Refactor->Rename.
In the meantime, a new window will open where you have to give the new name of the activity.
After giving the new name click on the refactor button.
How to rename the layout file.
After changing the name of java file we have to rename a layout file of that activity.
Similarly to change the name of the layout file we have to right-click on
Then go to Refactor->Rename
In the meantime, a new window will open where you have to give the new name of the layout resource file.
Make sure that the letters of the name are small and use underscore for separation of words.
As a rule, use an extension with the name as we have used .XML.
After giving the new name click on the refactor button.
4- How to create a new package/folder in the android studio?
As we are doing the android studio setup, and the setup means to develop an application professionally.
So then we have to create a new folder in which we have to put all the files in different folders.
By doing this, we can easily access every file we want.
Because it is very hard to find a specific file when our app has more than 10 files.
Thus we have to create a folder.
So for creating a package we have to do some clicks.
Goto app->java->first folder-> right-click on that folder
now go to new and click on the package as shown in the image.
How to give the name of the new Package
In the meantime, a new window will open where you have to give the name of the new package.
As we are creating a city guide app.
So our app is divided into 3 modules.
- User Module
- Admin Module
- Location Owner Module
Due to this, we have to create multiple folders.
Now give the name of the first folder “User” as shown in the image below.
Similarly, create the packages for Admin, LocationOwner, Databases, HelperClasses and Common.
After that put the created Splash screen in Common folder.
5- How to Remove action bar in android studio?
Sometimes we want to create our own action bar. For that, we have to remove the action bar of our application.
Therefore to remove the action bar, go to res->values->styles.
After opening styles.xml you will see resources and style tag.
Next, in the style tag change DarkActionBar to NoActionBar as shown in the code.
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
6- How to Remove Status bar in android studio?
To remove the status bar you have to change code in java file of activity on which you don’t want to see the status bar.
Put the following code before setContentView and after super.onCreate in the onCreate method.
7- How to Add default Colors in your app for further use?
Go to app->res->values->colors.xml file.
There we have 3 default colors, primary, primary Dark and Accent.
Thus change the colours according to your color scheme.
But if you are following us, then change the colors as shown in the following image or click here.
8- How to Add Strings for language translation?
If you want to translate your application in any language you just have to add the strings.
And if all the strings or the words in one place then it will be easy to change them.
Thus to give the strings in our app just go to
Open that file and give the strings of your application as we have added in Get A Way app.
9- How to Add Fonts in Android Studio application?
There are two ways to add the fonts in our android app.
1- Add font using the font family
In the first place, go to the XML file. Then click on the textView.
The attributes section will open on the right side.
So then search for the font family, now click on the down button in the textbox of the font family.
After that click on the More Fonts.
A new window will open where you have to select a font from a lot of google fonts.
2- How to add a downloaded font in the android studio.
To add the downloaded font for the android studio setup first we have to download the font.
I suggest you, download the font from Google fonts.
After downloading extract the zip file.
In the meantime, make a new directory in the “res” folder by right click on app->res->new->directory by giving the name “font”.
Now copy that extracted file and paste it in the fonts directory.
You can access it by writing the name of the copied file in the text-bar of fontfamily.
10- Alternate of the batch drawable import?
We are using android studio 3.6 and in that version batch drawable import not working.
So to use a single image for different screen sizes in the android studio we have to first download Adobe Xd.
After that select the project from the drop-down menu as shown in the figure and make 6 directories in the res folder.
- After that open adobe xd. Create a new project with any mobile type.
- Place your image and et it to the mobile size.
- Right-click on the image and click on make it a component.
- There are properties on the right side of adobe xd.
- Search for the “Mark for the export”.
- On the left side, you will see the name of the image. Right-click on it and select Export Selected.
- A new window will open, make sure the format is png, export for: is android, Designed at is 100%mdpi and lastly select the location you want to export.
- Now click on the export button.
- Go to the extracted folder. Here you will see 6 folders having an image of different screen sizes.
- Now copy separately and paste them in the android studio having a similar directory.
- If you want to learn from the video just click on the video link and go to 11:50.
If you learn something new share our tutorial, follow us and subscribe to our channel.
To learn in detail just follow our Youtube tutorial..
Android Related Videos
- Design a Modern Dashboard
- Material Design Login Screen with Shared Animations
- Create a Navigation Drawer Material Design in 2020
- Design Responsive Android App to fit all screen sizes
Related Articles that you might want to check out.
- Create a new project in android studio for beginners?
- How to create an Account on Fiverr and start earning?
- Create a Gig on Fiverr and start selling specific services.
- How To Start Blogging and Make Money?
Our Projects Make Us Proud