HSSC JOBS

Latest Govt. Jobs and Admission updates are available here.

Breaking

11 Jul 2020

Create Android Apps without Android Studio - III

Android Apps without Android Studio - 3

So, you are here because all the setups were successful. Great.

Now, let’s download the platform tools. Open the command line and enter the below command:

sdkmanager –list

This will show a long list of available tools as shown below.

C:\Users\me>sdkmanager --list

Available Packages:
  Path                                         | Version | Description
  -------                                      | ------- | -------
  build-tools;30.0.1                           | 30.0.1  | Android SDK Build-Tools 30.0.1
  cmdline-tools;latest                         | 2.1     | Android SDK Command-line Tools (latest)
  emulator                                     | 30.0.12 | Android Emulator
  platform-tools                               | 30.0.3  | Android SDK Platform-Tools
  platforms;android-30                         | 2       | Android SDK Platform 30
  sources;android-29                           | 1       | Sources for Android 29
  system-images;android-30;google_apis;x86_64  | 6       | Google APIs Intel x86 Atom_64 System Image

So, we will be installing the latest packages only. Hence, enter the below command in command prompt.

sdkmanager “platform-tools” “platforms;android-30”

This will start downloading the packages

C:\Users\me>sdkmanager "platform-tools" "platforms;android-30"
[====                                   ] 11% Downloading platform-30_r02.zip...

Once it has finished downloading all the packages, run the command below:

sdkmanager –list

This will show you the list of installed packages. Your list might look slightly different than this.


Installed packages:=====================] 100% Computing updates...
  Path                 | Version | Description                    | Location
  -------              | ------- | -------                        | -------
  build-tools;30.0.1   | 30.0.1  | Android SDK Build-Tools 30.0.1 | build-tools\30.0.1\
  emulator             | 30.0.12 | Android Emulator               | emulator\
  patcher;v4           | 1       | SDK Patch Applier v4           | patcher\v4\
  platform-tools       | 30.0.3  | Android SDK Platform-Tools     | platform-tools\
  platforms;android-30 | 4       | Android SDK Platform 30        | platforms\android-30\

Now you have to accept all the licenses

So, enter this command.

sdkmanager –licenses

Accept all the licenses.

Now … we are done installing all the tools we are going to need for development.

Lets begin

Create a folder with the nae you want to create. I have named it Fromis.

open your command line from that folder and enter command

gradle init

It will ask for selections .. so, choose them as you wish OR you can do as I have.

Type of project should be ‘1: basic’ or ‘2: application’ only.


F:\Codefolds\Fromis>gradle init

Select type of project to generate:
  1: basic
  2: application
  3: library
  4: Gradle plugin
Enter selection (default: basic) [1..4] 1

Select build script DSL:
  1: Groovy
  2: Kotlin
Enter selection (default: Groovy) [1..2] 2

Project name (default: Fromis):

BUILD SUCCESSFUL in 1m 35s
2 actionable tasks: 2 executed

If you get a message like this on the top, it’s ignorable.

Starting a Gradle Daemon, 3 incompatible Daemons could not be reused, use –status for details

This will create the boilerplate code for our app.

You can see the generated files and folders below :

me@Apeman MINGW64 /f/Codefolds/Fromis
$ ls -a
./   .gitattributes  .gradle/          gradle/   gradlew.bat
../  .gitignore      build.gradle.kts  gradlew*  settings.gradle.kts

If you select project type as '2: application', a folder named src will be created which will be having two folders named 'main' and 'test'. The 'main' folder will contain 'app.kt' file.

In the next post, we will understand all the created files.



No comments:

Post a comment