Internal Storage Android

To read or write data from a device’s internal memory with the help of the FileInputStream and FileOutputStream classes, Android Internal Storage is used. Example: To read and write data to the android internal storage: activity_main.xml: In the activity_main.xml file, we will drag the EditTexts, TextViews, and buttons from the palette. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout … Read more

Android Preferences

To store and retrieve the primitive information, i.e, the data of primitive data types such as string, integer, long, number, etc., the Android shared preference is used. The value can be retrieved on the basis of a key as the Android Shared Preferences store data in the key and value pair. To get the information … Read more

AlarmManager Android

To access the system alarm in Android, the Android AlarmManager is used. It is used to schedule an application to run at a specific time in the future, that works whether the phone is running or not. To guarantee not to sleep the phone until the broadcast is handled, a CPU wake lock is held … Read more

Android Service

To perform operations on the background, Android service is used which is not a thread or separate process. It is a component used for playing music, handling the network transactions, interacting content providers, etc. Without any UI (user interface), the Android service runs in the background indefinitely even after the application is destroyed. To perform … Read more

Popup Menu Android

To display the menu below the anchor text or above the anchor text (in case the space is not available above), the Android Popup Menu is used. On clicking outside the popup menu, the menu disappears. The java.lang.Object class has the android.widget.PopupMenu as a direct subclass. Android Popup Menu Example: In the below example, we … Read more

Context Menu Android

The menu in Android can be of three types, mainly, Option menu, Context Menu, and Popup menu. On pressing a long click on an element, the Android context menu appears which is also known as the floating menu. While acting, the context menu affects the selected content. The item shortcuts and icons are not supported … Read more

Option Menu Android

Being the primary menus of android, Android Option Menus are used for settings, search, delete an item, etc. In this tutorial, we will first learn about the simple options menu use for searchview on the toolbar. The inflate() method of the MenuInflater class is used to inflate the menu. The onOptionsItemSelected() method of Activity class … Read more

Android Fragments

Being a part of an activity, the Fragment in Android is also known as a sub-activity, i.e an activity can have more than one fragment. Multiple screens are represented by the fragments in an activity. Since the fragments are included in the activity, the Android fragment lifecycle gets affected by the activity lifecycle. Also since … Read more

Share App Data Android

Android Share App Data (ACTION_SEND) The ACTION_SEND is an event of android.content.Intent class. This event is used in Android to send data from one activity to another and also from the current activity to outside the application. The data to be shared and its type is necessary to be defined by the Intent class. The … Read more

StartActivityForResult Android

The result from another activity can be received by using the android startActivityForResult() method, i.e., the information from one activity can also be sent to another activity and is the same for vice-versa, by using the android startActivityForResult() method. A result is needed by the android startActivityForResult method from the second activity, i.e, the activity … Read more