Category Archives: Create Android App

Learn Android Programming – For Beginners To Pro

Android is the most popular open source operating system for mobile devices like Smartphone and Tablet. This OS is based on Linux kernel which is currently developed by Google. At Google I/O 2014, it was revealed that more than one billion per month people actively uses Android. As of July 2015, Statista revealed Google play is the largest mobile App store which has over 1.6 million Apps and billions of application gets downloaded every year. Android programming is based on Java programming language so if you have basic understanding on Java programming then it will be a fun to learn Android application development.


Prerequisite For Android Programming:

Before you begin Android programming below are the prerequisite needed:

JAVA:

Android programming is mostly done in JAVA language. So before you begin Android programming you must be comfortable with JAVA and OOPS concepts. If you are new to Android we recommend you to check out our JAVA for Android developer section where we have shared in-depth tutorial on JAVA.

XML:

Once you are done with JAVA the next thing you need is basic knowledge of XML for designing UI of Android App. Even though Android Studio has drag and drop for designing UI but still you will need to learn XML if you want your UI is highly user interactive. You can check out Design Android User Interface section to learn it.


Android Programming Tutorials:

Below are the list of Android programming topics. Follow the link to read full tutorial:

Topics (Follow the link to read tutorial) Description
Activity Lifecycle Learn about Android Activity lifecycle like created, started, resumed, paused, stopped or destroyed.
Intent Learn how Intent is used for communicating between the components of an Application and from one app to another
Shared Preference Learn how primitive data is saved on Android device based on key-value pair
JSON Parsing JSON stands for JavaScript Object Notation. It is structured, light weight, human readable and easy to parse. It’s a best alternative to XML when our android app needs to interchange data from server.
Toast & Custom Toast In Android, Toast is used to display information for a period of time. It contains a message to be displayed quickly and disappears after specified period of time.
Internal Storage In this tutorial we are going to learn about internal storage of data/files in Android App using example or you can say the primary memory of your phone.
External Storage In this tutorial we gonna study about storage of data/files in android external storage or you can say the secondary memory/SD card of your phone.
Sqlite SQLite is a Structure query base database, open source, light weight, no network access and standalone database. Android has built in SQLite database implementation.
AsyncTask In Android, AsyncTask (Asynchronous Task) allows us to run the instruction in the background and then synchronize again with our main thread.
Splash Screen Splash Screen is most commonly the first startup screen which appears when App is opened.
Volley Volley is a HTTP library developed by Google and was first introduced during Google I/O 2013. This library is used to transmit data over the network.
Retrofit Retrofit is a simple network library that used for network transactions. By using this library we can seamlessly capture JSON response from web service/web API.

 Android Material Design Tutorials With Examples

Android UI, Layout & Material Design Tutorial, With Examples

Creating an Android Virtual Device (AVD) in Android Studio

Android UI, Layout & Material Design Tutorial, With Examples

hhh

All user interface elements in an Android app are built using View and ViewGroup objects. A View is an object that draws something on the screen that the user can interact with. A ViewGroup is an object that holds other View (and ViewGroup ) objects in order to define the layout of the interface. Android UI designing can be done either in XML or programmatically in application. But the Android UI designer mostly prefer XML for defining UI because it separate the presentation from the code and makes easier to visualize, manage, edit and debug the App.

Here our in depth tutorial will teach you Android UI designing step by step starting with XML basic, layout, widgets and attributes with examples. Following it you will learn different UI Design techniques, patterns & principles and finally we will show you lots of examples where we will discuss designing of different Apps from scratch to finish.

 


Prerequisites For Designing Android User Interface:

Android Studio And SDK:

Android Studio is the official IDE for developing Android App created by Google. It has a very simple layout editor which support drag and drop for designing UI where one can drag layout, widgets, text fields etc. and drop it on the Virtual mobile screen to design Android UI. It also has the properties option where one can easily fill attribute like color, text etc to give attractive and pretty look to UI. The Studio also has Text option where one can see the XML code of the UI and edit it.

If you are new to it then check our Android Studio guide


Android Designing Tutorial:

New to Android UI? Begin from here.

Basics of XML In Android

Layout in Android:

Layout – Layout are used to define the actual User interface of application. It holds all the elements (i.e. views) or the tools that we want to use in application. For example, ImageView, Button,TextView and other UI elements.

Types Of Layout And Few Important ViewGroup In Android

  1. Linear Layout
  2. Relative Layout
  3. Table Layout
  4. FrameLayout
  5. Absolute Layout
  6. ConstraintLayout

  7. WebView

  8. ListView
  9. GridView
  10. Recycler View

Also Read: Nested Layout in Android

Adapter In Android:

Adapter – Adapter acts as a bridge between UI component and data source that helps us to fill data in UI component. It holds the data and send the data to an Adapter view then view can takes the data from the adapter view and shows the data on different views like as ListView, GridView, Spinner etc.

Different types of Adapter in Android:

  1. BaseAdapter
  2. SimpleAdapter
  3. Custom SimpleAdapter
  4. ArrayAdapter

Important Android UI Tutorials

List of all  Android UI tutorials

Also Read:

1. UI for Multiple Screens.

2. Responsive UI with ConstraintLayout.

3. Adding App Bar.

4. Showing pop up messages.

5. Creating custom layout.

6. Creating Backward-Compatible User Interface.

7. Implementing Accessibility.

8. Managing the System User Interface.

9. Creating Apps with Material Design.

 
Topics (Follow the link to read tutorial) Description
ListView It helps in displaying the data in the form of a scrollable list.
GridView It display items in two dimensional scrolling grid (rows and columns), the grid items are not necessarily predetermined but they are automatically inserted to the layout using a ListAdapter.
ScrollView And Horizontal ScrollView It is used to scroll the items in vertical direction and Horizontal ScrollView scroll the items in horizontal direction
Spinner Spinner provides a quick way to select one value from a set of values. Android spinners are nothing but the drop down-list seen in other programming languages.
Custom Spinner When we want to display a spinner item with image, text etc
TextView It display text to the user
EditText It provide an input or text field where user can enter something like his name details, phone number etc
Button It is a push button which can be clicked, or pressed by the user to perform an action
ImageView It is used to display an image file in application
ImageButton It is used to display a normal button with a custom image in a button
CheckBox It is a type of two state button either unchecked or checked in Android.
Switch It is off/on button which indicate the current state of Switch. It is commonly used in selecting on/off in Sound, Bluetooth, WiFi etc.
RadioButton And RadioGroup In Android, RadioButton are mainly used together in a RadioGroup. In RadioGroup checking the one radiobutton out of several radio button added in it will automatically unchecked all the others.
RatingBar It is used to get the rating from the app user.
WebView It is a view which is used to display the web pages in application.
AutoCompleteTextView It is a view i.e similar to EditText, except that it displays a list of completion suggestions automatically while the user is typing.
MultiAutoCompleteTextView MultiAutoCompleteTextView is similar to AutoCompleteTextView except that it can hold multiple string words value at single time
ProgressBar It is used to display the status of work being done like analyzing status of work or downloading a file etc.
Timepicker It is a widget used for selecting the time of the day in either AM/PM mode or 24 hours mode
DatePicker It is a widget used to select a date by day, month and year
Calendar View It is used for displaying Calendar and selecting dates
AnalogClock, DigitalClock And TextClock AnalogClock is a two handed clock one for hour indicator and the other for minute indicator and DigitalClock & TextClock both looks like your normal digital watch on hand which displays the hours minutes and seconds in digital format
SeekBar It is an extension of ProgressBar that adds a draggable thumb, a user can touch the thumb and drag left or right to set the value for current progress
ExpandableListView It is a View that shows items in a vertically scrolling two level list
Chronometer It implements a simple timer
ZoomControls It display simple set of controls that is used for zooming and provides callback to register for events
CheckedTextView It is an extension of normal TextView that supports the checkable interface and displays it
VideoView It is used to display a video file
TabHost It is a Container for tabbed window view. Whenever we need to enter or display a lot of information in one activity. A simple and effective method is to use tabs in your interface form which is done using TabHost in Android.
SearchView It provide search user interface where users can enter a search query and then submit a request to search provider
SlidingDrawer It is used to hide the content out of the screen and allows the user to drag a handle to bring the content on screen
TextSwitcher It is used to animate a label(i.e. text) on screen
ViewSwitcher It is used for switching between views which can hold only two child views for switching
ViewFlipper ViewSwitcher can hold only two child views but ViewFlipper can holds two or more child views and show one at a time
ViewStub It is a zero sized invisible View that can be used to lazily inflate layout resource at runtime
Gallery It is a view used to show items in a center locked, horizontally scrolling list and user will select a view and then user selected view will be shown in the center of the Horizontal list
CountDownTimer CountDownTimer in Android is used to set a countdown based on interval set by you and it will stop when the time has come in future.
Alert Dialog Alert Dialog in an android UI prompts a small window to make decision on mobile screen. Sometimes before making a decision it is required to give an alert to the user without moving to next activity.
ProgressDialog Android Progress Dialog is a UI which shows the progress of a task like you want user to wait until the previous lined up task is completed and for that purpose you can use progress dialog.
HTML in Android In Android, many times while designing an application we might be in a situation where we would like to use HTML content and display in our App screen. It may be to display some static content like help, support, FAQ and others pages.

Creating an Android Virtual Device (AVD) in Android Studio

An Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android phone, tablet, Android Wear, or Android TV device that you want to simulate in the Android Emulator. Before debugging and testing android application, you should create an android virtual device ( AVD ) to start a simulator. You can specify special configurations for your avd, and then start it for debugging and executing applications.

To create a new AVD, do one of the following:

  • Select Tools > Android > AVD Manager.
  • Click AVD Manager AVD Manager icon in the toolbar.

Both will Open the AVD Manager shown in figure below:

1

OR

2

Android Virtual Device Manager will be opened. After that Click on Create Virtual Device.

3

Now choose the Category, phone size and choose the pixels according to your requirement. After this click on Next button.

4

After that choose the SDK Version and Click on Next button. If you have various SDK Versions like Kitkat, Lolipop ,Marshmallow,Nougat and Oreo etc in your SDK then you can select one of them. Here we choose Nougat SDK Version. Click on the next.

5

After that Enter the AVD Name in Android Virtual Device and Click on Finish button. Here you can do customization to AVD which you are creating as per your requirement.

Click Finish and new AVD is created. To start it, click the green triangle button in AVD list Actions column. To edit it’s settings, click the green pencil button.

6

AVD will start in Emulator. Now you can run your App in this AVD.

emulator2

I hope you find this blog post very helpful while creating AVD in Android Studio. Let me know in a comment if you have any questions regarding Android Studio. I will reply you ASAP.

 

 

 

 

Add/Create New Java Class in Android Studio

What is Java Class ?

A class is nothing but a blueprint or a template for creating different objects which defines its properties and behaviors. Java class objects exhibit the properties and behaviors defined by its class. A class can contain fields and methods to describe the behavior of an object.

Android Studio helps you to quickly create the following new classes and types:

  • Java classes
  • Enumeration and singleton classes
  • Interface and annotation types

Step 1:  Firstly, Select app > Java > package > Right Click on package. After that Click on New > Java Class.

1

Step 2: After that Enter Class name and Click on OK. Here we create Class Bird as shown in figure below. Remember to choose your package in which you want to create new class. There are many options available fill as your requirement.

2

New Java Class will be created in your Android project.

3

 

I hope you find this blog post very helpful while creating Android Project in Android Studio. Let me know in a comment if you have any questions regarding Android Studio. I will reply you ASAP.

Create/Start New Project In Android Studio

Objective:

The main objective of this tutorial is how to create a new project in Android Studio. And this tutorial is for those who are new to Android Studio.

To create a new project perform the following steps:

Step 1: Start and configure the project:

Firstly, open the Android Studio. You will see “Welcome to Android Studio” on your computer screen. After that you click on “Start a new Android Studio project”.

ff

If you do have a project opened, click File > New > New Project.

aa

After that you will see “Create Android Project” on your computer screen. Here enter the “Application name” , the “Company Domain” ( Company domain is used to uniquely identify the App. So two App with same Application name will have different company domain. e.g. I used here “sanikamal.ruatech.com”)and the project location in the text box and then Click Next button. If you want to use C++ and/or Kotlin code in your project, check the corresponding checkboxes to set up your project accordingly. You can always add C++ code and add Kotlin code later.

ffg

Step 2: Select form factors and API level:

After that you will see “Target Android Devices” on your computer screen and select the form factors your app will be run on. Select “Phone and Tablet” field and enter the “Minimum SDK” in the text box and then Click Next button. When you select Minimum SDK, Android studio will give you some active android devices percentage that will support your android application. Otherwise, you can also click on “Help me choose” button for more information about android platform versions.

ggg

Step 3: Add an activity:

This screen suggests you “Add an Activity to Mobile” first. If you don’t want to add any activity at starting, you can select Add no activity option. We selected Empty Activity.

If you have selected Phone and Tablet in option in the last screen then it will display the only phone related suggestions.

For example, select Google Maps Activity for google map project, Login Activity for User Login project etc.

bbbbb

Step 4: Configure your activity:

Here, you can customize your selected activity. You can change your Activity name from here. Enter the “Activity Name” in the text box and enter the “Layout Name” in the text box and then Click Finish button.

Activity Name Name of JAVA file for programming

Layout Name Name of XML file for designing UI

swsw

Android Studio now sets up your project and opens the IDE.

fgggjh

I hope you find this blog post very helpful while creating Android Project in Android Studio. Let me know in a comment if you have any questions regarding Android Studio. I will reply you ASAP.