Android App Development
Android App Development
I sincerely thank Himanshu sir, our (DIO) co-ordinator for their guidance and
encouragement to do my Summer Training. He also help me by updating us about
the information of what to do and not to do during our Summer Training and help
us with all.I also thanks my friend for helping me with my problem that I face in
my project.
Certificate
Introduction
Android was initially developed by Android Inc., the code names of android ranges
from A to N.
Founded by Andy Rubin in Palo Alto,California, United States in Oct 2003.
Android word is actually reffered to as robot
Android was named after the nickname of Andy Rubin by their co-workers for his
love for robot.
Google acquired android Incorporation on 17th Aug,2005.
Android was developed by the Open Handset Alliance(OHA) for camera phone, led by
Google, and other companies.
But shifted to smart-phones due to low market of cameras at that time.
HTC launches the first android mobile.
In 2010,Google launched it’s Nexus series of devices in smart-phone world with
android OS.
We will start our Android application development on any of the following operating
systems:
Microsoft Window XP or later version , Mac OS X 10.5.8 or later version with Intel chip
Linux including GNU Library with Intel chip.
They are generally developed in the java language using the Android
SDK Android applications can be packaged easily and sold out either
through a store such as Google play,etc.
There are many android applications that we already know and uses them few
are music,news,weather,etc
Many android application are also available for free most of them are already
available in play store.
This apps are compatible with almost every platform but few are also available for the
specific platform..
CHAPTER 3:
OVERVIEW AND STARTING
WITH
ANDROID
3.1 Overview
Android applications are freely available and can be downloaded from the Web.
Following is the list of software's you will need before you start your Android
application programming.
This all software required in the installation of Android application.This setup is
required for the configuration with RAM less or more than 4gb:
Java JDK5 or JDK6
Download the latest version of Java JDK and install the JDK and set the
environmental path for it.
Android SDK
Download Android SDK from Android’s official website :
http://developer.android.com/sdk/index.html
If you install SDK either on Mac OS or Linux, follow the instruction and setup the
environment path.
Launch Android SDK Manager using option All Program>Android SDK Tools>SDK
Manager
Eclipse IDE for Java Developers
Check for the version that is compatible with your device and install it.
Or, Android Development Tools (ADT) Eclipse Plugin
This step will help you in setting Android Development Tool plugin for Eclipse.
Let's start with launching Eclipse and then, choose Help > Software Updates > Install
New Software
3.2 Android Virtual Device
To test our android application we will need a virtual Android device. Before start
writing our code we create an Android Virtual Device Android operating system is a
stack of software components which is roughly divided into five sections and four
main layers :
Application
You will find all the Android application at the top layer. You will write your
application to be installed on this layer only
Application Framework
The Application Framework layer provides many higher-level services to applications in
the form of Java classes.
Libraries
There is a set of libraries including open-source Web browser engine WebKit, well known
library libc, SQLite database,etc.
And , Android Runtime :
This is the third section of the architecture and available on the second layer from the
bottom. This section provides a key component called Dalvik Virtual Machine which is
a kind of Java Virtual Machine specially designed and optimized for Android
Linux Kernel
At the bottom of the layers is Linux,This provides basic system functionality like
process management, memory management, device management like camera, keypad,
display etc.
Following four main component that can be used within an Android application :
1) Activities :- They dictate the UI and handle the user interaction to the smartphone
screen public class MainActivity extends Activity
{ }
2) Services :- They handle background processing associated with an application
public class MyService extends Service
{ }
The first step is to create a simple Android Application using Android Studio.Follow
the option File -> New -> New Project ->Enter application name in the pop-up
window.Then select a Empty activity->next->Activity name->Finish.
1) WELCOME PAGE:-
This will be the first page which gets displayed when the user opens the app. This page will contain
the app name and/or app logo.
2) LOG IN PAGE:-
The login page is displayed after the welcome page. The user should be able to enter the mobile
number and password to login into the app. It should perform validations which checks for the length
of mobile number, password and also authenticates the login with the API
REGISTRATION PAGE:-
The page should contain the following fields namely:
Username Email Password and Comfrm password which users will input and register for the app. The
registration process will send the details to the server(Firebase).
If the registration process is successful the app should take the user to the home page which is the page
listing all the newsapps.
Firebase
Firebase is a platform developed by Google for creating mobile and web applications. It was originally
an independent company founded in 2011. In 2014, Google acquired the platform and it is now their
flagship offering for app development
Firebase helps you build and run successful apps · Products and solutions you can rely on through
your app's journey ·
Firebase is a mobile platform that helps you quickly develop high-quality apps, grow your user
base, and earn more money. Firebase is made up of complementary features that you can mix-and-
match to fit your needs, with Google Analytics for Firebase at the core
Connect to Firebase
Firebase is a mobile platform that helps you quickly develop high-quality apps, grow
your user base, and earn more money. Firebase is made up of complementary features
that you can mix-and-match to fit your needs, with Google Analytics for Firebase at the
core. You can explore and integrate Firebase services in your app directly from Android
Studio using the Assistant window
First make sure you have installed Google Repository version 26 or higher, using the
following steps:
1. Click Tools > SDK Manager.
4. Click OK to install.
2. Click to expand one of the listed features (for example, Analytics), then click
the Get Started tutorial to connect to Firebase and add the necessary code to your app.
Add Firebase using the Firebase console
Step 1: Create a Firebase project
Before you can add Firebase to your Android app, you need to create a Firebase project to
connect to your Android app. Visit Understand Firebase Projects to learn more about
Firebase projects.
Create a Firebase project
Step 2: Register your app with Firebase
To use Firebase in your Android app, you need to register your app with your Firebase
project. Registering your app is often called "adding" your app to your project.
1. Go to the Firebase console
a) In your root-level (project-level) Gradle file (build.gradle), add rules to include the
Google Services Gradle plugin. Check that you have Google's Maven repository, as
well.
b) In your module (app-level) Gradle file (usually app/build.gradle), apply the
Google Services Gradle plugin:
2. Sync your app to ensure that all dependencies have the necessary versions.
Choose Mode of News
Choose Mode of News will be the homepage of the app, meaning when the app is
launched and the user has already once logged into the app then the
user will see the ‘Offline & Online’.
a) OFFLINE
b) ONLINE
OFFLINE NEWS :-
If The User Choose offline Mode of News.
In the app bar it will show the hamburger , setting & home button option.
NAVIGATION DRAWER:-
The navigation drawer is needed so that the user can navigate to different pages inside
the app. The user should be able to access the navigation drawer on all the app screens
by clicking the hamburger button on the left side of the toolbar or by swiping right from
the left edge. It will have a header section at the top which contains the app logo and
below it should be the name of the Company .
Second Choose Mode of news :- ONLINE NEWS
it Fetch the data From API :- "https://newsapi.org/v2/"
Now the user when click on the online mode of News ...
Before going to project that I made we need to know some basic concept of Android
for better understanding.
Since every project that we do in android studio must contain this files:-
.java file
.xml file
AndroidMenifest
file
4.1 .javaFile :
This file include all the codes and logic written in it.
We can open it in the android project -> app -> java -
> com.example.username.filename -> MainActivity.java
When we run our program methods that are called :
- onCreate(Bundle) :- It is used to initialize our activity.
-setContentView(int) :- It is a layout resource defining our User
Interface.
-findViewById(int) :- It is used to retrieve widgets in the that UI that
we need to interact.
-onPause() :- Where we deal with the user leaving activity.
4.2 .xmlFile :
It is used to define the actual User Interface of our application.
We can open the .xml from app -> res ->layout -> ActivityName.xml
We can find all the elements or the tools that we want to use in our project.
It has two different layout i.e; a coding layout where we can code for our required
elements needed like buttons, text views,etc.
Or, we can directly drag and drop the required elements in the given design layout.
The Android framework gives us the flexibility to use either or both
of these methods for declaring and managing our apps UI.
4.4ANDROID UI WIDGETS :
A widget is a simple application extension that is often part of a
larger application that are already inbuilt.
It comes in all shapes and sizes, and are customizable and are
available for quick access.
4.6 Camera :
We can directly integrate the camera into your application via the Camera API.
Using the camera on the Android device can be done via integration of the
existing Camera application. In this case you would start the existing Camera
application via an Intent and to get the data after the user returns to our
application.
4.7 Permission given:
In the manifest file we give the following permission to the application to access
the hardware component i.e; camera :
<uses-feature
android:name="android.hardware.Camera"/
>
<uses-permission android:name="android.permission.CAMERA" />
After giving permission to the app we also have to give the special permission to
the app through our device to the location ,
Setting -> apps -> open app -> permission -> camera allow -> close setting
CONCLUSI
ON