Android tutorial - Create an Interface in Android Studio - android studio tutorial
What is Interface?
![process of interface of android](https://mail.wikitechy.com/cdn/tutorials/android/interface-android-process.png)
- An interface is a reference type in Java.
- It is similar to class.
- It is a collection of abstract methods.
- A class implements an interface, thereby inheriting the abstract methods of the interface.
- Along with abstract methods, an interface may also contain constants, default methods, static methods, and nested types.
- Just like Java classes you can create Interface in android studio.
- This article will help you create an interface under your package name. Follow the below steps to create a new Interface.
What is Interface? How to create an Interface in Android Studio:
- Step 1: Open your Android Studio and navigate to Android View
- Step 2: Select and open App folder then Java > yourPackageNAme(com.example.myApplication).
![procedure of android interface](https://mail.wikitechy.com/cdn/tutorials/android/android-interface-in-android-studio.png)
- Step 3: Right click on package name then New > Java Class.
![interface android procedure](https://mail.wikitechy.com/cdn/tutorials/android/android-interface.jpg)
Step 4:
- Android Studio will open a dialog box.
- Enter a name for your Interface.
- Change its type by selecting KIND options and select Interface from the drop-down list.
- Then click on Ok.
![creating new class interface](https://mail.wikitechy.com/cdn/tutorials/android/create-interface-in-android-studio.jpg)
- Now you will have an Interface under your Package name.