Skip to main content

Add long text /Description / paragraph in an android application

Hello guys, In this tutorial, we will see how to create activity with textview, image view and add long text or description or how to include a paragraph in an activity.

Step 1: Create a new project in an android studio.


step 2:  Give any name to your project.

Step 3: Select the minimum SDK version for your project.


Step 4: Select any activity for your project to start with coding. I have selected empty activity here.


Step 5: MainActivity will be your default and necessary activity.


Step 6: After clicking "Finish", we will be able to get started with our application coding.

We all know how to add text to activity but now we will see how to add long text or description or paragraph to our android activity.
Below is the code for this project.

MainActivity.java :

package com.sharayusuryawanshi.lenovo.android_paragraph;

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);
    }
}

Make sure to change your package name to avoid errors.

activity_main.xml :

<?xml version="1.0" encoding="utf-8"?>

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

        xmlns:tools="http://schemas.android.com/tools"

        android:id="@+id/activity_balasana"

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        tools:context="com.sharayusuryawanshi.lenovo.android_paragraph.MainActivity">

   <ScrollView

            android:layout_width="match_parent"

            android:layout_height="match_parent"

            android:background="@drawable/wallp">

            <RelativeLayout

                android:layout_width="match_parent"

                android:layout_height="match_parent">

  <TextView

                    android:layout_width="match_parent"

                    android:layout_height="match_parent"

                    android:layout_alignParentStart="true"

                    android:layout_alignParentTop="true"

                    android:layout_marginTop="15dp"

                    android:gravity="center"

                    android:text="ANDROID HISTORY"

                    android:textColor="#e71616"

                    android:textSize="30dp"

                    android:id="@+id/textView" />

<ImageView

                    android:id="@+id/imageView"

                    android:layout_width="match_parent"

                    android:layout_height="270dp"

                    android:layout_alignParentStart="true"

                    android:layout_below="@+id/textView"

                    android:layout_marginTop="17dp"

                    android:src="@drawable/andyrobo">
  
           <TextView

                 android:layout_width="match_parent"
              
                 android:layout_height="match_parent"

                    android:layout_alignParentStart="true"

                    android:layout_below="@+id/imageView"

                    android:text="

The version history of the Android mobile operating system began with the public release of the Android beta on November 5, 2007. The first commercial version, Android 1.0, was released on September 23, 2008. Android is continually developed by Google and the Open Handset Alliance, and it has seen a number of updates to its base operating system since the initial release.



Versions 1.0 and 1.1 were not released under specific code names, although Android 1.1 was unofficially known as Petit Four. Android code names are confectionery-themed and have been in alphabetical order since 2009's Android 1.5 Cupcake, with the most recent major version being Android 9.0 Pie, released in August 2018."

                    android:textColor="#FFFFFF"

                    android:textSize="20dp" />

            </RelativeLayout>
  </ScrollView>
</RelativeLayout>


Comments

Popular posts from this blog

Install Sticky notes in Ubuntu 16.04

Hello, Now you can use sticky notes in Ubuntu also!! Just follow the steps given below Follow or copy the below commands in your Ubuntu terminal: Step 1: Add a repository: $ sudo add-apt-repository ppa:umang/indicator-stickynotes Step 2: Update: $ sudo apt-get update Step 3: Install Indicator stickynotes: $ sudo apt-get install indicator-stickynotes Thank you!

Redirect to any link from android app with source code

Hello guys, In this tutorial, we are going to tell you that how can you redirect to any link or how can you access any link from your own Android app with source code. Please follow the below steps: Here we are going to upload the data and files to Google drive and going to access those data through our app. Step 1: Refer to this video for uploading data on your Google drive. Step 2: After uploading data to google drive, now we are going to access all these files from our android application. Step 3:  Now create the new android project in the android studio. To create a new project, please visit the link given below: http://scubecodeclub.blogspot.com/2018/09/add-long-text-description-paragraph-in.html Step 4: You can refer or paste the code given below in your project. MainActivity.java: package com.sharayusuryawanshi.lenovo.link_redirection; import android.content.Intent; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import and...