Beginner

Android studio Hello world project for Beginner step by step

The first step is to create a simple Android Application using Android studio. Its very simple. Follow My code step by step or youtube video.

2022-03-27
Share this

The main activity code is a Java file MainActivity.java. This is the actual application file which ultimately gets converted to a Dalvik executable and runs your application. Following is the default code generated by the application wizard for Hello World! application

package com.example.helloworld;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
   }
}

Whatever component you develop as a part of your application, you must declare all its components in a manifest.xml which resides at the root of the application project directory. This file works as an interface between Android OS and your application, so if you do not declare your component in this file, then it will not be considered by the OS. For example, a default manifest file will look like as following file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tutorialspoint7.myapplication">

   <application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme">
      
      <activity android:name=".MainActivity">
         <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
      </activity>
   </application>
</manifest>

Read next

Switch between Activities in Android - Best Step by Step Guide

In this lesson, you add some code to the MainActivity that starts a new activity to display. Also switch between two activities. Here is my video where you can get the full code with my live codes. to watch this video You can understand what exactly you are going to code

Wed, 06 Apr 2022

Modal Bottom Sheet in Androidx with Examples - Working with BottomSheet

A user can view the full Bottom Sheet by dragging the sheet up vertically. Bottom Sheets are a lesser known part of the Design support library.
Thu, 21 Apr 2022

Using Custom and Downloadable Fonts in Android

To work with Custom Font, you need to install the latest version of Android Studio. A font resource defines a custom font that you can use in your app. Fonts can be individual font files or a collection of font files
Thu, 14 Apr 2022