 My name is, let me introduce my team, my name is Nilesh Singh, Shailika and Meenat Chilab. Now here we are going to present you something about what exactly Android and what you can do, you can do something with the Android. Now, here basically why we require Android, first of all, everyone, everyone having phones like now in current age, in current age we have 60 percent phones we have with the Android operating system. You can say in any Galaxy mobile, Samsung Galaxy mobile, or now in like in Akash tab there is also some Android based operating system. Now we will see first of all what is Android, this is Android like who is invented and when it is invented first, Android applications, so what is Android, Android is the operating system, Google operating system here based on which language, Java programming language. If you know something about Java, you can easily code, you can easily develop an application in Android, any Android based application you can design, Android is currently primarily developed by Google, Android is software environment built for mobile device and tablet computers. See this mobile devices and tablet computer is what like I can, this is the tablet and all of you having mobile and you are maybe you are the 60 percent student having this Android based mobile, okay. Now in July 2005 Google acquired Android incorporation, a small startup company based on Palo Alto CA, four of the Android people, they went to work at Google, Google company, Android has been available as an open source since October 2008, okay now there is a one very good thing, we can design whatever the application in Android, okay and if you want to search something in Android to copy, take some code or information about Android, that is totally free, you will get from the website. Now here are some updated history of your Android versions, okay first is Android 1.5, which one is first Android version, okay there is beta, okay beta version is there, okay it is developed in 5th November 2007, after that Android 1.0, okay and it is developed in 23rd September 2008 and after that all this Android versions, okay Android 1.5 is code name as you can see that Cupcake and the API level, we have API level in this that is 3, okay and developed in 30 April 2009, Android 6.1, okay do not on that API level is 4, okay so step by step like on that the year by year we have something we have developed something in Android, okay right now here we are using Android 2.3 because maybe it is not clear but in our Akaast update we are going to use 2.3 Android version, okay so that is why I am highlighted this one, after that 3.0 is there 3.1, 3.2 and 4.0 there are lots of versions like after this 4.0.2 there is one more version, okay there is 4.0.3 is also there, okay the 4.0 is Ice Cream Sandwich, the code name is that, okay it is developed in 16th October 2011, obviously this we have in lots of operating system in our current age, you know the windows is there, Linux is there, okay but why Android we are using, why we are using Android, okay there are lots of features but why we require Android, look Android is basically here we are using a DVM, DVM is a, what is DVM, Dalvik Virtual Machine, okay here we will see this later what is exactly Dalvik Virtual Machine, first we will see some something about like features of Android, okay we will cover this topic later after we have one slide one or two slide for the Dalvik Virtual Machine and why we require Android, okay Android operating system to work on Android operating system, we will see later, first we will see this features of Android, okay while using in your tablet or if you are using your tablet or phones, okay why we require, so very first one is application framework, what is that is enabling reuse and development replacement of component, what is reusing, reusing what is what exactly, everyone knows of object oriented concept, reuse means we can reuse that object oriented terms, we can reuse that code also, we have like we can reuse the same thing, we can apply that concept in Android, okay now there is one Dalvik Virtual Machine optimized for mobile device, we will use this VM, virtual machine for mobile operating system and tablet computers, okay so we will see this Dalvik Virtual Machine, so next slide, now integrated browser based on the open source webkit engine, what is webkit engine, webkit is the engine it is enable you to enable your browser, okay to rendering your websites, okay apart from that like the webkit is having the features of Apple, this I can say that Apple the name is Apple Safari and Google Chrome browsers, this webkit have engine supports, Apple Safari and Google Chrome features, okay so that is the webkit engine, so you have to like if you want to know detail about the again Google Chrome and Apple Safari then you have to search everything from the net, okay optimized graphic, another this nine in this, okay in Android we have some graphics things also, we can develop some 3D or 2D things and we have some input like UI, okay in 3D and 2D, so that we can support here that Android is supporting that things, in a SQLite if we want to store something, if you want to use databases at that time we can SQLite we can use, okay for the database purpose. Now again Android is supporting some media framework, yesterday we have some discussion about like media framework, here you can see that almost all kind of media frame like Android is supporting all kind of media framework almost you can see here MP4, MPEG4, S264, MP3, MP3 is for the audio and ACC, AMR what is AMR, all these are we will use for the media and okay that's images is also there, so we can see that JPEG, PNG, GAF, JPEG everything we can use with Android, okay means almost 90% media frame, media like Android can support, okay next one is GSM, telephony, okay in this we have some features to we can make a phone call also in Akash tablet maybe I heard like this I heard something about like in Akash we have some telephony things, we can make a call also then there is a Bluetooth 3G and Wi-Fi, all of you know about what is Bluetooth 3G and Wi-Fi then camera, GPS, compasses and accelerometer the main thing is reach, develop and environment including a device emulator tool okay here for reaching that development environment we have some inbuilt things to run our application on your laptop or any machine we can run and based on that we can watch we can see that the particular result okay so we have emulator so apart from that we have tool bugger, debugger and memory okay there is memory and performance is very important in this Android because because of this DVM also okay DVM again if you are talking about DVM so there is we have something about we have to talk something about memory and performance profile okay and then plugins for the eclipse ID so we have some plugins for the for running Android we have some plugins so we have to install that on plugin that is a step-by-step you have to follow to configure your eclipse this is exactly your architecture of Android so don't see many thing here just see first there is application okay then next which one is that okay third one which one is that then Android runtime then Linux kernel okay so there are some steps okay when we are like when we want to know about the architecture of so we have to follow some step first we have to see that this application then application framework is there lots of things in Android okay so here the main thing in this Android runtime is important because here we are using DVM okay DVM is what Dalvik virtual machine so we'll see now what is exactly Dalvik version I'm focusing on that because it's very important in terms of memory in terms of speed and performance this is the Dalvik virtual machine and runtime if you write application in Java in this layer all your all classes file will converted into DEX file for DVM to execute now in this block okay your all class file will converted into D in which form DEX form what is that DEX form now so in there's the main thing is DVM so what is that DVM Dalvik is the process virtual Dalvik is the process virtual machine that is Dalvik virtual machine like your JVM in Java okay here we have DVM okay now in Google in now DVM is a registered based okay DVM is register basis what have you heard about like have you learned this micro processors something like that assembly label languages register is there accumulator BCDE HL some that those are 8-bit registers they are DBE sorry BCDE HL 16-bit registers SPPC all these are 16-bit registers so like I'm not again like this register base we'll see what is exactly what is use of this register base architecture now program are commonly written in Java as we know that if we want to develop some application in Android so we require we should know about something Java okay and compile to bytecode they are then converted from Java virtual machine compatible dot class file to Dalvik compatible DX file first we have to convert that into dot bytecode sorry dot class bytecode and then the dot class file and then that JVM will convert that into Dalvik compatible file that is dot DX now we'll see some differences between DVM and JVM DVM is what as a register based architecture JVM is what stack based now the assembly language students stack there is a stack and there is register so which one will be fast stack based or register based will be fast okay design to run on low memory okay this our DVM will is designed for the to run on low memory we can run our application on low memory also then here we have we will get the DEX file and in Java we will get jar file now stack based machine must use instructions to load data on the stack and manipulate that data and does require more instruction than register machine okay stack based JVM will require more instruction than more instruction than register based because when we are fetching one instruction okay suppose if I want to copy one instruction means one value to one variable okay at that time what we are doing for how many cycles we require so implement is in the high-level code but the instruction in register machine must encode the source and destination register and therefore tend to be larger we'll see one example based on this what exactly is this now yeah there's one more point the uncompressed dot DX file is typically a few percent smaller in the size than compressed jar okay listen this uncompressed DX file is lesser than compressed jar file so how can happen now here I'm giving some example there is more very small example based on C C program this is register based exactly not stack based so you will come to know how it will work okay there is a int a what I'm doing in this point in a is equal to 8 I'm copying this value 8 to a variable now a is equal to 0 what I'm doing in next statement statement what I'm doing again I'm copying another value to means to a variable now just think when I'm copying suppose let's think about the CPU cycle okay first is there is a one variable equal sorry a is equal to 8 it will take maybe two cycles two CPU cycles okay again for the next statement again it will take two CPU cycles for getting this zero result in a now here I'm shuffling these things I'm using another logic for that your int a is equal to 8 again I'm copying this a to a variable after that let's mean XOR I'm doing I'm XORing this a to a with a so what I'll get so how much CPU cycle to only here I'm using two CPU cycles so it's lesser than that previous one so now the arithmetic operation of XOR versus move is just faster than two three bus cycle okay it's not confirmed because we don't know about exactly the hardware level cycling about cycling okay it could be one also it could be two it could be three but it is like register based architecture is much faster than your much faster than your stack based because of that in our I any android phone or any tablet what are the exactly disadvantageous first is memory second battery okay that is batteries there third processor okay so which one is good stack based or register based so that is why we are using here android in android we have DVM something tell you something about kernel of android so normally in our android for android operating system our kernel based on Linux okay we are using Linux kernel in android okay so here some application components are like my colleague team member Shreka will cover everything about the activity service okay all these are what it's a component only okay so when we will give you the practical example what is use of this all this you will come to know properly this is a theory part obviously basic building android will be have some basic building blocks that will be the functional blocks while be designing or while be doing while be developing applications in android there will be some functional what functional blocks so these three are the these four are the basic functional blocks activities services content provided and broadcast receivers you will be going through detail so first activities activities nothing but what we are seeing on the screen that it will be an user interface so actually what what action or some function what something we have to do in android mean we have to write on activity normally in Java Java program we will be timing us a class we will be writing on class here the class we will be timing us activity so we have to extend that activity from means the class from activity on base class is there we have to extend that our class from that base activity class that android framework itself providing that base activity class then yeah activity will be having five stages it normally all applications will be all application or whatever the things we are taking there will be some stages for that application so here activity also will be have some step starting state is there then running state paused state or stopped state or destroyed state so we will be going through detail actually phone activities present or active in memory then we can tell us that activity is active then if it is paused state means if we are interacting with on activity at the time we have to attend for example in phone we are playing music player or something at the time we have we got on cold at the time now we have to stop that we actually we do not want to stop it just pause it so at the time this past activities is coming so it will automatically get paused because while coding we already said like that if on interrupt anything is coming it should go for pause state and the what the present activities that will execute once the present activity got over the paused activity will come into picture so in pause the activity actually it will be visible on the screen but the current the focus is not to that activity that is the thing but this stopped state is there in stopped state what it means it won't be visible to screen also focus also won't be there it won't be visible also so that is stopped then killing means if you don't want on activity we have to kill it like in memory we will be studying no operating system and all right like that only we will we have to kill the activity that either actually in a stream memory low situations processor itself it will kill the activity otherwise if you want we can manually do it also then we will be going through the activity life cycle so as I explained there will be activity we can start while writing an activity there is some method that on create that we will be we must write that because then only that activity will get create actually this is already available we can override it it will while be creating on activity that Mr. Nainath will be explaining how to create a program and at the time you will come to know while creating an activity this on create a method default by default it will get override then on start state these are the remaining stage stages as I mentioned in previous site in a previous slide so here we can come to know when on pause state I told now the activity comes into when we don't want on activity mean currently the focus we should deviate from that activity at the time it will go to on pause state and at the time see when we need this on pause mean sometimes some activity is running but other activity need that memory at the time only we will be calling that on pause of method but at the time see activity is no longer visible here yeah sorry this is when the activity I told it is the activity will be killing so they either the activity will be killing by the professor in low memory situations or we can kill at that time when it will be getting killed at that time only this this flow is going then again if you want to create an activity it will come to on create a method otherwise one more thing in either if we if we put an activity state is on pause or on stop state we if you want that thing again then on stop method we have to start it on restart but almost it will automatically will get called there is no need to start it by manually but for on stop method we have to give it a restart method we have to call on restart of method so the remaining the flow you can understand right first create it will be if it if you are going to on start state actually this on start method on resume method the central note compulsory for a pro for an activity this on create of method is the compulsory method with the along with self we can execute the activity but this on start of on resume this on pause this all are optional if you want then only we have to use it also on destroy this is at the last all activity will be getting getting into the stage of on destroy if you would on want while creating the activity itself this method will automatically over get overrated he will show that how we can actually create an activity this is on a word screen shot class then our on create of method will be there also actually this all with activity will be having we will be having on view actually in phone or either in August tablet or whatever it we will be seeing activity throne view we will be designing on view also how it should be look how it should look like that so that for a corresponding activity that that layout in layout folder we will be create giving on view also how it should look so that we can call using the second on view of method while writing a program or creating an activity to have some structure android programs have its own structure he will be explaining the structure handle at the time there is an android manifest file is there that is actually we are giving certificate to certificate or it is it is time does a certificate of that android file android program there we will be writing what are the actions or what are the activities we are using in that what are the either we are calling a service or activity or what has to receive or something what are the thing we are using all things we have to give mention there and get the permission we will be calling as permission here also see our previous activity and activity demo that we have written there in application we are this manifest file is for or this program is for I see put in this activity then the intent is nothing but if you are creating on activity we have to mention that for what activity it is created or if you are communicating from one activity to another activity we have to mention that for what thing we have communicated to the next activity or at the time we will be using the indents as the message objects so through that only we will be communicating between activities or services if from one activity if you want to call the service then at the time also we will mention in an indents object we will be mentioned what are for what purpose this activity is calling or what is the use I indents have two part what the action to be performed or what data it is going to operate then yeah for example it can be used with the start activity if you are using start activity there we can use intent then broadcast intent that will be for if you want to give a message to end their components of the device then okay we can use broadcast intent so it will be that through inside that intent we can mention what message we to give and so it will be getting to all components all other components then start service of intent that also an example of intent where how we can use intent this start service of intent means here with that start service will be getting started then bind service means from one service or one activity we want to bind and another service to by get bind into this activity or service at the time we can use this bind service of method at the time see indents there we will be creating service connection object then through that we can bind that particular service to the existing service and service service is nothing but if you want to execute something in background that we when we will be doing something we want something should be executed in the background that should not affect our what we are doing now at that case we can use services service will be mainly categorized window start service and bound service actually there is one more classification local service and remote service is there but local service is nothing but in between what we do in between some two or three service methods that is remote services it you have to look like in computer networks we will be remote communication and all it will be there now like that to some other device or something if you have to interact that the time we will be using remote service here the start service start service nothing but a service is started when an application component started by call it or start service of method we in activity we will be using one creative method but the start service of method also not compulsory here that I will be explain in the life cycle at that time we will get it now then yeah once the operation is done we can start it by itself or by ourselves or our service itself will get close then bound service means I told now we can bind it to another service for that only we are using bound service of method at the central you do not need actually a bound service can be implemented in three ways extending the binder on binder a class is there we can extend that binder class otherwise using messenger object otherwise use using android interface definition language three methods that and all in detail well coding you would not be using in a basic level right then yeah I have already mentioned that whatever the thing if you are creating a service or creating an activity or whatever the files or what we are doing whatever the things we are doing that we have to mention in that android manifest file because that will give the user permission sometimes while executing and all now some we will get some error because we did not put the user permission in that android manifest file so like that only here we created the in previous no no sorry I deleted that slide on update service yeah our service we created that service we are mentioning here previously in activity we mentioned the activity name like that here we are mentioning we created a service in program we I told now we have to call that service we are calling is our dot item star service of that star service method we are using that indent also we are passing what this service is going to do this update service dot will dot class will get affected with that indent then if you have to stop the service also we will be calling the item stop service of method they are also for stopping also we are passing on indent so the indent is actually the message that their action but also their data to which data it is going to act here update service dot class it is going to get affected then this is the service life service life cycle see here we can see the difference of bound service and the normal service in bound okay first we will go through normal service the component called start service of method then on create of this we can create that service then on start command of there we can while while the service is getting started if you want to execute something we can give there then service is running service to upload by itself for a client we can do whatever thing on destroy but in a bound service means there is no need for on start command it will automatically if actually in bind service case it will be calling from some another activity or from some other service at that if when the method bound service of it is getting called by the item itself it will initialize so there is no need to call on start command of method or on start service of method it will automatically there is this method that service or activity which is calling that itself it will get initialized so yeah here bind service of on create of on bind of service is running remaining all here on bind of on bind of method and on unbind of methods are the important thing because we are binding to a service okay so we have to bind it and unbind while unbinding we have to call the unbind of method then on destroy of then the broadcast receiver broadcast receiver is nothing but we know the time broadcast we have to give give or pass some message to every whatever the components are present we have to globally have to give or broadcast something for that we will be using broadcast receiver for example to be a time shown announcement or batteries low suddenly the in our mobile and all we used to get right if the battery is low or something that message will be coming so whatever the activity so services running in that device for all that activity services everybody will get that notice so like that globally if you want to give some a message we can use broadcast receiver while doing some action if you want some another action should get called or something while coding at the time also we either machine can automatically call this broadcast receiver method also it means in low memory situation and all it will not low memory or low battery situations it will automatically announce but in if you want in some particular applications in their case we can we can call also if we want to give some instruction to at a particular stage to all applications at the time we can call on broadcast receiver method otherwise by default if some situations coming machine means device will automatically call broadcast receiver method two or two ways of usage is there see this is one example how it is broadcast receiver in interacting with on activity alarm is on broadcast receiver example then yeah actually android will behave some it is on structure there will be on source folder resource folder actually whatever the resources we are using that we have to arrange it we cannot put it like anywhere normal in java program and all we can put it in normal our local system itself then we can call from there but here we cannot do like that we have to arrange it into specialized the folders so we will be arranging see draw some images or something is there that we can put it in drawable folder that all will be coming under resource folder some layout what I told no activity everything will be we will be using some view we mean how it look like we can create so that that and all will be putting in layout folder then we are use actually we will be in mobile and all we will be getting lots of message means what if one call is coming call is coming that message will come right like that all messages or messages or some words everything will be we will be storing in string dot xml file but from there using only called mapping it is it will get mapped to that files and corresponding where the application is calling or where the where we hate to call that component it is getting mapped and at that time only that strings are getting displayed so xml files whatever the thing that all will be keeping in layout folder so all all kind of resources will be keeping in resource folder yeah this is android manifest file that by now you got yeah every application must be having an android manifest file in its root there it will be there then here also again on service how we will be naming a service yeah indents also see here we are using that indents for communicating between activities or services we can create indents filters also for we can in that indents filter like that normal filter what it means we can filter it for what specific thing it is using like that if you if you want to give some some activity or some service something for some special purpose at that time we can give this give it in inside of this indents filter when now machine nine earth will give you demo how the android program will and now so our theory part is over so finally over and now we are looking at the practical part so we will be looking at how to create an android project and then folder structure of android and we will I will then I will show one demo so first how to create an android project go in a file inside that new and then android project okay you will see one in that you should write on project name whatever you want and then let me try image next okay then it's a which platform you want to select you can select any one of them so for Akhasta we mostly used android 2.3.3 so in this case we also use android 2.3 and then package name and click on finish we will see here project image slider there right there so now we will look at the folder structure so for that I have a image this is a folder structure so first folder is SRC it consists of all the source file means any source file activity inshallah to be exact it consists of activity file so whatever source code we write we store in that source file a source folder and then there is a generated java file gen folder inside it you can find r.java file so it is automatically generated file I will tell you about it later and you can see that there is a bin folder in there inside that bin folder you will find .apk file .apk file the apk file you should copy from here in your pen drive and then you can install that apk file in your tablet so your application will run on your tablet with that .apk file and there is a rs folder rs folder consists of all the resources like images videos audios whatever you want you should store in that rs folder if you see there are three drawables why are there three drawables one is for hide if there are for example if there are for yeah if you are small mobile for android mobile its screen size is small for tablet the screen size is large so for that you can copy and paste in every folder your images so for hide your data dot per pixel there is a drawable hdpi for small screen you can paste your images in ldpi and for extra large images you can paste in in that folder so better you can you should paste all your images in all the three folders and then there is a layout folder it consider main dot xml you can give any name you want so standard name is main dot xml so what that does is that whenever you execute your program this is what this is what you can see on your and tablet for example this if you see this this is what xml graphical layout and then there is a android manifest it consists of all the permissions or you can say a intent activity which we need to execute and all now we look at one demo I have I have one code executed so I will just show you that code directly this is that java file will look like which is stored in a src folder it consists of on create method I should tell you that on create method is executed first when you when you open your application this is the method which is first executed so all your main things we need to do in your android in your project you should do it in this on create method so this is a this is all the code and before some sometime before I told you that I will show you r dot java here it is it is a it it is an auto generated auto generated file so in this it it points to the indexes in the resources directly whatever resource we put like in my project I have I have copy pasted my images like attitude course critical engineering this all images are copy and pasted in drawable folder so that is why you can see there that is why you can see your attitude course critical engineering with they are also you can see that they are given an indexes so they are so in this way it is also done with id button I have introduced one button that is why another class called id is there and inside it you can find button similarly it is automatically generated whenever you drag drag or anything into your main dot xml or type anything in your main dot xml it is automatically generated in r dot java so now let us execute the project run as application this is a small image slide show it will take time to it takes similar time as we if you are our android mobile is switched off and we switch it on it takes similar amount of time exactly and now in background we will just buy that time we will copy and paste our apk file from our laptop to a tablet ok now here is your application we will see that it will change after 5 seconds every 5 seconds now he is going to copy that apk file from from the from the pen drive to the tablet for that we have apk installer now it will ask for installing we need to open it ok see that is an image which is changing after every 5 seconds ok see it changes after every 5 seconds so this is any program we made with this