Introduction

Please carefully read this guide in order to fully configure this template, and remember to test it on a Real Device – the Emulator may fail.

Quick Start

You may just run this app on your own device via Android Studio and play with it, it will work.
Anyway you need to customize this app into your own version, so just keep reading this guide.

General

Android Studio

This template has native Android Java/XML code so you can edit it only with Android Studio. If you don’t have it, download it for free.

Download Android Studio
PLEASE NOTE that you’ll need the latest official version of Android Studio, NO BETAS, because Betas are always buggy and never work properly.
Please make sure you have installed the following SDK Tools:

Change App Name

Enter the string.xml file – it’s into the res/values folder in Android Studio – and replace the App Name of this line with your new one:
 <string> string name="app_name"> QRCode Scanner </string>

Change the Package Name

  • In the Project panel on the left side, click on the little gear icon.
  • Uncheck the Compact Empty Middle Packages option.
  • Your package directory will get separated into single directories, I'd suggest you to leave the com folder as it is and rename the other ones.
    So, for each directory you want to rename:
    • Right-click on it
    • Select Refactor -> Rename...
    • Click Rename Package in the popup
    • Enter a new name in the text field and click Refactor
    • Click Do Refractor in the Refactoring Preview tab on the bottom
    • Android Studio will update the changes, it may take a few seconds, just wait for the process to be done.


Next, open build.gradle (the Module app one) in Android Studio and rename the applicationId into your new package name, then click Sync Now on the top-right corner.

Reskin the UI design of the app

This project contains .xml files stored into the res/layout folder. Those files are the ones where you can edit all Views, Buttons texts, TextView’s strings, and all Views attributes – position, font color, size, etc.

Alert messages are located in the code, they can be edited only in the .java files.

All images are stored in the drawable folders, where the app icons are stored into the mipmap folders.

Configurations

• The strings.xml file

You can find this file into the res/values folder in Android Studio. Open this file and keep reading this guide, you’ll have to perform some edits in this file in order to get your template ready to run.

App Name

Replace the following name with the new one you want to give to this app in this line:
 <string> string name="app_name"> QRCode Scanner </string>

AdMob Ads

Replace the values of these variables with your own Interstitial Unit ID and App ID strings.
 <string>name="ADMOB_INTERSTITIAL_UNIT_ID">ca-app-pub-3940256099942544/1033173712
 <string>name="ADMOB_APP_ID">ca-app-pub-3940256099942544~3347511713
You have to create your Unit ID at apps.admob.com
Follow the instructions on the AdMob’s website in case you don’t know how to generate an AdMob Unit ID.

Custom Colors

You can edit the HEX values of the following variables as you wish the colors.xml file – you can find it into the res/values folder. The main color of the app and some other Views will be affected by your change:
 public static String MAIN_COLOR =  "#ffcc33";
public static String LIGHT_GRAY = "#e1e1e1";
PLEASE NOTE that not all views will be affected by changing the HEX values above, you may still need to go through some XML file and adjust the colors on your own with the right-side Attributes panel.

Custom fonts

This App uses some custom fonts for Buttons, TextViews and EditTexts. The font files are stored into the app/src/main/assets/font folder and are declared in this line:
 public static Typeface popBlack, popBlackItalic, popBold, popBoldItalic, popExtraBold, popExtraBoldItalic, popExtraLight, popExtraLightItalic, popItalic, popLight, popLightItalic, popMedium, popMediumItalic, popRegular, popSemibold, popSemiboldItalic, popThin, popThinItalic;
These fonts are initialized into the onCreate() function as follows:
 popBlack = Typeface.createFromAsset(getAssets(),"font/Poppins-Black.ttf");
        popBlackItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-BlackItalic.ttf");
        popBold = Typeface.createFromAsset(getAssets(),"font/Poppins-Bold.ttf");
        popBoldItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-BoldItalic.ttf");
        popExtraBold = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraBold.ttf");
        popExtraBoldItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraBoldItalic.ttf");
        popExtraLight = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraLight.ttf");
        popExtraLightItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-ExtraLightItalic.ttf");
        popItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-Italic.ttf");
        popLight = Typeface.createFromAsset(getAssets(),"font/Poppins-Light.ttf");
        popLightItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-LightItalic.ttf");
        popMedium = Typeface.createFromAsset(getAssets(),"font/Poppins-Medium.ttf");
        popMediumItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-MediumItalic.ttf");
        popRegular = Typeface.createFromAsset(getAssets(),"font/Poppins-Regular.ttf");
        popSemibold = Typeface.createFromAsset(getAssets(),"font/Poppins-SemiBold.ttf");
        popSemiboldItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-SemiBoldItalic.ttf");
        popThin = Typeface.createFromAsset(getAssets(),"font/Poppins-Thin.ttf");
        popThinItalic = Typeface.createFromAsset(getAssets(),"font/Poppins-ThinItalic.ttf");
In case you want to add a new font, you have to first drag your .ttf or .otf font file into the app/src/main/assets/font folder.
Then instantiate it at the end of the public static Typeface line that’s into the onCreate() function – let’s pretend you have a font file called Helvetica-Bold.ttf, you may add an instance called hBold (it’s just an example, name it as you wish since it’s a variable):
 public static Typeface popBold, popSemibold, ... hBold;
Lastly, import its path into the onCreate() function like the existing ones. Based on the font example above, your new line of code may look like this:
 hBold = Typeface.createFromAsset(getAssets(),"font/helvetica-Bold.ttf");

Utility Functions

Unless you are familiar with Android programming, you should leave the code of this section as it is since it includes useful functions to show alerts and perform other things in the app.

F.A.Q.

If I buy this app template, can I use for multiple projects?

No, only 1 app/purchase.
In case you want to publish more than 1 application using this template, you must purchase a License for each project you want to publish on the App/Play Store, either the Regular ot the Extended one

What kind of support is offered?

Free support is offered in case of bugs encountered in the original template, either in the code or the UI design.
In case you have edited the code – and so created bugs because of your editing – I may apply some fee to fix your bugs by a remote connection through AnyDesk, or by you sending me your source code for verification.

Should I use Android Studio to edit this template?

Yes, you must always use the latest stable official version of Android Studio to edit this application – NO Betas, they don’t work properly!
Download Android Studio

I’ve performed all configurations mentioned in this Guide, but something is wrong. What should I do?

  • Double-check all your configurations, probably you have missed something
  • Always check the Logcat in Android Studio if the app crashes, usually the error messages are shown in red color
The Logcat helps you to debug your app, it’s really important!

How do I remove AdMob ads?

It’s super easy, just open the Find in Path tool in Android Studio by clicking Edit -> Find -> Find in Path, and search for:
 showAdMobInterstitial
The Find in Path window will show you a list of files where that string is located.
Just comment out (or delete) the following line of code in each file and the app will not show AdMob ads on next run:
 showAdMobInterstitial(ctx);

Support

PLEASE NOTE: I can offer FREE support for bugs/errors encontered in the original code.

Email me through my Profile's Contact Form on Envato