Posts

Android Menu | Different types of menu in android

Image
Android Menu : Android provides an easy and flexible user interface component known as menu, which is used to handle a set of actions. Menu is a set of options, the user can select from to perform an action . Android menu provide a familiar and consistent user experience all over the application.  Android Menu Types of Menu : Android offers three fundamental types of menus : Option Menu Context Menu Popup Menu 1.  Option Menu  : Android option menu is the primary collection of menu items for an activity. It is the place where we implement the actions that have a global impact on the app, such as Search, Settings and Delete. 2. Context Menu : Context menu provides a set of menu options when user perform long click on an Element. Most often context menu is used for items in a  RecyclerView ,  GridView ,  ListView  or other view collections in which the user can perform direct actions on each item. Android provides two differe...

How to create textview in android using android studio ?

Image
TextView : In this tutorial we will learn about how to create a textview    android , how to get the text value using  edittext   from the user and set the text value on textview when  button  is clicked and their example . TextView is an user interface design that displays text to the user . TextView is an android support widget which is used to show the text to the user . 1. Create a New Project : Lets we start with a new project in Android Studio from File New Project ⇒ select Empty Activity and go through it. 2. Add TextView in android xml layout : Add TextView to your XML Layout file i.e. activity_main.xml to create a textview to set the value for better user experience or just add the following code to activity_main.xml file . <TextView android:id="@+id/textView" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Hello World" /> 3. Now find the ...

Activity Life-cycle in Android | Android activity lifecycle

Image
Activity : Activity  is an application component that provide a single focused screen in Android App with which user can interact in order to do something . Activity is the main component of android app, which is displayed as a single window to the user, handles user events and provides behavior for a screen. Activity Lifecycle : The activity life-cycle is the set of states an activity can be in during its entire lifetime, from when it’s created to when it’s destroyed and the system reclaims that activity’s resources. Every screen on Android applications has a lifecycle. At every stage in the lifecycle of an activity has a corresponding callback method like onCreate(), onStart(), onPause() etc. The below Activity life cycle diagram shows the sequence of callback methods : When an activity changes their state, the associated callback method is called . Overriding a lifecycle callback method allows you to add behavior that occurs when your Activity transitions into ...

What is an activity in android ?

Image
Activity : One of the fundamental building block of Android app development is Activity. An activity represents a single screen in Android app with which user can perform a single, focused task such as  dial the phone , take a photo, send an email , or view a map. Activities are usually presented to the user as full-screen windows. Activity Stack to manage the Activity : Activities in the system are managed as activity stacks. Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack (the “back stack”). When a new activity starts, that new activity is pushed onto the back stack and takes user focus. The back stack abides to the basic “last in, first out” stack mechanism, so, when the user is done with the current activity and presses the Back button, that current activity is popped from the stack (and destroyed) and the previous activity resumes. All activities are work together to form a cohesive user experience...

How to create a button in android using android studio ?

Image
In this tutorial we will learn about how to implement a button, how to set onClick listener for button,show a toast when button is clicked and their example . Android provides another supporting widget , i.e. android.widget.Button which is used to click to perform an action or event . Button is an user interface i.e. the user can tap to perform an event/action . Button provides the onClick() method which is used if button get clicked it will listen and call the method or perform an action. 1. Create a New Project : Lets we start with a new project in Android Studio from File New Project ⇒ select Empty Activity and go through it. 2. Implement button in android xml layout : Add Button to your XML Layout file i.e. activity_main.xml to implement clickListener to display it for better user experience or just add the following code to activity_main.xml file . <Button android:background="@android:color/holo_red_light" a...

Android Beginner’s Guide | Beginner’s guide to android app development

Image
If you want to start your adventure as an android developer, but you don’t know how ? find out theses basic steps! This tutorial is designed for students who are new to programming, and want to learn how to develop Android apps. What is Android ? Android Inc. founded in Palo Alto, california ,united states in October 2003 by Andy Rubin,rich miner, nick sears and Chris white to develop. In 17th August 2005, Google acquired android Incorporation. Since then, it is in the subsidiary of Google Incorporation. Install Android IDE  : It’s not an easy process to set up your computer for Android development, but it’s not difficult, either. The basic steps are: Install Java Development Kit (  JDK  ) on your Computer. Install the Android SDK. Install the Android SDK ( You can choose either of them ): Install  Eclipse , the Integrated Development Environment (IDE) recommended for Android development . Or Install  Android Studio , the Integrated Developm...

What is Android ?

Image
Android : Android Inc. founded in Palo Alto, california ,united states in October 2003 by Andy Rubin,rich miner, nick sears and Chris white to develop. In 17th August 2005, Google acquired android Incorporation. Since then, it is in the subsidiary of Google Incorporation. It is a open source software platform and operating system for mobile devices and based on the Linux kernel. Android was developed by Google and the Open Handset Alliance (OHA), a coalition of hardware, software and telecommunications companies. Different Android versions, released date and their name : Android version 1.0 ( Alpha ) released on September 23, 2008. Android version 1.1 ( Beta ) released on February 9, 2009. Android version 1.5 ( Cupcake ) released on April 27,2009. Android version 1.6 ( Donut ) released on September 15, 2009. Android version 2.0 released ( Eclair ) on October 29, 2009. Android version 2.1 released on January 12, 2010 . Android version 2.2 ( Froyo...