Example : How to Create a New Project First Time in an Android application.
				
					Open a well set & configured Android application - Choose 'New Project' - Choose 'Empty Views Activity' templates - Next - Put the Application Name (by default My Application) - choose 'Save Location' to save the project - choose Language 'Java or Kotlin' - chosse minimum versions of SDK or Android os from where we want to applied this app. - Finish - Android Application opens with two major files, one for design purpose (main_activity.xml) and other for coding operations (MainActivity.java).
				
			
Example : How to Create a New Project from an existing application of Android.
				
					Open 'File' menu - click on 'New' - select 'New Project' - choose 'Empty Views Activity' template - Next - Put the Application Name (My Application1) - choose 'Save Location' to save the project - choose Language 'Java or Kotlin' - chosse minimum versions of SDK or Android os from where we want to applied this app. - Finish - Android Application opens with two major files, one for design purpose (main_activity2.xml) and other for coding operations (MainActivity2.java).
				
			
Example : How to Run an Android app from an existing Project of an Android application.
				
					Open an Application - click on 'Run'  menu - choose 'Run' option.

NB: Android app data is automatically saved during Run process.
				
			
Example : How to Create/Add different types of String Messages for use in an existing Application.
				
					Open Resource(res) folder in an application (left pane) - click 'Values' folder - Open 'Strings.xml'file - Add different Strings messages with their name as below- 

<resources>
    <string name="app_name">My Application</string>
    <string name="msg1">Hello India</string>
    <string name="msg2">Enter a Value</string>
    <string name="omsg">The Output is</string>
</resources>



NB : Array form of String is used for drop-down list or combo box in String.xml file.
<resources>
    <string-array name="Gender">
        <item>Male</item>
        <item>Female</item>
        <item>Other</item>
    </string-array>
</resources>


				
			
Example : How to Create/Add different types of Colors for use in an existing Application.
				
					Open Resource(res) folder in an opened application - click on 'Values' folder - 
Open Colors.xml file - Add different colors with their name and hexadecimal 
Values of colors as below - 

<resources>
    <color name="black">#FF000000</color>
    <color name="white">#FFFFFFFF</color>
    <color name="red">#ff0000</color>
    <color name="green">#00FF00</color>
</resources>


				
			
Example : How to Create/Add a new Activity page in an existing Application.
				
					- Open an existing application - Right click on MainActivity(.java) containing folder(say com ... application) - click 'New' - select 'Activity' - select 'Empty Views Activity' - Check the 'Launcher Activity' box in appeared window - click Finish - Now,both new MainActivity2.java and activity_main2.xml files created at respected place.

				
			
Example : How to Delete/Remove an Activity page from an existing Application.
				
					- Right click on that say 'MainActivity2.java' or 'activity_main2.xml' file - select and click 'Delete' button - ok.
				
			
Example : How to Run a desired/chosen Activity page from multiple MainActivity pages in an existing Application.
				
					- To run any desired MainActivity.java file, put that activity in the Top order of that MainActivity.java file in 'manifests file' as below -

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
    
    <application android:allowbackup="true" android:dataextractionrules="@xml/data_extraction_rules" android:fullbackupcontent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundicon="@mipmap/ic_launcher_round" android:supportsrtl="true" android:theme="@style/Theme.MyApplication" tools:targetapi="31">
    
    
        <activity android:name=".MainActivity2" android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"></action>
    
                <category android:name="android.intent.category.LAUNCHER"></category>
            </intent-filter>
        </activity>
            
            
        <activity android:name=".MainActivity3" android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"></action>
    
                <category android:name="android.intent.category.LAUNCHER"></category>
            </intent-filter>
        </activity>
        
        
        <activity android:name=".MainActivity" android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"></action>
    
                <category android:name="android.intent.category.LAUNCHER"></category>
            </intent-filter>
        </activity>
            
            
    </application>

</manifest>


NB: Here, MainActivity2.jave file with activity_main2.xml file will executed because of it is in top order of manifests file as above.
				
			
Categories: Android

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.