blog-post-1

How to start Android App Development [Basic Guideline]


In this article, I will describe how you will start Android app development. You can say that a basic guideline for android development. Unfortunately, I will not describe in details but I will tell you how easily you can start Android App Development. I will try to give you the best tutorial links where you can find the proper documentation and learning tools. Mostly, I will try to refer official android link (https://developer.android.com/develop/index.html). Let’s Start:

1.      Environment set up: At first you need an IDE and Android development kit which is SDK. There are several IDEs to develop android but you can use Eclipse and Android Studio. Unfortunately, developers will not encourage you to use Eclipse because Google declares their official IDE is Android Studio and they are working very hard to develop and update Android Studio. Now in 2017 Android Studio is much smarter than other IDEs. When you will download and install Android Studio then IDE will automatically include the Android SDK if you haven’t.

In this link, you will find how to download and Install Android Studio: https://developer.android.com/studio/index.html?gclid=Cj0KCQiAl8rQBRDrARIsAEW_To8mHHoVemRHFXJ0Pprn4cP9YvLMo8pbSBQmUQT3zOOYhTyJFsP2wBYaAhkxEALw_wcB

Here you will find the basic details of Android studio and project structure: https://developer.android.com/studio/intro/index.html

 

2.      Component of an Android Application: You have to know about the component of Android which are:

a.      Activity

b.     Service

c.      Broadcast receiver

d.     Content provider

Your task is to learn the basic concept of these. Like what is Activity and how it works? In this article, I will not tell you the description of these because description or details you will find on various a website about their details. Here is the link: https://www.tutorialspoint.com/android/android_application_components.htm


3.      Activity Lifecycle: Before you start or create an activity you have to know about the Activity lifecycle. Life cycle means the total life of an activity and how it starts and stops. In the whole life of Activity goes several states or cycles which are:

a.      On Create

b.     On Start

c.      On Resume

d.     On Pause

e.     On Restart

f.       On Stop

g.      On Destroy

Your task is to learn about the whole life cycles how an Activity start and when it goes to Resume and Pause state then gradually how activity destroyed. From here you will find the sweet description of the life cycle: https://developer.android.com/guide/components/activities/activity-lifecycle.html

After you learn about the life cycles then your task is to create an application where you will write all of the life cycles and show messages where the activity goes. If you will not able to do then see how I create ().then try yourself.

4.      Layout Design: Android followed MVC pattern by default so that design and code are separate. In res folder, there is another folder which is ‘layout’ where you have to create your design layout in XML form. There is various layout for Android which are:

a.      Linear Layout

b.     Relative layout

c.      Frame layout

d.     Table layout

e.     Contrains layout

Here (https://developer.android.com/guide/topics/ui/declaring-layout.html) you will find the description of various layouts.

After layout complete then there are various view widgets like TextView, EditText, Button, Spinner etc. you have to understand these widgets how to create there various listeners like: Click listeners, State change listener etc.

Here is some useful links: https://www.formget.com/android-views/


5.      Intent: An Android Intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service.

Here (https://developer.android.com/guide/components/intents-filters.html) you will find the whole description of Intent.


6.      Storage:  when you create an application one of the essential things is to store your application data. There are many ways to store the data according to your needs. If your data will application based and too small you can use shared preference and your data is big but want to store it locally then you can go for SQL Lite. There are five types of storage in android:

a.      Shared Preference

b.     SQL Lite

c.      Internal Storage

d.     External Storage

e.     Network connection

From here (https://developer.android.com/guide/topics/data/data-storage.html). When you learn one storage option then create an Application one by one.

7.      Fragment: Fragment is a dynamic UI of an activity. It has own life cycle also. Sometimes you need to create a dynamic UI under the tabs and list details concept. The fragment will increase the re-usability. Example: You need to create an application in Tab and Mobile so that you need to design separately. But using Fragment you can reuse your layout in tab and mobile also. You need to deep study and deep understanding to use Fragment. There are also Child and Parent concept in the fragment.

Here are the links you have to study deeply:

1.      https://developer.android.com/guide/components/fragments.html

2.      https://www.androidhive.info/tag/fragments/


8.      Service: Service is one kind of background activity which is not visible and work with activity life cycle. Sometimes you need to perform a task in the background when the application will close also then you can use Service. Service is a very sensitive thing so that you should use it smartly and optimized way. Otherwise, you will face several issues like Battery Drain, ANR and also crash your application. Here also you need to deep study and understanding, links are:

1.      https://developer.android.com/guide/components/services.html

2.      https://developer.android.com/training/run-background-service/create-service.html

3.      http://www.vogella.com/tutorials/AndroidServices/article.html


9.      Broadcast receiver: A broadcast receiver (receiver) is an Android component which allows you to register for system or application events. All registered receivers for an event are notified by the Android runtime once this event happens. Using this you can fetch the device activity like Call information, SMS information etc.

Tutorial links:

1.      https://developer.android.com/reference/android/content/BroadcastReceiver.html

2.      http://www.vogella.com/tutorials/AndroidBroadcastReceiver/article.html


10.  API call: Another kind of storage is network connection where the database is on the remote server. Using URL connection application will perform CRUD (Create, Read, Update and Delete) operation. To call API you can use several techniques like using Asynchronous request or using the library. There are two popular libraries to Call API which are Retrofit and Volley.

Retrofit: http://square.github.io/retrofit/

Volley: https://developer.android.com/training/volley/index.html



This article will not make you an Android Developer but you can find the proper guideline to start. So if you understand the basic concept then create your own applications and start developing.

Any question and queries you can send me an email. I will try my level best to respond. Here is my email: aliahmedaiub@gmail.com



Thank you

Happy Coding 😊