Basic Android

Preview:

DESCRIPTION

Android Is the best technology for live project training. Android can change your career . Take the best Android Training Ahmedabad, you can change your career. www.LiveProjectTraining.in

Citation preview

Chapter 1 Basic Android

Prepared By,NicheTech

© NicheTech Com. Sol. Pvt. Ltd.http://www.nichetechsolutions.com/

Various Files and Folder SRC :- Folder contain the .java extension files that means you can write you application code inside this file.

GOOGLE API 4.0:- Contain the file named android.jar

which contains all class library needed for running the android application.

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti… GEN:- Contains the R.java file, a compiler-generated file

that references all the resources found in your project.

Assets:- contains all the assets used by yourapplication, such as HTML, text files, databases,

etc

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti… res :- This folder contains all the resources used in your application.

This is the manifest file for your Android application.

Here you specify the permissions needed by your application, as well as other features (such as

intent- filters, receivers, etc.).Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti… MAIN.XML:-

The @string in this case refers to the strings.xml file located in the res/values folder. Hence, @string/hello refers to the hello string defined in the strings.xml file, which is “FirstBasicAndroid, MainActivity!”:

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti… R.JAVA

R.JAVA File using eclipse automatically generate the content, you are not suppose to modify the content of R.JAVA file

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti…

The Activity base class defines a series of events that

governs the life cycle of an activity. The Activityclass defines the following events: ( Check out

the next slides).

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti… ➤ onCreate() — Called when the activity is first created ➤ onStart() — Called when the activity becomes visible to the

user➤onResume() — Called when the activity starts interacting with the user

➤ onPause() — Called when the current activity is being paused and the previous activity isbeing resumed➤onStop() — Called when the activity is no longer visible to the user➤onDestroy() — Called before the activity is destroyed by the system (either manually or bythe system to conserve memory)➤onRestart() — Called when the activity has been stopped and is restarting again

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Apply Style & Theme In android site, user or web developer can also apply the designing .

if you apply the above designing theme then, your activity

will appear as dialog box.

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Hide the activity title If you are interested to hide the title of activity if required

WHAT YOU SUPPOSE TO DO?

import the library “ import android.view.window”;

As well as “ import android.util.Log;”

Use the requestWindowFeature() method and pass it the

Window.FEATURE_NO_TITLE constant, like this:

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti…

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Your Activity title is hide now !

Displaying a Dialog Window Write the code inside the main yourprojectname.java file

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti…

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti..

Out Put

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Conti…

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd

Thank You NicheTech Computer Solutions

http://www.liveprojecttraining.in/

Prepared By, NicheTech (C) NicheTech Com. Sol. Pvt. Ltd