---
title: "How to add summernote editor in  android studio project?"  
description: "How to add summernote editor in  android studio project?"  
author: "Arti Mishra"  
published: 2018-10-27  
updated: 2023-07-02  
canonical: https://www.mindstick.com/forum/34696/how-to-add-summernote-editor-in-android-studio-project  
category: "android apps"  
tags: ["android"]  
reading_time: 5 minutes  

---

# How to add summernote editor in  android studio project?

How to [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) summernote [editor](https://www.mindstick.com/forum/78/how-avoid-the-html-tag-and-remove-the-formating-of-copy-in-ajax-editor) in [android studio](https://www.mindstick.com/blog/10942/android-studio-vs-eclipse) [project](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects)?

## Replies

### Reply by Aryan Kumar

Sure. Here are the steps on how to add Summernote editor in Android [Studio](https://answers.mindstick.com/qa/116181/google-launches-workspace-studio-to-create-automated-gemini-powered-agents) project:

1. Add the Summernote editor dependency to your project. You can do this by adding the following line to your project's `build.gradle` file:

Code snippet

```plaintext
dependencies {
    implementation 'com.github.summernote:summernote-android:0.8.18'
}
```

1. Add the Summernote editor layout to your project's layout file. You can do this by adding the following code to your project's `activity_main.xml` file:

Code snippet

```plaintext
<com.summernote.summernote:summernote
    android:id="@+id/summernote"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
```

1. Initialize the Summernote editor in your project's `MainActivity.java` file. You can do this by adding the following code to your project's `MainActivity.java` file:

Code snippet

```plaintext
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Initialize the Summernote editor
        Summernote summernote = findViewById(R.id.summernote);
        summernote.setPlaceholder("Enter your text here...");
    }
}
```

1. Run the app and test the Summernote editor.

This code will initialize the Summernote editor and set the placeholder text to "Enter your text here...". When you run the app, you will see a Summernote editor in the layout. You can use the Summernote editor to edit text.

You can customize the Summernote editor by setting the following properties:

- **Placeholder:** The placeholder text that will be displayed in the Summernote editor.
- **Theme:** The theme of the Summernote editor.
- **Plugins:** The plugins that will be enabled in the Summernote editor.
- **Language:** The language of the Summernote editor.

You can also add other features to the Summernote editor, such as a list of items, a text field, or a progress bar.

### Reply by ariana pham

Post is removed by the Admin.

### Reply by Arti Mishra

**“Summernote”** Getting started first we know about What is summernote? it is an **editor that uses an open source library for posting any text or image**. It is a combination of different language like **HTML, CSS, javascript, jQuery, Bootstrap..etc.****\** **Here we demonstrate the simple example for adding the summernote editor in our code project.****\** **Add this code to your dependencies**

```
buildTypes {        release {            minifyEnabled true            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }..................................................dependencies {implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.github.bumptech.glide:glide:4.0.0'compile 'in.nashapp.androidsummernote:androidsummernote:1.0.5'}
```

\
**Add some code in Manifest (For adding images from Device)** <uses-permission [android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios):name="android.permission.READ_EXTERNAL_STORAGE" />\
**Retrive HTML Data from summernote**String html_data = summernote.getText();\
**Set HTML Data** summernote.setText("<h2><i>Hello World.</i><h2><br><h3> Summernote Example</h3>");\
**Activity_main.xml**

```
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.msclient009.summernoteexample.MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <TextView
            android:id="@+id/tex1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="20dp"
            android:layout_marginStart="50dp"
            android:layout_marginTop="20dp"
            android:text="Summernote Example"
            android:textColor="#f00"
            android:textSize="22dp"
            tools:ignore="InvalidId" />
        
        <TextView
            android:id="@+id/tex"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="20dp"
            android:layout_marginStart="50dp"
            android:layout_marginTop="20dp"
            android:text="Scrollable Summernote"
            android:textColor="#f00"
            android:textSize="22dp"
            tools:ignore="InvalidId" />

            <in.nashapp.androidsummernote.Summernote
                android:id="@+id/summernote"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginEnd="5dp"
                android:layout_marginStart="5dp"
                android:layout_marginTop="5dp"
                android:overScrollMode="ifContentScrolls"

                android:scrollbarAlwaysDrawVerticalTrack="true"
                android:scrollbarSize="20dp"
                android:scrollbarStyle="insideInset"
                android:scrollbars="vertical"
                android:verticalScrollbarPosition="right" />
    </LinearLayout>

</ScrollView>
```

**\****MainActivity.java** \

```
package com.example.msclient009.summernoteexample;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import in.nashapp.androidsummernote.Summernote;

public class MainActivity extends AppCompatActivity implements View.OnTouchListener {
    Summernote summernote;

    @SuppressLint("ClickableViewAccessibility")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        summernote = (Summernote) findViewById(R.id.summernote);
        summernote.setRequestCodeforFilepicker(5);
        summernote.setText("<h2>Hello World.<h2><br><h3> I'am Summernote</h3>");
        summernote.setOnTouchListener(MainActivity.this);
    }

    @Override
    public boolean onTouch(View view, MotionEvent motionEvent) {
        if (summernote.hasFocus()) {
            view.getParent().requestDisallowInterceptTouchEvent(true);
            switch (motionEvent.getAction() & MotionEvent.ACTION_MASK){
                case MotionEvent.ACTION_SCROLL:
                    view.getParent().requestDisallowInterceptTouchEvent(false);
                    return true;
            }
        }

        return false;
    }
}
```

\
**Output :**![How to add summernote editor in  android studio project?](https://www.mindstick.com/mindstickforums/413525c2-e0c5-4824-8d87-83956924f423/images/c4942ff1-d658-4673-a488-1c100dc7a1a2.png)\
**\****\****\****\****"Thanks!!! for Reading"**\


---

Original Source: https://www.mindstick.com/forum/34696/how-to-add-summernote-editor-in-android-studio-project

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
