ViewPager with TabLayout Android Studio

viewpager with custom tab

In this article we will learn how to create ViewPager with TabLayout Android Studio. We use ViewPager to create a view the works as Image Slider. In this tutorial I will use the ViewPager2 Class and accordingly I will use the RecyclerView Adapter Class. Lets create a new android studio project with Java language. First, we need to add the required dependences as following in the Gradle file, in module Gradle file. Note, that I am using the Java version of 1.8 and ViewBinding. Then, Open theme file in the…

Read More

How to Create SearchView in Android Studio

How to Create SearchView in Android Studio

In this article we will learn how to create SearchView in android studio. SearchView is a widget that enables the user to enter search query and then send the request to the search provider. After that it shows a list of suggestion or results. Copy the following xml code in main activity xml file. After that add the following code to the main activity java file. Now, run the app. You will find the result as the following image. Then open logCat in the bottom bar of android studio. In…

Read More

Setting ImageView in Android Studio

Setting ImageView in Android Studio

In this article talks about setting ImageView in android studio. ImageView is a View for displaying and manipulating image resources, such as Drawables and Bitmaps. See the following example to implement ImageView to switch between images I have saved in the drawable folder . Then, in the main activity past the following code. Not you need to save three image files in the drawable folder and make sure the files names are with lowercase letters, no numbers or spaces. The layout should be like this Now run the app and…

Read More

TextInput Layout in Android Studio

TextInput Layout in Android Studio

In this article we will how to work with TextInput Layout in android studio. We need to use TextInput Layout to display the floating label on EditText. Furthermore TextInputLayout wraps an EditText in order to display the floating label. Moreover, it supports showing the error and error icon. The TextInput Layout uses TextInputEditText as a child layout. Using TextInputEditText instead of an EditText provides accessibility support for the text field and allows TextInputLayout greater control over the visual aspects of the text field. An example usage is as so: TextInput…

Read More

Custom ListView in Android Studio

Custom ListView in Android Studio

In this article we will learn how to work with Custom ListView in android studio. ListView is a viewgroup which groups several items from a data source like array or database and displays them in a scroll-able list. Moreover, ListView uses the Adapter to bind the data. In order to create a ListView widget we need to add it in the xml file as following. ListView with Custom ArrayAdapter By default the ArrayAdapter class creates a view for each array item by calling toString() on each item and placing the…

Read More

AutoComplete TextView Android Studio

AutoComplete TextView Android Studio

In this article we will learn how to create AutoComplete TextView in android studio. Furthermore, autocomplete textview is used when we need to show a list of text like name, cities when the user type the first letters in the text. AutoComplete TextView is a UI widget. So that, when we need to create it we need to add it in the xml layout file as following: The AutoComplete TextView uses a list in order that we need to create adapter for this list. The adapter requires another XML layout…

Read More

Working with EditText in Android Studio

Working with EditText in Android Studio

In this article we will learn the working with EditText in android studio. The EditText is the standard text entry widget in Android apps. Moreover, If the user needs to enter text into an app, this is the primary way for them to do that. We can customize the behavior of an EditText by using several attributes as following. In order to get the text value in EditText we can use the following method. Furtheromer, We might want to limit the entry to a single-line of text (avoid newlines): Also,…

Read More

Customize TextView in Android Studio

Customize TextView in Android Studio

In this article we will learn how to customize TextView in android studio. TextView is a user interface widget that display and set text to the user. In order to create text view use the following example of TextView widget. Moreover, you can use the xml layout attributes to customize the TextView. Also, there is another way to customize TextView which is Spannable Text View. Through the next part of this article we learn how to use it. Moreover, when we want to use the text view in the java…

Read More

Button Click Listener in Android Studio

Button and Button Click listener

In this article we will learn how to create Button also how to create Button Click Listener in android studio. Buttons are the most used widgets in any android app. In other words the Click Listener interface also. In order to create Button we to add its widget in the XML file as following. Note that the attribute onClick, that specifies the action the will be done when the user click the button. This attribute take the name of the method in the linked java file. as following. Using the…

Read More

Layout Params in Android Studio

Layout Params in android studio

In this article we will talk about Layout Params in android studio. But first we need to know what is the layouts in android. A layout defines the visual structure for a user interface, such as an activity or widget. Moreover, we need to declare layouts in XML, including screen elements that will appear in it. Futhermore,we can add the code to the application to modify the state of screen objects at runtime, including those declared in XML. Layout Params Every single ViewGroup (e.g. LinearLayout, etc.) needs to store information…

Read More

XML layout Files in Android Studio

XML layout in android studio

Through the previous article we learned the activities and fragments in android studio. In both activities and fragment we used two types of files. The first is for designing the UI which is XML layout file, and the other is for writing the excitable java code. So, in this article it is important to know what is XML files and the language it works with. What is XML? XML stands for Extensible Markup Language. The World Wide Web organization created it to construct a syntax in the way that the…

Read More

Fragments in Android Studio

fragments in android studio

Through the previous articles we learned what are activities in android studio, what are intents and also activities life cycle. In this article we will learn learn what are fragments. Fragments are another part of the android app that represents a reusable portion of your app UI. A Fragment can determines and maintains it’s own layout and life cycle. Moreover, it can manage it’s own life cycle. One important note is that fragments can not exist on their own. Moreover, we must host the fragments by an activity or another…

Read More

Activity Lifecycle in Android Studio

Activity Lifecycle in Android Studio

In the previous articles we learned the activities in android studio. Also, we mentioned that the android app experience differs from its desktop one. This difference in that the android app doesn’t always begin in the same place. Moreover there is no a determined start for the android app. For that, in this article you will learn the concept of activity lifecycle in android studio. As a user navigates through, out of, and back to your app, instances of an activity in your app changes through different states in their…

Read More

Intent and Intent Filters in Android Studio

Intent and Intent Filters

In this article you will learn all about Intent and Intent Filters in android studio. An Intent is the way to request an action from another app component in form of messaging object. For example, when you want to start activity, send message or share image. The ways that intent communicate with app components. There are several ways where the intent communicate with app components. 1- Starting Activities In order to start activity in android you need to pass an intent to the method startActivity(). This intent should describe the…

Read More

Activities in Android Studio

activities android studio

In the previous articles of our android studio tutorials for beginners we learned how to create an android studio project. By default android studio create packages and files from which is the Main Activity java file. Surely, an activity class is a crucial component of any android app. So, this article is important as we introduce activities in android studio. What is Activity class?, an activity represents the window in which the app draws it UI. The mobile app differs from desktop app in that a user’s interaction with the…

Read More

Setup Android Emulator in Android Studio

Android Emulator

In this article you will learn how to setup Android Emulator in Android Studio after first installation of android studio. Android emulator is a simulation of android device on your computer. Moreover, it provides almost all the capabilities of a real android device. Further more, the emulator comes with predefined configurations for various Android phone, tablet, Wear OS, and Android TV devices. Android Emulator Requirements and recommendations In addition to android studio system requirements, android emulator has the following requirements. SDK Tools 26.1.1 or higher. 64-bit processor. Windows: CPU with UG…

Read More

Android Studio User Interface and Project Structure

Android Studio User Interface and Project Structure

In this article You will be familiar with the android studio user interface and the android project structure. Android Studio is the official Integrated Development Interface (IDE) and id dependent on IntelliJ IDEA. Moreover it provides developers with more features that enhance your productivity when building Android apps. Features like a flexible Gradle based build system, fast and feature-rich emulator, apply Changes to push code and resource changes to your running app without restarting your app, code templates and GitHub integration to help you build common app features and import…

Read More

Create An Android Studio Project

create new androidproject

Welcome to the first practical android tutorial for beginners. In this article you will learn how to create your first android studio project after Installing Android Studio. In order to create a new android studio project, open android studio. Then, you will see “welcome to android studio” window as following. Next, click on “Create New Project”, a new window will appear. This window contains templates for android studio projects. Such as, Navigation Drawer Template, Google Maps and Simple Login one. We will study these templates later. But for now we…

Read More

Installing Android studio and System Requirements

android studio for beginners

Android Studio is the official integrated development environment (IDE) for Google’s Android operating system. Moreover, it is developed on IntelliJ IDEA software and specifically designed for Android creation. Also, It can be downloaded from Windows, macOS and Linux operating systems. Further more, this is a replacement for the Eclipse Android Development Tools (E-ADT), the main IDE for the development of native Android applications. Features Gradle-based build support Android-specific refactoring and quick fixes Lint tools to catch performance, usability, version compatibility and other problems Template-based wizards to create common Android designs and components A rich layout editor that allows users to drag-and-drop UI components, option to preview layouts on multiple…

Read More

Android Studio Introduction 2020

android tutorials for beginners

In this article, we will give a brief Android Studio Introduction 2020. Also, present the history of the Android operating system. We will also cover features, frameworks and the platform used to build android apps. Furthermore, we’ll describe Android versions, Android architecture components, Android Runtime and Android application components. Android Studio Introduction, What is Android? Android is an open source operating system built on the Linux kernel and developed specifically for cell phones. We can also use android in smartphones, smartwatches, TVs and vehicles. Therefore, the Android platform allows developers…

Read More