 Welcome to Android workshop. First of all, very good afternoon to all of you. Myself Niles Singh, I'm going to take next three sessions. In this session, I'm going to cover installation part, then about the Eclipse ID, and then simple applications. So let's start with the first how to we can install and configure Android on our system. For that, we need to know about three things. One is tools and some solvers. We have to download from the internet. So here you can see, first we have to download JDK6, that is Java development kit and above. Then this is exactly the software that you have to download from the given link. And after that, there is Eclipse plus IDE and SDK. This thing you can download from the download and Android developer.android.com. So this tools and software you can download from the given link. After downloading this, we have to extract and we have to install this software for the Android. So let's start with the installation. We can install in the two ways. First is that as an online installation and second is offline installation. So first, we'll start with the online installation, how we can configure our Android online. For that, we have to go to Google. So first we'll open that Google. In Google, we have to type SDK, again same way Android SDK. So it will give you directly that page that is developer.android.com SDK, index.html page. You have to click on this link. So after clicking, we will get again same window as we saw in developer site. So here, based on our opening system, we have to use this, we have to download ADT bundle. So here, there is a Windows 32 bit, there is Windows 64 bit, then Linux 32 bit and 64 bit. I am working on Linux 32 bits. I will click on this ADT bundle, Linux x86. If you are working on Windows 32 bit, then you have to click on Windows 32 bit, ADT bundle. Then accept the license, download and save. Now this process here, this process will take two minutes. As I said, the time will take depends on your bandwidth. This basically the size, you can see the size 399 MB and at the per second, we are downloading plus 2.2, 2.5 MB per second. So this takes at least two minutes. Now it is downloaded. Then go to ADT bundle. Click on open containing folder. Right click on this and extract this folder into your desktop. Here I am extracting this folder into my desktop. So you can extract anywhere in your system. So I am extracting this to my desktop. I have created one folder that is endowed setup on that I am extracting. So again it will take some seconds to extract. So click on now show the files. Here the same you will get the ADT bundle, Linux x86. Click on this. Again you will get two folders Eclipse and SDK. Inside the SDK folder, you will get five folder. The important folder is that is platform. Inside the platform, you will get by default platform that is API level 17, that is 4.2 Jelly Bean. It is already installed in your Eclipse. If you want to install lesser version, then we have to install online. And the other five folders are the supporting folders and each folder contains some plugins. Now we will start installing online. For that again we have to go to click on Eclipse. Then we have to start our Eclipse. We will ask you for the workspace. You can create your workspace anywhere in your drive or in your desktop. Basically your workspace is already fine. This workspace will contain your project files. So I have created the workspace Android work. It will take some seconds to open. This is exactly your Eclipse IDE. Now to install online, we have to go to Windows. Click on Windows. Then we have to open Android SDK manager. And again same, we got that 4.0.3, then 2.3 and 2.2 and all from the first version to the latest version. That is from 1.5 to 4.2. So it depends on your, as I said, depends on your device. If your device is 4.0.3, then you can select this Android version 4.0.3. Basically I am working on Akash Tablet. So by default I am selecting this 4.0.3. That is the version of your Akash Tablet. And basically this is your proxy. If you are in a proxy, your lab is in a proxy, then you have to give proxy, username and password. And suppose if you are not given your username and password, then you have to go to... So after giving username and password, if you are not in a proxy, then you have to give the proxy server name and password. For that you have to go tools and then this window will appear. Then you have to give the server name and the port address. And after that select your Android versions. I have selected 4.0.3, then 2.2 and by default we have to select extra. Click on this button, install 18 packages, accept license and start installing. So now you can see here, you can see the downloading SDK platform Android 4.0 API level 15 means we have started our download. Now this process will take at least 1 hour or 1.5 hour, depends on your bandwidth. So here is already installed now. You can see after installing, we will get all versions installed, that is selected version installed, that is 4.0.3. Now after installing online, we have to create AVD. AVD is what is your virtual, Android virtual device. So you have already created one. So I am deleting this. For creating new, we have to click on new. Then we have to write the AVD name. Any name you can write. Then the device, I am selecting 5.1, that is 418 to 800 resolution. And my target is 4.0.3. As I said, I am working on Akash. So I will select this version. So here that is SD card. If I have an external SD card, if I want to, so you can give your SD card size. Say I am giving you a 1024. So this 1024 is your external SD card size. 1024 is equal to your 1GB. Then click OK. Your emulator is created. Select that and click start and launch. This is your emulator. Here you will get your output. This is the way we can install online or eclipse. Now we will see how to install offline. Again, to install offline, we require JDK6. We have to install this JDK6. And then offline eclipse and edit SDK. We are required. So both the things you can download from here. But how we will get the offline SDK? So as we have installed online, so whatever the platform we have selected, all those platforms we will get in your SDK folder. So after that, downloading those versions, you can take that SDK and you can use that SDK for the other eclipse. For that, we have to follow this process. So configuring Android offline. Again, here I am downloading that ADT bundle from online. As we have followed the same process in installing online, again we have to select our ADT bundle Linux 32 bit. So this is 64 bit. I have working 32 bits. I will download this 32 bit. Again, we have to accept the license. Save it. So as I said, I have already installed this. Downloaded this. So now you can see here it's taking very less time. 55 seconds. So I have already downloaded it. So no need to download. Again, you can use your old downloaded ADT bundle. Open containing folder. Extract this folder into anywhere in your system. I am extracting in my desktop. So it will take some seconds to extract. Now after extracting, we have to go to our extracted folder. Here is my extracted folder. Double click on this. It will show you again two folder that is eclipse and SDK. Now from here, we have to directly open our eclipse. Then inside the eclipse again, it will ask you workspace. You can create your own workspace anywhere in your system. So I have created Android work folder in my desktop. Now we will get the eclipse ADE. From here, we have to select our offline SDK. So for selecting offline SDK, we have to go to Windows. So offline SDK in the Android SDK folder. This is my offline SDK. So I am giving the path of this offline SDK to this eclipse. So for that, we have to go to Windows. Then preferences. And after that, left hand side, we have to click on Android. Then we have to browse that SDK folder from Android setup. And my Android setup is on my desktop. Click OK. Apply. We will get all those versions. Inside that SDK, I have only three versions. So we will get only these three versions. Click OK. So now this is the way we can install offline. Again, the same way if we want to create some Android virtual device. So again, we can follow the same process as we have followed in while configuring Android online. This is exactly after installing your SDK in eclipse. After that, we will get this. Again, it will ask you for your username and password. So you can see this was 4.0.3 is installed. Then 2.2 is also installed. 4.2 is installed. After that, if you want to create AVD, you can follow the same process as we have followed in while configuring Android online. So already I have created one AVD. So let's delete this. We can create one more AVD here. For that, we have to click New. Then you can give any AVD name. Then we have to select the target. I'm selecting 4.0.3. You can give your SD card size. I'm giving 1024. That is 1 GB. Now to create AVD, it will take some time. At least 32, 40 seconds to create this. Then select that and launch. Now again, we will get the same AVD or emulator here. This is exactly where we will get the output. This is the way we can configure offline or Eclipse. Now we saw that how to configure Android online and offline and how to create AVD. Now after that, we should know something about Eclipse. So this Eclipse, I am using Eclipse IDE for creating projects in Android. You can use NetBeans and other IDEs also. So first we have to see the Eclipse IDE. In the Eclipse IDE, these are the four components that are very important. That is Package Explorer, DDMS, Lockcat, Console. All these four components are important. As a point of view of your Android. So let's see what is the use of these packages. What is your Package Explorer, DDMS, Lockcat and Console. Basically this Package Explorer is where you are going to create. If you create your application, it will give you the project structure of your application. So I will show you that your project structure. Here you can see this is my Package Explorer. So in this Package Explorer, if I am creating any application, suppose my application name is SimpleApp. So in this, we have to write the application name. Then the same application name we will get as a project name. Then you can create your own package name. Suppose I am creating my package name is com.SimpleApp. Then we have to select some minimum required SDK. So I need minimum required SDK format. This application is 2. So 2.2. So I will select this by default is 2.2. Now my target should be 4.0.3 because I am working on AkashTabit. So the configuration, the Android version of AkashTabit is 4.0.3. So I can run this application on my AkashTabit. Then if I want to also compile with same this 4.2, click on next. Again you can create your own activity. I am creating my activity name is Simple. Now here you can see by the Java convention, we have to give the first character should be the activity name. The first character should be capital. So here you can see inside the package explorer, I am getting Simple app application. Inside the Simple app, I have some like this application of some structure. So in this structure, we have this SRC folder. This SRC folder contain the packages, sorry, package of our application. So inside that package, I will get one Java file. So this Java file contains some by default code. We will see what is that use of this by default code when we can use this, when I will create one application. And another is generated Java file. So here in this folder, we will get the two files that is buildconfig.java and r.java. In this, this is r.java is important. So this r.java is auto generated when I am using any widget at that time, it will automatically create one constant value. We will see about the r.java also. And you can see the target, I have targeted version, use version is that is 4.2. So they have mentioned here 4.2. Then inside the, this has been, here we will get the .apk file. When we will compile, after that we will get that apk file. So first we are just see that what are the project folders, like project structures we have. And then important folder is that is res. This res contains some, lots of folders. So in this we have the important folders are drawable, layout, value. So inside that we have some, in this two folder, layout and values, we have some XML file. And in drawable, you can see this is one image. This image is your icon image of your application. You can change this image from your manifest file. Now we will see exactly about your manifest file first. So here you can see this is our manifest file. This file contains the minimum SDK version and the targeted version that is 15. And then the IC launcher. This IC launcher is what the icon of our application. As I have shown you here in the structure this, we can change this, we can give the any another image here and we have to just change the name of your, name of your, this drawable, this icon name. And then inside the application, another is what you are at string dot app name. So whatever the app name we have given there, they will take that app name. And inside that application we have one activity tag. This tag will show us the package of our application. Then the, again, label the of your application and the launcher. This is exactly simple manifest file. We can use this manifest file to, for the intent, to use for the, when we are using intent at that time we require this manifest file. So we will see this also, what are the, another use of this manifest file later. So in the project structure, the main file is that is your layout, this. So this is our layout file. Suppose if I am giving, dragging any, dragging any button in this application, this layout. So we can take this button from here to here. This buttons and text views all this called as your widgets. So and when we will click on, double click on this. So we will get the auto generated code of our button inside the XML file of your activity. So here this is a, by default we will get one ID generated here. Suppose instead of that button, if I want to use some text views. So we can directly drag and drop here. And if I am, use or double click on that, we will get the, again the auto generated code in activity simple app.xml file. So this is the way we can at least design our layout. So there are lots of widgets we have in this. So after designing layout, we need to access this but widgets from this layout to from here to Java file. To access this, we have to use, we have to write one code inside this Java file that is for writing code we have to first create. Suppose I want to access button. So here I am going to access this button. So we need to remember the ID of this button. For accessing button, we have to write class button class. Then B1, B1 is object. And we have to do some casting in this button. Then find view by, find view by ID. From the control space, you will get that method. And here we will get the auto generated some options. So here I want to use r.id. So here I get the option to select that is edit. I want to select button. So I will select button, button 1 is my ID. So there is some error. When I am going to this button, I will get one option. So this is exactly your auto correct options. So very first link you can see there is an import button where I am clicking on this. So here my error is removed from this line from button. Then here create field. If I am clicking on this, then in r.java, I am creating one constant. So using this find view by ID, we can access this button. So same way you can access the other widgets. You can access again, if you want to access this text view, then again you have to write some code for the text view. So this is like now we will run this application. Before running, we have to create avd here. We do not have avd. To new, creating avd2. I am giving the internal size 1024. Click OK. It will take some time to create avd. Right click on your application. So for the output, it will take some time. So we will start the another application, when and after that we will see this output. The another topic is that is understanding our project structure. As I said about your src folder contains .java file and bin folder will contain. After compiling that application, we will get one apk file inside the bin folder and this assets folder. By default here we can see we have got that asset folder and then another is res folder. Inside that res folder, we will get the drawable, then layout and the value. Inside the layout folder, we saw that we got one XML file. We got the XML files. Then in value folder, we have some string.xml file. Now about your android manifest file. Every application must have this android manifest.xml file. The manifest present essential information about your application. Actually this manifest file following have something that is the name of your Java packages, then the minimum SDK and the maximum SDK and the some permission. Suppose if you want to give your application for the internet permission, then you have to give the internet permission from this android manifest file. Or if you want to access camera, then you have to give the to access camera. You have to give some permission to your application from this android manifest file. So, this android manifest file have a very important aspect in our project structure, in our application. Then as we saw the r.java folder, r.java file inside our application, that this r.java is auto generated file that added to your application by the android plugin. This file contain pointer, the drawable, layout and value directory. And you should never modify this file directly. You will be only referencing r.java most of your applications. So, whatever the widgets you have created in application, using your application, this r.java will contain the pointers of those widgets. And it will be not modified by, it should be not modified by the user. This is, you can see that our r.java code drawable. Then the, you can see the icon. This is exactly the, your constant value of your icon. Then layout the main constant value of your main dot XML. So, these are the constant value. Automatically you will, it is generated by your android. Then next is, as we saw in the project structure, that is resources. Inside the resources, we will get the drawable folder. Inside the drawable folder, we have a ic launcher dot png. So, this is the icon of our application. Then again we have drawable, another drawable that is LDPI, MDPI, XHDPI, all these are like this folder will covered in resource section. And there is the layout folder. Inside that the main is that activity main dot XML. This is important because using this dot XML file, we can set our layout. And then the string dot XML. We will see what is the use of this string dot XML. As we saw about the resources, we saw that ic launcher dot png. Then the main dot XML, your main dot XML is your, this file. You can give your, while creating you can give this name or you can give, it means you can give this name. You can give any name because this is a user defined. And your, this string dot XML file is void of all creating in your value folder. And this string table to help, we can use this for the localization of our application. Then the next is that assets. The assets exactly this folder have some, we can give some text boxes, sorry text files, XML files, music or video files into this folder. And from this folder, we can access those files and video file or text file, anything we can access from this asset folder. Now we will see the structure of assets. Here you can see here the assets and these are the some text file and JPG file. We can access this file using this code. There is another way to access this asset. It will cover in a later session. And exactly what is the, what are the things we have in assets? That is your, depends on your ID. Android does not generate ID for the asset contents. And if we are using the another resources like, if I am using a ReS folder inside that, we are generating main dot XML ID. That is a constant value. So, for the asset, we do not require any constant value. Then the widgets, here exactly widgets is what as we saw, we have dragged and drop one button and then text view. All those things are your widgets. So, in the Android or that project form widget, this tab, you can find the lots of widgets we have in Android. I have dragged and drop only the simple widgets from this widget form. So, inside that widget form, you can find the lots of widgets like about, if you want to use image, then you can use the image widgets. If you want to play some video, then you can use video. Widgets, video view widgets. There are lots of widget we have in Android. So, there are some example I can show. You can see this widget. This widget is showing your weather information. The degrees and some about your weather information. And another is your list view where you can list your data. You can fetch some data and list into your system application. So, this kind of widgets we have in our Android. Now, we will see that application which I have run in this. You can see here, I got the output that is large text and this button. This is the way we can create and run our application. Suppose in the same application, if I am clicking on this menu button, then my application name was simple app. So, my application name was simple app. This is my simple app. Click on this. I got this output. Now, you can see the icon of this app. I can change this icon. So, how I can change this icon? For that, I have to copy one image. Suppose I am copying this screen.png image into my drawable screen.png is there. Then, we have to go to Android manifest file. Here, just we have to give the screen the name of our file. That is screen. First check this is the name screen.png. So, I have given that screen. Save this and run this application again. You can see this in console that you are getting the message that is installing, installing simple apk and you will get after that you will get message success. So, means your apk is successfully installed into your device. You can see this is the my icon. I have changed my application icon. So, this is the way we can change our application icon using Android manifest file. Now, we will run some simple application. I have created one application. So, let me import that. For importing any application from your driver desktop, any driver desktop, to general, existing project space, browse, go to your file folder, application is here, finish. So, inside this, I am going to add two numbers. So, let me show you the layout of this application. This is the my layout. You can see I have used your two text boxes and two buttons. I am here adding and multiplying two numbers. And after that, I will get the result in this text area, text view. So, for manipulating the value of this text boxes or accessing this text box, sorry, edit text and this text views and this buttons, we have to access this from the Java file. For that, we have to use again the same, we have to use find view by ID. So, let us go to the Java file. You can see inside the Java file, I have created the two objects for the edit text and two objects for the button. One button is for addition and one button is for multiplication. And another is for the text view. I am accessing only those widgets which is required for our application. So, this button and this one text view are required, but you can see I have used three, four text views. But in the output, I required only last one, this C here. Here, I am going to display my value and all these are the constant. So, again, I have accessed this find view by ID. I have accessed this widgets using find view by ID. You can see the ID of those widgets. Then, here I am performing some click event. So, I am generating some click event. For that, I have to give set on click listener to buttons. So, I have used for the B1 to as a set on click listener for B1 and again same for the B2. Then, inside this, the class click, I have used this interface on click listener. And then, I am parsing the value of your edit text. That is integer.parsing then even I am getting the text that get text then to string and I am keeping this value into your K variable and another value into J variable. The value of edit text 1, I am keeping in K and value of edit text 2, I am keeping in B. And after that, when I am keep pressing button 1, so it should add. Otherwise, it should, it will be multiply. Let us see this, how we will get this, what result we will get? To run this application, click on addition, run. Now, installing up addition dot apk then success. So, successfully installed. I am giving any number here. Suppose, I am giving 3, 5. If I am clicking on add, I will get result here 8. If I am clicking on multiply, I will get result 15. So, this is the way we can at least create one simple application in Android. Next is that summary. Now, we will see what are the topics we have covered in this. First is that installation in the very first, when I was started that installation, there was some problem for the visibility. So, I have shown you that video, the same video you can download from the GitHub link. And another is that is how we can install in this installation, how we have, we can install online and offline your Android. And after installing and configuring our Android, we have created AVD. This AVD, basically we will use to display some, sorry, display the output, output of your application. Then, we have used the familiarization with the eclipse, means about the eclipse. This eclipse ID, if you want to know more about the eclipse ID, you can download, you can see the video from the spoken tutorial. Then, I have covered the resources, then the Android manifest dot XML file and some widgets. You will get the lots of widgets when you start learning Android. We have lots of widgets in this. For the references, you can refer the developer side is very good for your Android tutorial. Thank you.