02-android app fundamental - asha

Upload: ashajyothim4

Post on 03-Jun-2018

254 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 02-Android App Fundamental - ASHA

    1/22

    1st Video:

    Android Architecture:

    Ippudu, Manam Android platform overview telukuntam.

    Linux 2.6 ni use chesukuni android run avthundhi.

    Android platform Dalvik ane virtual machine ni use chesukuntundhi. Ee Dalvik virual machine particular ga

    mobile devices kosam optimise cheyabadindhi.

    Android platform open source webkit engineni base chesukuni Integrated browser ni kaligi untundhi.

    Android platform ki openGLversion aena openGLES untundhi. Dhinni 2D and 3D graphics highperformance kosam use chestaru.

    Android platform SQLite Database ni structured data storage ki use chesukuntundhi.

    Recent Android Versions:

    Android chala fast ga progress avthunna Operating System. Indhulo chala versions unnai. E tutorial ni

    develop chestunappudu below android version unnai.

    Android 2.0/2.1 (Eclair)

    Android 2.2 Froyo

    Android 2.3 GingerbreadAndroid 3.0 Honeycomb (tablet devices lo use chesaru)

    Android Ice cream Sand witch( combination of Gingerbread & Honeycomb).

    Ee tutorial lo Android 2.3 Gingerbread ni use chesi android apps ni develop chesaru.

    Application Fundamentals:

    Android apps ni java programming language lo rastaru. Vetini Android Package file(.apk) ga compile

    (combine) chestaru.

    Ela chesina ee .apk file ni distribute cheyadaniki amazon app store dwara Android Market loki upload

    chestaru.

    .apk file lo unna prathi application other applications nunchi separate avvadaniki protect avvadaniki vati own

    sandbox lo run avthai. Anthe kakunda, vati own linux process lo run avthai.

    Ee Applications components, a manifest file and resources ni kaligi untai.

    Resourceslo audio, video, images unatai.

    Components:

    Components lo 4 main components untai android apps ni built cheyadaniki.

    Avi, Activities, Services, Content Providers, Broadcast receivers.

    i).Activities:

    Activity User Interface(UI) tho unna single screen ni represent chestundhi.

    Ippudu user oka screen ni chudagaluguthunadu ante adhi oka activity, click chesi oka specific email screen

    dwara chustundu ante adhi oka activity, Alage oka email ni compose chesyadniki help aye screen ni kuda

    activity ga consider cheyochu.

    So, Activity anedhi application(app) lo oka single User Interface screen.

    Akkuva apps lo multiple activities untai.

    Adhaina oka kotha activity ni start chesinappudu, old activity back ki push avthundhi. New activity highlight

    avthundhi ante front ki vatundhi. Current activity ki background lo unna activity ni click cheste intial activityfront ki vachi current activity back ki push avthundhi.

    Ee activities stack pushni use chesukuni work avthai.

    Ee User Interface activities ni xml or java ni use chesi built cheyochu.

    But, ee tutorial lo UI code separation kosam UI activities ni xml lo built chesaru.

  • 8/12/2019 02-Android App Fundamental - ASHA

    2/22

    UI activities lifespan ni monitor cheyadaniki callback methods like onStart( ),onPause( ) etc., ni use

    cheyochu.

    ii).Services:

    Services background lo long running programs ni perform cheyadaniki use avthai.

    Vetiki alanti User Interface undadhu.

    Network operations, playing music etc., perform cheyadniki use avthundhi. (Manam adhaina music item ni

    start cheste, music continuous ga play avthundhi andhukante music services lo run avuthundhi kabbati).Adhaithe component service ni create chesi untayo vatiki independent ga services run avuthai.

    Kavalanukunte, other apps ni services tho bind chesi run cheyochu.

    iii).Content Providers:

    Control Providers, anni apps data ni access chesukovadam kosam data ni store and retrieve cheyadaniki use

    avthai.

    Data ni share cheyadaniki Content providers ni matrame use chestaru. Edhi ala work avthundhi ante, Content

    Providers dani data set ni unique ga identify chese oka Public URI ni expose chestai.

    Manam adhaina oka data ni other apps tho share chesukovalante kachitanga manam ee content providers ni

    create cheyali.

    E content providers lo data anedhi database model lo simple tables ga store ayyi untundhi.

    Contacts, media etc., ni access chesukovadaniki, android chala content providers ni provide chestundhi .

    iv).Broadcast Receivers:

    Broadcast Receivers system-wide broadcast announcements ki respond aye components.

    Screen turn off aenappudu Android broadcast message ni send chestundhi. Avaithe apps ee message ni

    Listen chesi untayo avi respond avthai.

    Alage battery low unnapudu, photo capture chestunappudu ee broadcast announcements arise avthai.

    Applications kuda vati own broadcasts announcements ni initiate cheyochu. Ee broadcast announcementsother appilcations kuda respond avvochu.

    Ee Broadcast Receiver ki User Interface(UI) undadhu. Kani, evi user ni alert cheyadaniki status bar

    notifications ni create chestai.

    Android Manifest file:

    Anni android apps ki kachitanga AndroidManifest.xml file root directory lo undali.

    Ee file name exact ga AndroidManifest.xmlane matrame unadali.

    Ee file purpose, android system information apps ki istundhi.

    Avaithe components apps lo use ayyayo vatini describe chestundhi.Applications ni run cheyadaniki kavalsina permissions ni declare chestundhi.

    Applications ki kavalsina minimum android API level ni declare chestundhi.

    So, e vidham ga manam Android platform overview telusukunnam.

    2nd

    Video:

    Required Softwares ni install chesam, Android platform overview ni telusukunnam, Ippudu Android project

    ni ala create cheyalo telusukundham.Java-Eclipse editor lo opens a wizard to help create a new Android project ane toolbar button ni click

    cheste New Android Project ane window open avthundhi.

    Ee window lo Project name field lo MyFirstApp ane project name ni enter cheyandi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    3/22

    Tharavatha contents section lo create new project in workspace ni select chesukuni,use default

    location ni mark cheyali.

    Manam workspace ni marchukovalante, use default locationni unmark chesi, kavalsina path ni browse

    chesi set chesukovachu.

    Evi kakunda, manam mundhu download chesina samples nunchi workspace set cheyadaniki create project

    from existing sample click chesina tharavatha kavalsina sample ni drop-down list nunchi select

    chesukovachu.

    Ippudu, Built Target section lo kavalsina Android API ni select chesukovali. (E tutorial lo Android 2.3.3Gingerbread API 10 ni choose chesukunnaru).

    Ippudu Properties section lo,

    Application name ni My First App ani, package name ni com.username.firstappga set cheyali.Ikkada

    usernameplace lo mana system username ivvali. (Ex:com.leebrimelow.firstapp).

    Tharavatha, create Activity ni click chesi Main ani type cheyali.

    Tharavatha, Min SDK version value ni manam aa Android API ni use chestunamo aa API version

    number ni enter cheyali. (Ex: Gingerbread ki Min SDK version level 10).

    Now click Nextbutton.

    Inka alanti changes cheyakunda Finishbutton ni click cheyandi.

    Ippudu, Java-Eclipse lo Package Explorer window lo manam create chesina project MyFirstApp

    kanipistundhi.

    Ippudu, MyFirstApp lo src folder lo com.leebrimedow.firstapp lo Main.java program ni click cheste manaki

    ila program display avthundhi.

    Mainclass Activityclass ni inherit chesukuntundhi.

    onCreate( )method super onCreate( )method ni call chesina tharavatha, setContentView( )method ni call

    chestundhi.

    Ee activity ki alanti User Interface undadhu. So, manam setContentView(R.layout.main)ane functionmainane xml fileni refer chestundhi.

    Ee main.xml file res folder lo Layouts sub folder lo untundhi. Ee main.xml file ni double click cheste visual

    editor open avthundhi.

    Ee editor lo manam activities ki different controls ni views ni drag, drop cheyochu.

    Ippudu main.xml ni open cheste simple xml representation untundhi.

    Indhulo tag untundhi. Ee tag objects ni linear fashion lo set chestundhi.

    Run the application on Emulator:Application ni develop chesaka, manam aa app ni run cheyalsi untundhi.

    Java-Eclipse lo manaki run button paina click cheste oka window open ayyi ichina app ni aa program use

    chesi run cheyali ani aduguthundhi.

    Ippudu list lo unna Android Application ni choose chesukuni ok click cheyali.

    Ippudu Emulator (Virtual Device) ki velthe within seconds lo manam run chesina app install avthundhi. And

    manam ee app ni emulator lo chudochu.

    Install aena app ni chudalante Emulator lo homebutton ni click cheste manam install chesina app My

    First App kanipistundhi.

    gen folder:

    gen folder ni Tools generate chestai.

    Appudaithe manamres folder ki resources ni add chestamo appudu android automatic ga add chesina

    resources ni R.java file ki add chestundhi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    4/22

    Ee R.javafile gen folder lo com.leebrinelow.firstappfolder lo untundhi.

    Android resources ni ala add chestundhi ante, add chesina resource ki name ni, and oka resource number

    value ni reference ga project lo use chese vidham ga create chestundhi.

    Android 2.3.3 folder:

    Ee Android 2.3.3 folder lo actual android SDK folder untundhi. E folder ni manam click cheste manaki

    packages, classes, assets untai.

    res folder:

    res anedhi resource folder. E folder lo images kosam oka folder, xml layouts ni User Interface ga use

    cheyadam kosam Layout sub folder, string values ni store cheyadaniki values sub folder untundhi.

    Android Manifest.xml:

    Ee xml file more details ni istundhi.

    Ee file lo xml file various properties ni edit cheyadaniki visual editor untundhi. Lekapothe manam direct ga

    xml view lo edit chesukovachu.

    Ee xml file, android system ki apps ni describe chestundhi.

    Default properties, proguard.cfg files kuda untai.

    3rd

    Video:

    Close look at the Android Manifest file:

    Ee Android Manifest file chala import file andhukante edhi applications information ni android system ki

    expose chestundhi.

    Most of the people, direct ga xml file ni edit chestaru.Ee Manifest file lo manam package ni define chestam.(com.username.app name) (Ex:

    com.leebrimelow.myapp).

    version code internal version code ni define chestundhi.

    use the export wizard tho manam develop chesina .apk file ni market loki upload cheyochu.

    Application tag lo,

    Label field lo manam develop chese app ki specify chesina string ni android device lo lancher lo display

    chestundhi.

    Future use kosam manam theme ni use chesukovachu.

    Manam chese app ki Icon ni set cheyadaniki Icon option use avthundhi.

    Under App Nodeslo,

    Manam add chese each activity tag tho start ayyi tag tho end avthundhi. Ante

    tags lo manam activity ni specify chestam.

    Specify chesina activity ni application ki add cheyadaniki tag ni use chestam.

    Permissions tab lo,

    Manam install chesina application work avvadaniki certain permissions ni tisukovadani ee permission lo

    specify chestaru.

    Installation tab ni manam akkuva use cheyam.

    Final ga,

    Manifest file capabilities ni, kavalsina permissions ni android systems lo unna things ni describe chestundhi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    5/22

    4th

    Video:

    Manam mundhu ga telusukunam kadha activities apps ki primary building blocks ani.

    Manam application lo oka single screen ni activity antam.

    Manam android lo ippudu oka app ni develop chedham.

    Manam create chese project ki oka name specify cheyandi. (Ex:LearnActivities).

    Properties lo App namefield ki Activitiesani specify cheyandi.

    Package ni com.username.activities ga set cheyandi. Ikkada, username me system username.

    Create Activity ni Main ga set cheyandi.min SDK version ni 10 ani set cheyandi.(Meru use chese API batti ee number maruthundhi. E tutorial lo

    Gingerbread use chesaru kabbati dhani API 10 ni specify chesaru).

    Ippudu, AndroidManifest.xml file ni open cheste,

    tag lo first activity ni specify chesaru,

    Manam chese app ki more activities ni add cheyadaniki Main.java and main.xml ni create cheyali.

    Creation of Main.java file:Manam first, oka Activity class ni extend chese oka java file ni create cheyali.

    So, java file creation kosam, main package paina right click chesi, new lo class ni click cheste, oka window

    open avthundhi.

    Ee class file ki Second.java ani specify chesi, activity class ni extend cheyadaniki browse loactivity-

    android.app click chesi ok cheyali.

    Manam oka java file ni create chese prathi sari ee properties ne set cheyali.

    Ippudu create aena Second.java file ni open chesi, class lo unna onCreate( ) method ni override cheyali.

    So, onCreate( ) ni rayadaniki, ctrl + space click cheste manam template proposals vastai. Vati nunchi,

    manaki kalsina onCreate( ) method ni click cheste, aa method class loki vastundhi.

    Creation of xml file:

    Manam create chesina Second.java file ki UI ni create cheydaniki ee xml file ni use chestam.

    So, xml file creation kosam toolbar lo third button ni click cheste oka window open avthundhi.

    Ee window lo, xml file ki second.xml ane name ni specify cheyali.

    Tharavatha what type of resource would you like to create Layout option ni choose chesukovali.(

    Manaki kavalsinadhi adhaina choose chesukovachu).

    Ippudu, root element for the xml filelo LinearLayout ni set chesukovali.

    Ippudu finish ni click cheste UI open avthundhi.Manam xml file create chese prathi sari ee properties ni set chesukovali.

    Ippudu TextView ni drag chesi UI lo drop chesyali.

    Ee TextView ki properties set cheyadaniki, properties lo Textproperty ni search chesi, value ni This is the

    second activity ani set cheyali.

    Ippudu, second.xml file lo things ni proper ga wrap cheyadniki, right click chesi, sources lo cleanup

    Document ni click chesi ok cheste, xml file loni things proper ga Linear Layout lo arrange avthai.

    Ippudu ee UI ki manam oka button adda cheyalante button ni drop chesi UI lo drop cheyali. Button

    properties ni set cheyaniki properties lo ADT tools lo ID ni customize chesukovali.

    Ippudu UI lo TextView and Button unnai.

    User Button ni click cheste next activity Launch avvali. So, Main.java file lo ee button ki reference create

    cheyali.

    Button b=(Button) findViewById(R.id.button1);

  • 8/12/2019 02-Android App Fundamental - ASHA

    6/22

    Syntax rayadam ranappudu just ctrl+space ni click cheste options lo manaku kavalsina dhani select chesuni

    java file ki add cheyali.

    Manam create chesina UI ki reference kosam findViewById( ) method ni use chestam.

    Vetini b ane property ki add chestam.

    Ippudu Listener ni set cheyali, ante manam button click cheste aa action listen avvadaniki Listener ni set

    chestunam.

    b.setOnClickListener(new onClickListener( ){ }

    Indhulo, Listener ki bki add chestunam. banedhi Button ki create chesina Instance.onClickListener( ) anedhi Anonymous Intent Type Event Handler.

    Ee Listener function ni complete ga rayadaniki malli ctrl+space ni click cheste total function vastundhi.

    Ee ctrl+space ni click cheyadam valla time ni save cheyochu.

    Ippudu onClickListenerclass ni Import chesukovali.

    Ee function appudu last lo semicolon(;) tho terminate avthundhi.

    Ippudu ,

    b.setOnClickListener(new onClickListener( )

    {

    startActivity(new Intent(Main.this, Second.class);

    setContextView(R.Layout.second);

    }

    Ee function lo,

    Intentanedhi object.

    Mainanedhi package context, ee Main.this main file ni refer chesi, system ki, avaru particular activity

    kosam request chesaru ane information pamputhudhi.

    Second.class anedhi requset chesina activity ni Launch chestundhi.

    Ippudu, manam perspective java perspective nunchi DDMS perspective ki marchukovali.

    Dhini kosam, java-Eclipse editor right side lo perspective icon ni click chesi others lo DDMs ni click chesuok cheyali.

    Ee DDMS perspective manam chesina applications emulator lo proper ga run avthunayo ledho monitor

    chestundhi.

    Ippudu activity ni manifest file ki add cheyadaniki,

    Ane activity ni add cheyali.

    Ippudu run button ni click chesi ok cheyali.Ippudu Emulator lo ee app Launch aavthundhi.

    Manam develop chesinatte TextView, Button untai. Button ni click cheste next activity Launch avthundhi.

    5th

    Video:

    Ee video lo intent ala work chestundho telusukuntam.

    Actual ga intent application lo ni activity ni activate chestundhi.

    Intent 2 types,

    1.Explicit Intents.

    2.Implicit Intents.

    Explicit intents, specific intent ni explicit ga use chesi application lo activity ni activate chestai.

    Implicit intents are generalized messages.

  • 8/12/2019 02-Android App Fundamental - ASHA

    7/22

    Example:

    Explicit intent ni use chesi oka activity loni TextView lo ni text ni submit chesinappudu second activity loki

    aa submit chesina text explicit ga ala display avthadho telusukundham,

    First manam exercise files loni explicit-intent folder ni import chesukovali.

    Java-Eclipse editor lo package Explorer paina right click chesi import lo General lo Existing projects into

    workspace ni select chesukuni next click cheyali.

    Tharavatha window lo select root directory lo exercise files lo ch2 lo explicit-Intents folder ni browse chesi

    ok chesi finish cheyali.Ippudu Exercise files Eclipse lo import chesukunnam.

    Ippudu Main.java file lo,

    EditText et=(EditText) findViewById(R.id.editText1);

    Button b =(Button) findViewById(R.id.button1);

    b.setOnClickListener(new onClickListener( ))

    {

    @override

    Public void onClickListener(view v)

    {

    Intent intent =new Intent(Main.this, Second.class);

    Intent.putExtra(thetext,et.getText( ).toString( ));

    startActivity(intent);

    }

    }};

    TextView create cheyadam kosam, EditText class ni import chesukunnam. Ee EditText class ki et ane object

    create chesam.

    Ee EditText instance editText1 ni Resource R ki add chestunam.Tharavatha button ni create cheyadaniki Button class ni import chesukunnam. Button ki b ane object ni

    create chesam. Button instance button1 ni Resource R ki add chesam.

    Button ni click chesam ante Listener listen chesi next activity perform cheyali.

    So, Button instance b ki setOnClickListener( ) ni add chesam.

    Tharavatha, Activity ni activate cheyadaniki onClickListener( ) lo Intent ki instance ga intent ni create

    chesam. Ee Intent( ) class ki two parameter pass chesam. Main.this andhedhi activity ni request chestundhi.

    Second.class anedhi request chesina activity ni launch chestundhi.

    putExtra( ) ane method lo key value ga thetext ni use chesi, TextField lo enter chesina text ni EditText.

    Second.java:

    TextView tv= (TextView) findViewById(R.id.textview1);

    Tv.setText(getIntent( ).getExtras( ).getString(thetext));

    getIntent( ) ane method tho manam text field lo enter chesina data ni get chesukuntunam.

    getExtras( ) ane method tho manam string lo unna anni extras ni get chesukuntunam.

    Thetext anedhi key.

    Ee files ni save chesi, run cheste emulator lo launch avthai.

    Thatavatha, Emulator lo first activity lo text ni enter chesi submit cheste next activity lo enter chesina text

    display avthundhi.

    E vidham ga manam Explicit Intents ni use chesukuntam.

  • 8/12/2019 02-Android App Fundamental - ASHA

    8/22

    6th

    Video:

    Implicit Intent:

    Implicit Intent anedhi android lo powerful feature.

    E Implicit Intent ki example manam mana android phone lo sharing option.

    First manam emulator ki velthe gallery app ni launch cheyali (just gallery app ni click cheyali).

    Oka picture ni choose chesukuni dhani share cheyalanikunnapudu manaki only one option matrame undhi

    previous ga. Kani ippudu manam gmail, twitter, facebook lo kuda share cheyochu.Kani ee app develop chesinappudu only one option i.e., messaging ni use chesukuni share chese facility

    matrame undhi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    9/22

    Kani Implicit Intents ni use chesi manam vere apps ni kuda activate chesi, share cheyochu.

    Ee Implicit Intents ala work avthayo chudham.

    First, Java-Eclipse editor lo DDMS view ki velthe,

    File Explorer tab lo, mnt folder lo sdcard sub folder lo manam previous ga exercise file Assets lo unna

    images ee sdcard folder lo untai.

    So, mundhu ga sdcard ni select chesukuni, editor right side lo button ni click cheyali.

    Ee button ni click cheste sdcard folder unna pictures device loki store avthai.

  • 8/12/2019 02-Android App Fundamental - ASHA

    10/22

  • 8/12/2019 02-Android App Fundamental - ASHA

    11/22

    Ippudu create aena ee project lo AndroidManifest.xml file ki velthe,

    Ikkada manam Type=image/*dheni valla manam any type of image ni insert chesi send cheyochu.

    Ippudu Eclipse editor lo layout lo main.xmlfile lo Images & Media lo Imageview ni drag chesi screen

    paina drop cheste manaki image view create avthundi. Ee screenshot lo unattu,

    Ippudu src folder lo, main.javafile lo above insert chesina image component ki reference create cheyali.

  • 8/12/2019 02-Android App Fundamental - ASHA

    12/22

    Ikkada,

    Imageview iv =(Imageview) findViewById(R.id.imageView1);

    iv.setImageURI (Uri) getIntent( ).getExtras( ).get(Intent.EXTRA_STREAM);

    setImageURI anedhi, image ni image view ki set chestundhi.

    getIntent( ) image nunchi information ni get chestundhi.

    Intent anedhi key.

    URI address of image ni specify chestundhi.EXTRA_STREAM anedhi image information ni grab cheyadniki use avthundhi.

    Ippudu ee program ni save chesi run cheyali.

    Ippudu Emulator lo velthe manam chesina app launch avthundhi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    13/22

    Ippudu manam share ni click cheste different apps ni use chesi image ni share cheyochu.

    Ippudu Implicit Intents ni click cheste share cheyalani kunna image ee Implicit Intent app lo display

    avthundhi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    14/22

    So, Implicit Intents other apps ni activate chesi data ni share chestai.

    7th

    Video:

    Manam oka app ni develop chestunappudu, konni external files (Images, Audio, video, xml files etc.,) use

    chestam. Vetine assets antaru.

    Manam develop chese app lo ala ee assets ki reference ni create chesi use chestamo telusukovadam chala

    important.Mana resource res ane folder lo store ayyi untai.

    Konni assets automatic ga Layout folder lo store ayyi untai.

  • 8/12/2019 02-Android App Fundamental - ASHA

    15/22

    Values folder manam develop chese app first nunchi last varaku use aye values untai.

    Ee values ni manam external ga unchutham, globalization and nationalization purpose kosam. Entire app lo

    use cheyadaniki.

    Ee resources gurinchi inka information kavalantehttp://developer.android.com/guide/index.htmldevelopersite ki velthe resource gurinchi and app development ki useful aye information untundhi.

    http://developer.android.com/guide/index.htmlhttp://developer.android.com/guide/index.htmlhttp://developer.android.com/guide/index.htmlhttp://developer.android.com/guide/index.html
  • 8/12/2019 02-Android App Fundamental - ASHA

    16/22

    Directory Resource Type

    anim/ app lo ni animations ni define chestundhi.

    color/ app ki useful aye colours ni define chestundhi.

    drawable/ app lo ni graphics ni define chestundhi.

    layout/ ee directory lo xml layouts define ayyi untai.

    menu/ create aena menus ni define chestundhi.raw/ audio, video, images ni access chesukovadaniki ki avasaram

    aye raw data store chestundhi.

    values/ colours, strings etc., reference values ni store chestundhi.

    xml/ app ki kavalsina bundles of xml files ni store chestundhi.

    Assets ane folder lo manam import chesina resource ki references unati. Ee reference id value ni store

    chesukuntai.

    Mana project lo resources (Audio, video, Images) ni import chesukovalante, computer lo manaku avasaramaye resources ni res folder ki import chesukovali, just drag and drop cheyali reslo drawable folder loki.

    Ikkada manaki three types of drawable folders untai.

    drawable-hdpihigh dpi devices kosam use aye resources ee folder lo untai.

    drawable-ldpilow dpi devices kosam use aye resources ee folder lo untai.

    drawable-mdpimedium dpi devices kosam use aye resources ee folder lo untai.

    Android lo edhi oka most powerful feature, automatic ga user device ni base chesukuni resources ni

    particular dpi folder ni grab chestundhi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    17/22

    Ippudu gen folder lo R.javafile ki velthe, manam a resources ni import chesamo aa information untundhi.

    Manam above picture nunchi telusukovachu add chesina prathi resource ki oka reference id create ayyindhi

    i.e., number.

    public static final class drawable

    {

    public static final int Amsterdam =0x7f020000;

    }

  • 8/12/2019 02-Android App Fundamental - ASHA

    18/22

  • 8/12/2019 02-Android App Fundamental - ASHA

    19/22

    Ippudu, ImageView ni add cheyali. So, go to Images & Media and then ImageView ni drag chesi layout

    paina drop cheste ImageView display avthundhi.

    Ee ImageView ki properties ni set cheyadaniki corner lo button ni click cheyali.

    Eppudu manaku kavalsina image ni properties lo reference iste manaku kavalsina layout lo display

    avthundhi.

    srcproperty lo default ga icon value set ayyi untundhi.

    Ee value ni manam click cheste, manaku kavalsina pic ni imported pics nunchi choose chesukovadaniki

    options untai.

  • 8/12/2019 02-Android App Fundamental - ASHA

    20/22

    Pic ni choose chesukuni ok click cheste graphical layout lo display avthundhi

    Ee vidham ga manam xml lo things ni refer cheyochu.

    Java lo refer cheyadaniki:

    Ippudu Main.java file ki velthe,ImageView iv=(ImageView) findViewById(R.id.imageView1);

    iv.setImageResource(R.drawable.lima);

    Ikkada, ImageView ni add chestunam.

  • 8/12/2019 02-Android App Fundamental - ASHA

    21/22

    Add chesina ImageView ki reference set chestunam. lima anedhi reference dhinni drawable class ki add

    chestunam.

    Ee vidham ga java file lo reference create chestam.

    Ippudu ee app ni run cheste, emulator lo launch avthundhi.

    Ee way lo manam app lo images ki reference ni set chestam.

    Beside the screen, Android manam amaithe components ni insert chestamo aa components ki reference ids

    ni R.java lo create chestundhi.

  • 8/12/2019 02-Android App Fundamental - ASHA

    22/22