Time to implement your next App Idea.
This series of lectures will help you get started with developing Apps using Android.
Best Tutorials on Android, Java, Machine Learning and more
Time to implement your next App Idea.
This series of lectures will help you get started with developing Apps using Android.
Android framework makes it quite easy for you to generate different flavors and variants of your App. Like you can create a free version or a paid version of your App.
In order to do this you need to follow these steps:
You need to specify the variants or flavors in your App’s build.gradle file.
Like
productFlavors { demo { applicationId "com.edocent.demo" versionName "1.0-demo" } full { applicationId "com.edocent.full" versionName "1.0-full" } }
In all likelihood your Free App version will need a different Activity compared to the Paid one. So you need to create different folders for the two flavors.
So go to the Project->src folder and create a new Java Folder – free.
Create another one for paid similarly.
Add appropriate Activity and other files to this folder.
And you are all set. Execute Generate Signed APK task from the Build option. This will ask you which flavor you need the APK for.
Cool isn’t it.
Source code is available here
All Android Apps must be digitally signed before they are installed on a device.
This is required to verify identity of developer who published it. And also to verify if it has been tampered.
Follow the video to generate the signed APK file and also to learn how to automate the process.
An ADB is a command line tool which can be used to communicate with Emulator or Android Devices.
When your development machine needs to communicate with an Android Device it does so using ADB. It’s a process that is controlled by a command also known as adb.
The adb command works by talking to an adb server which runs in the background at port 5037. The server is also known as adb daemon or adbd.
Android Studio also talks to this server when it needs to run an app via an Android Device.
To work with ADB you need Android SDK.
Creating modules is a good practice since it aids in reusability. In your Android project you can easily add a Java or Android module.
Follow the video to create a Java module and add it as a dependency in your Android Project.
Project source code is available in GitHub
Once you have transferred an APK file to your Android device its stored in /data/app/<package-name>
The classes.dex file is extracted from it and it’s converted to native library, when the App is run the first time, and stored in /data/dalvik-cache. This Machine Code can be run by the CPU.
Each Android device runs a process called Zygote. When an App needs to run Zygote creates a forked version of itself. Which means its a process in memory. Using this forked process and by loading the native library the App can be loaded pretty quickly.