Top Banner
42
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Learn android app_development(1)_intro
Page 2: Learn android app_development(1)_intro

ADEL AL-JAFFAN

ENAS AL-SAEEK

Android Training Workshop 2014

Page 3: Learn android app_development(1)_intro

What is Android ?

Page 4: Learn android app_development(1)_intro

What is Android?

Android is a “ open source ” software and

Google releases the code under the Apache

License. Android is a based on Linux the

operating system with a worldwide Smartphone during

the third quarter of 2013 with there were 11,869 different

models of Android device...

From entertainment and games, to organization and work based

solutions, there is a need for huge number of developers who

provide them. As per estimation this numbers is close to a few

millions.

Page 5: Learn android app_development(1)_intro

Why Android?

There's no other software quite like Android.

Google engineered Android, and Google’s own apps run best on it.

And with millions of apps, games, songs, and videos on Google Play,

Android is great for fun, and for getting things done.

Android devices come in all kinds of sizes, with all sorts of features,

and at all sorts of prices. Each version of Android is named after a dessert,

and the most recent version of Android is ”KitKAT “

With Android, you’re in control of your mobile experience .

Page 6: Learn android app_development(1)_intro

ANDROID

• Adel Al-jaffan 4th year

• Network engineering

• F.I.T.E

• Syria - Damascus University

ANDROID HISTORY

Page 7: Learn android app_development(1)_intro

Android Versions ?

Page 8: Learn android app_development(1)_intro

Android Versions ?

Alpha (1.0)

Beta (1.1)

Cupcake (1.5)

Donut (1.6)

Eclair (2.0–2.1)

Froyo (2.2–2.2.3)

Gingerbread (2.3–2.3.7)

Honeycomb (3.0–3.2.6)

Ice Cream Sandwich (4.0–4.0.4)

Jelly Bean (4.1–4.3.1)

KitKat (4.4–4.4.4)

"L" release (developer preview)

Page 9: Learn android app_development(1)_intro

Android is a Mobile Powerhouse

Page 10: Learn android app_development(1)_intro

Android Technology Advantage

Android is for Free Open Source

Job Opportunities are more in Android compare to other technologies.

Demand is more and supply is less.

Android is a Google technology

Large number of applications.

Writing the applications in Android is very easy as it is based on JAVA

Open for customization – Manufacturing

Developers can earn money by uploading your Android-App into market.

Application Store (Google Play , 1market , ……).

Runs on more than millions of devices worldwide.

Page 11: Learn android app_development(1)_intro
Page 12: Learn android app_development(1)_intro

Android learning References

developer.android.com

www.androidHive.com

“ Wrox ” , “ PRESS ” & “ for Dummies” Books Series .

“ LYNDA “ & “ The New Boston ” Video Series .

More , more ………

Page 13: Learn android app_development(1)_intro

Android learning References

Page 14: Learn android app_development(1)_intro

Android learning References

Page 15: Learn android app_development(1)_intro

Android learning References

Page 16: Learn android app_development(1)_intro
Page 17: Learn android app_development(1)_intro

Requirements

1) JAVA Development Kit “JDK”

2) Android Developer Tools “ADT” Bundle

OR Android Studio

3) PC with good speed :D or s/w deivces

Page 18: Learn android app_development(1)_intro

First touch

Page 19: Learn android app_development(1)_intro
Page 20: Learn android app_development(1)_intro

First project

1) Create Android project .

2) Create Specific Emulator

3) Fire your hands :D

Page 21: Learn android app_development(1)_intro
Page 22: Learn android app_development(1)_intro
Page 23: Learn android app_development(1)_intro
Page 24: Learn android app_development(1)_intro
Page 25: Learn android app_development(1)_intro
Page 26: Learn android app_development(1)_intro

Source code :

Activity.Xml :

Page 27: Learn android app_development(1)_intro

Make your first Emulator :

Window Android Virtual Device Manager

- customize your app with your smartphone !

- WAIT & RUN !!!

Page 28: Learn android app_development(1)_intro

Make your first Emulator

Page 29: Learn android app_development(1)_intro

Buttons : ( activity_main.xml )

[ properties ]

id = "button1"

text = "Button"

layout_marginRight = "107dp"

layout_marginTop = "160dp"

width = "450dp"

height = "320dp"

Components :

Page 30: Learn android app_development(1)_intro

Components : Buttons : (Events)

1- Create “Button” Variable and

Initialize It “pointed to specific button on layout ”

2- use it !

in 2 ways !!!!

A)

OnClickListener :

{

a- setOnClickListener (override View class)

}

Page 31: Learn android app_development(1)_intro

Components : Buttons : (Events)

OnClickListener

Page 32: Learn android app_development(1)_intro

final Button button = (Button) findViewById (R.id.button1);

button.setOnClickListener ( new View.OnClickListener( ) {

public void onClick(View v) {

// Perform action on click

}

});

Components :

Page 33: Learn android app_development(1)_intro

Components : 1 Buttons : ( not with OnClickListener )

2nd way :

< Button android : id="@+id/btn"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text= "Click here"

android:textSize= "30dip"

android:onClick = "MyClickMethod“

/>

Page 34: Learn android app_development(1)_intro

Components : 2 Buttons : ( not with OnClickListener )

2nd way :

Page 35: Learn android app_development(1)_intro

Toast : toast provides simple feedback about an

operation in a small popup. It only fills the amount

of space required for the message and the

current activity remains visible and interactive.

For example, navigating away from an email

before you send it triggers a "Draft saved" toast to

let you know that you can continue editing later.

Toasts automatically disappear after a timeout.

Page 36: Learn android app_development(1)_intro

Toast :Toast provides simple feedback about an

operation in a small popup.

Toasts automatically disappear after a

timeout.

Page 37: Learn android app_development(1)_intro

Toast :

int duration = Toast.LENGTH_SHORT ;

String text = “ hi hi ” ;

Toast toast = Toast.makeText( this, text , duration ) ;

toast.show();

Page 38: Learn android app_development(1)_intro

final Button button = (Button) findViewById (R.id.button1);

button.setOnClickListener ( new View.OnClickListener( ) {

public void onClick(View v) {

Toast toast ;

toast = Toast.makeText( MainActivity.this, "text",Toast.LENGTH_LONG);

toast.show();

}

} ) ;

Components :

Page 39: Learn android app_development(1)_intro

Toast :

What about customization Toat ?

- Making colorful text ?

- Changing position of toast ?

- ……. Etc ?

Page 40: Learn android app_development(1)_intro

Components : 3 , 4

textview : like label in c#

Edittext : like TextBox in c#

Page 41: Learn android app_development(1)_intro

Simple Calculator App :

A lot of Steps ! :D

Page 42: Learn android app_development(1)_intro