Google Android


Published on

Published in: Technology
  • Njce! Thanks for sharing.
    Are you sure you want to  Yes  No
    Your message goes here
  • How To Setup Android Application Development Environment

    Android Development Environment in Eclipse

    It is very easy to set up Android Development Environment on Eclipse. First of all you need to download the tools and software. You must download followings

    Java SE Development Kite (JDK 5 or newer)
    Eclipse IDE for Java Developer
    Android Software Development Kit
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Google Android

  1. 1. Android Basics Getting started to Android Development
  2. 2. Agenda <ul><li>First things first </li></ul><ul><li>Creating your first Activity </li></ul><ul><li>Android Basic Building Blocks </li></ul><ul><li>Important Building Blocks </li></ul><ul><li>Understanding Hello Android </li></ul><ul><li>Demonstration. </li></ul>
  3. 3. First things first ofcourse we need JDK 5 or later Android SDK 1.0_r2 at
  4. 4. First things first <ul><li>Get Eclipse with ADT plug -in (other IDE is also applicable) </li></ul>1. Select Help > Software Updates > Find and Install … from within Eclipse. 2. In the resulting dialog box, choose Search for new features to install. 3. Select New Remote Site, and enter the following address into the dialog box: 4. The new site you entered should now be checked. Click Finish. 5. Eclipse will now download the plug-in. When it’s fi nished, select Android Plugin > Developer Tools from the resulting Search Results dialog box, and click Next. 6. Read and then Accept the terms of the license agreement, and click Next and then Finish. As the ADT plug-in is not signed, you’ll be prompted before the installation continues. 7. When complete, you’ll have to restart Eclipse and update the ADT preferences. Restart and select Window ➪ Preferences … (or Eclipse > Preferences for the Mac OS). 8. Then select Android from the left panel. 9. Click Browse …, and navigate to the folder into which you unzipped the Android SDK, as shown in Figure 2-3; then click Apply and OK.
  5. 5. Creating your first Android Activity <ul><li>Just like your normal Eclipse Project except that we are now creating a project for Android. </li></ul>
  6. 6. Android Basic Building Blocks <ul><li>Activities - UI component typically corresponding to one screen. </li></ul>Android uses a special class called an Intent to move from screen to screen. An intent describes what an application wants done. There is a related class called an IntentFilter . It is a description of what intents an activity (or BroadcastReceiver, see below) is capable of handling. <ul><li>Broadcast Intent Receiver - a way to respond to an external event like notifications or alarm. </li></ul><ul><li>Services – Faceless tasks that run in the background. </li></ul><ul><li>Content Providers – Enable applications to share data. </li></ul>
  7. 7. Important Building Blocks VIEWS – are also known as widgets, gui components , can be basic, fancier and customized in Android. LAYOUT – Controls how views are being laid out : FrameLayout : each child a layer LinearLayout : single row or column RelativeLayout : relative to other Views TableLayout : rows and columns AbsoluteLayout : <x,y> coordinates and they have LAYOUT Parameters – specifies many aspects of what is being rendered. RESOURCES - res/layout: declarative layout files res/drawable: intended for drawing res/anim: bitmaps, animations for transitions res/values: externalized values for things like strings, colors, styles, etc. res/xml: general XML files used at runtime res/raw: binary files (e.g. Sound) NOTIFICATIONS - A Notification is a small icon that appears in the status bar. Users can interact with this icon to receive information. AndroidManifest.xml - file is the control file that tells the system what to do with all the top-level components you've created. For instance, this is the &quot;glue&quot; that actually specifies which Intents your Activities receive.
  8. 8. Understanding Hello Android - Activity import; import android.os.Bundle; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
  9. 9. Understanding Hello Android – Layout XML <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <LinearLayout xmlns:android=&quot;; android:orientation=&quot;vertical&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot; > <TextView android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;wrap_content&quot; android:text=&quot;@string/hello&quot; /> </LinearLayout>
  10. 10. Understanding Hello Android - AndroidManifest.xml <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <manifest xmlns:android=&quot; d&quot; package=&quot;;android:versionCode=&quot;1&quot;android:versionName=&quot;1.0.0&quot;> <application android:icon=&quot;@drawable/icon&quot;android:label=&quot;@string/app_name&quot;> <activity android:name=&quot;.HelloAndroid&quot; android:label=&quot;@string/app_name&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot; /> <category android:name=&quot;android.intent.category.LAUNCHER&quot; /> </intent-filter> </activity> </application> </manifest>
  11. 11. Demonstration Simple CurrencyConverter