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.
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 Studiostring.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>
com
folder as it is and rename the other ones.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.
.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.
.java
files.
drawable
folders, where the app icons are stored into the mipmap
folders.
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.
<string> string name="app_name"> QRCode Scanner </string>
<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.comcolors.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";
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.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");
showAdMobInterstitial
The Find in Path window will show you a list of files where that string is located. showAdMobInterstitial(ctx);