Getting started with Andrid Befre we begin, there is a prerequisite, which is t plug the Andrid device int yur cmputer, and lad the drivers fr the OS. In writing this article, I was using Windws XP, 7 (64 bit) and 8 (64 bit) fr the cmputer and OS. The Andrid devices I used were a Samsung Galaxy S III and a Nexus 7 tablet. In all I tried 5 cmputers, f which n 2 culd I crrectly install the Samsung Galaxy S III and Nexus 7 tablet. I went n the Internet t find slutins, the mst ppular thery hat t d with the MTP driver (Media Transfer Prtcl). Hwever nne f the slutins wrked. I als had an HP Slate 7 tablet, after searching the internet fr a windws driver, I discvered, much t my chagrin, there is n driver fr this tablet, s dn t g there! In cnclusin, if yu can t get yur device s drivers t lad, yu will nly be able t run in a simulated device mde. Installatin There is a very gd tutrial n installing Eclipse and the Andrid SDK n the internet. Here is the main link: http://develper.andrid.cm/training/basics/firstapp/index.html. It walks yu thrugh building yur first app and tells yu what yu need t install s yu can build yur first app. Mst f it is accurate but there are a few errrs. Hwever I d recmmend yu read the pages s that yu get the mst ut f this but yu can skip. Here is a synpsis with crrectins. Starting here: http://develper.andrid.cm/sdk/index.html. It tells yu t d these 3 things: 1. Dwnlad the Andrid SDK. 2. Install the ADT plugin fr Eclipse (if yu ll use the Eclipse IDE). 3. Dwnlad the latest SDK tls and platfrms using the SDK Manager. S, Step 1. Dwnlad the Andrid SDK. This includes Eclipse and Java all in ne. G t this link: http://develper.andrid.cm/sdk/index.html, and click n the buttn Dwnlad the SDK ADT bundle fr Windws, and fllw the n screen prmpts fr T s & C s, 32 r 64 bit (the article suggests yu use the 32 bit versin even if yu have a 64 bit IDE) Yu will dwnlad a zip file. Once dwnladed, unpack it using the Windws Extract all feature r similar extractin tl. Cpy the entire cntents f the flder t sme directry n yur cmputer where yu will launch eclipse. On my cmputer I placed it: C:\adt-bundle-windws-x86-20130729\adt-bundle-windws-x86-20130729\eclipse.
Quting the instructins, That's it! The IDE is already laded with the Andrid Develper Tls plugin and the SDK is ready t g. Hwever there is a cautinary nte: D nt mve any f the files r directries frm the adt-bundle- <s_platfrm> directry. If yu mve the eclipse r sdk directry, ADT will nt be able t lcate the SDK and yu'll need t manually update the ADT preferences. Step 2, the ADT Plugin: http://develper.andrid.cm/sdk/installing/installing-adt.html The page title is a misnmer since it is called Installing the Eclipse Plugin but what yu are really ding is installing the ADT plugin. The installatin instructins are crrect s I ll plagiarize here: 1. Start Eclipse, then select Help > Install New Sftware. 2. Click Add, in the tp-right crner. 3. In the Add Repsitry dialg that appears, enter "ADT Plugin" fr the Name and the fllwing URL fr the Lcatin: https://dl-ssl.ggle.cm/andrid/eclipse/ 4. Click OK. If yu have truble acquiring the plugin, try using "http" in the Lcatin URL, instead f "https" (https is preferred fr security reasns). 5. In the Available Sftware dialg, select the checkbx next t Develper Tls and click Next. 6. In the next windw, yu'll see a list f the tls t be dwnladed. Click Next. 7. Read and accept the license agreements, then click Finish. If yu get a security warning saying that the authenticity r validity f the sftware can't be established, click OK. 8. When the installatin cmpletes, restart Eclipse. The next sectin f that webpage, Cnfigure the ADT Plugin can be ignred since it is dne autmatically by the steps abve. Yu wn t even see the Welcme statement discussed there, but it des take yu t the next and final step, adding platfrms and packages. Step 3, Adding platfrms and packages: http://develper.andrid.cm/sdk/installing/addingpackages.html The instructins here are crrect here as well, with ne exceptin. Yu can als pen the SDK Manager frm within the Eclipse IDE. Just click n Windw >> SDK Manager and cntinue n. Cntinuing with my plagiarizing: The Andrid SDK separates tls, platfrms, and ther cmpnents int packages yu can dwnlad using the Andrid SDK Manager. The riginal SDK package yu've dwnladed includes nly the SDK
Tls. T develp an Andrid app, yu als need t dwnlad at least ne Andrid platfrm and the latest SDK Platfrm-tls. 1. Launch the SDK Manager. If yu've used the Windws installer t install the SDK tls, yu shuld already have the Andrid SDK Manager pen. Otherwise, yu can launch the Andrid SDK Manager in ne f the fllwing ways: On Windws, duble-click the SDK Manager.exe file at the rt f the Andrid SDK directry. On Mac r Linux, pen a terminal and navigate t the tls/ directry in the Andrid SDK, then execute andrid sdk. 2. The SDK Manager shws all the SDK packages available fr yu t add t yur Andrid SDK. As a minimum cnfiguratin fr yur SDK, we recmmend yu install the fllwing: The latest Tls packages (check the Tls flder). The latest versin f Andrid (check the first Andrid flder). The Andrid Supprt Library (pen the Extras flder and check Andrid Supprt Library). Once yu've chsen yur packages, click Install. The Andrid SDK Manager installs the selected packages int yur Andrid SDK envirnment.
That s it. Yu can nw mve n t creating yur first app. The lessn starts n this page: http://develper.andrid.cm/training/basics/firstapp/creating-prject.html The instructins here are pretty clse, but as I have OCD tendencies, there are a few missins I want t crrect. 1. Launch Eclipse 2. File >> New >>Andrid Applicatin Prject. The fllwing dialg bx appears: 3. In the Applicatin Name text bx, enter My First App. The Prject name and Package name will aut ppulate. N need t change anything else, select Next >. 4. The next few screens are fine the way they are, s again, click Next >, Next > again, Next > ne mre time, then click n Finish. That s it. Yu have nw created yur first Andrid App, the standard Hell Wrld. Running yur new app: http://develper.andrid.cm/training/basics/firstapp/running-app.html This page is pretty clse t accurate; please read and fllw the instructins here. Yu will find sme valuable nuggets f inf. Same page mves n t Run n a real device. This sectin is very imprtant. If yu can t run this simple example nw, yu ll have a bunch f prblems later. Here it states fr yu t install yur Andrids OEM USB drivers. I suggested yu d this at the very beginning because it is critical t yu being able t cmplete this. The list is big, but nt inclusive f all manufacturers. Remember what I said abut the HP Slate 7.
One f the mst imprtant things t d here is enable USB debugging n yur device. The ne they dn t mentin, which I fund yu als must d, is g int yur device s security settings and enable Allw installatin f apps frm surces ther than the play stre. On the Galaxy phne and Nexus 7 tablet it is entitled Unknwn surces it shuld be the same n ther devices. Thugh the web page ges int running n an emulatr, which is beynd the scpe f this article. If yu cmplete this, and saw Hell Wrld! n yur device, then cngratulatins! Yu are ready fr mre. A few ntes: If yu have a nexus tablet and having a prblem getting it t cnnect t yur PC, there are a cuple things yu can d t get past this. 1. G int yur settings >> Abut device, and tap 7 times n the andrid versin r build number. This will enable develper ptins. 2. Cnnect yur tablet t the PC, g t the device manager, find the bad entry fr the tablet (r phne). Then g where yu installed Eclipse IDE, fr example: C:\adt-bundle-windws-x86-20130729\adt-bundle-windws-x86-20130729, click n flders SDK\ Extras\ Ggle\usb_driver. Cpy this path. Back t the bad device manager entry. Duble click n that device item, select update driver, and put this new path as the lcatin t get the driver. That shuld wrk. This may als wrk fr the HP tablet. Fund this n line: Ffind the Ggle USB driver andrid_winusb.inf which is lcated in sdk>\extras\ggle\usb_driver\. Add belw sectins and save it, ; HP %SingleAdbInterface% = USB_Install, USB\VID_03F0&PID_5E1D %CmpsiteAdbInterface% = USB_Install, USB\VID_03F0&PID_5D1D&MI_01 %CmpsiteAdbInterface% = USB_Install, USB\VID_03F0&PID_601D&MI_01 Manually install the driver fr the device, frm Device Manager by specifying the flder where the abve file is stred. After all these dne, restart ADB service t check the device (adb devices) 3. When yu g t run the Hell Wrld app, shuld yu get the errr, Andrid Failed t install HellWrkd.apk n device, it may be because yu have plugged in yur device int a lw pwered USB prt such as the nes n the frnt f yur cmputer r a USB hub. Or yu may be using an inferir USB cable, ie ne that has thin cnductrs. Tables cme with Beefy cables fr charging. I fund I needed t use that cable t cmmunicate with the PC as well.