Basic android development

  • 626 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
626
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
35
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. BASIC ANDROID DEVELOPMENT
  • 2. WHAT IS ANDROID? Google created software stack for creating comprehensive Mobile Applications and Software to realize the full potential of one’s Mobile handset and its possibilities. Comprehensive software stack of mobile devices that includes an operating system, middleware and key application. Used in Mobile Technology through its innovation module of The Android Software Development Kit (SDK).
  • 3. ITS VERSIONS  Pre-commercial release versions (2007–2008)  Android Alpha  Android beta  Version history by API level  Android 1.0 (API level 1)  Android 1.1 (API level 2)  Android 1.5 Cupcake (API level 3)  Android 1.6 Donut (API level 4)  Android 2.0 Eclair (API level 5)  Android 2.0.1 Eclair (API level 6)  Android 2.1 Eclair (API level 7)  Android 2.2–2.2.3 Froyo (API level 8)  Android 2.3–2.3.2 Gingerbread (API level 9)  Android 2.3.3–2.3.7 Gingerbread (API level 10)  Android 3.0 Honeycomb (API level 11)  Android 3.1 Honeycomb (API level 12)  Android 3.2 Honeycomb (API level 13)  Android 4.0–4.0.2 Ice Cream Sandwich (API level 14)  Android 4.0.3–4.0.4 Ice Cream Sandwich (API level 15)  Android 4.1 Jelly Bean (API level 16)  Android 4.2 Jelly Bean (API level 17)  Android 5.0 Lime Pie (To be Launched Soon...)
  • 4. More About Android Company / developer : Google / Open Handset Alliance Android Open Source Project Programmed in : C, C++, Java OS family : Unix-like Initial release : September 23, 2008 Latest release : 4.2.2 Jelly Bean / February 11, 2013 Marketing target : Smartphones, Tablet computers Package manager : Google Play, APK Supported platforms : ARM, MIPS, x86, I.MX Kernel type : Monolithic (modified Linux kernel) License : Apache License 2.0 Linux kernel patches under GNU GPL
  • 5. IMPACT ON TODAY’S MARKET Android powers devices from some of the best handset and tablet manufacturers in the world, like Samsung, HTC, Motorola, Sony, Asus and more. Flip-out keyboard or on-screen, from smartphone to tablet and at every possible price point, there’s an Android device for everyone making it the world's most widely used smartphone platform. Android devices can be controlled with voice by Simply touching the microphone on the keyboard and talking to write emails, SMS etc. Text appears without any span of time.
  • 6. • Helps in creating Open Sourced Mobile Applications. Communication Application Business Application Multimedia Application Internet Application Fun/Entertainment Application Gaming Application Utility and Security Application • Features like Face Unlock — which uses facial recognition to let you unlock your device with a smile. • Android Beam — which lets you share contacts, directions and more by touching two devices together.
  • 7. The Android software development kit (SDK) includes a comprehensive set of development tools. These include a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials. Development platforms include Linux, Mac OS X, Windows XP. The officially supported integrated development environment (IDE) is Eclipse using the Android Development Tools (ADT) Plugin.
  • 8. Google provides the Android Development Tools (ADT) to develop Android applications with Eclipse. ADT is a set of components (plug-ins) which extend the Eclipse IDE with Android development capabilities. ADT contains all required functionalities to create, compile, debug and deploy Android applications from the Eclipse IDE. ADT also allows to create and start AVDs. The Android Development Tools (ADT) provides specialized editors for resources files, e.g. layout files. These editors allow to switch between the XML representation of the file and a richer user interface via tabs on the bottom of the editor.
  • 9.  HOW TO CREATE A NEW PROJECT?  XML DESIGNING  EMULATOR  DEBUGGING THE APPLICATION  FOLDERS IN ANDROID APPLICATION  CANVAS CLASS FOR GAMING  GOOGLE PLAY (ANDROID MARKET)  DEPLOYING
  • 10. ADDITIONAL INFORMATION  Application Name : This name is used as the title of your application launcher icon when it is installed on a device.  Project Name : This text is used as the name of the folder where your project is created.  Package Name : This class package namespace creates the initial package structure for your applications code files and is added as the package attribute in your application's Android manifest file.  Minimum Required SDK : This setting indicates the lowest version of the Android platform that your application supports. This value sets the min SdkVersion attribute in the <uses-sdk> element of your manifest file.
  • 11. ADDITIONAL INFORMATION  Target SDK : This setting indicates the highest version of Android with which you have tested with your application and sets the target SDK Version attribute in your application's' manifest file. Compile With API version : This setting specifies what version of the SDK to compile your project against. It is strongly recommended to use the most recent version of the API. Theme : This setting specifies which standard Android visual style is applied to your application.  Google Play requires that every Android application uses its own unique package. Therefore, reverse domain name is used as package name. This avoids collisions with other Android applications.
  • 12. The Padding, style and background colour of the icon can also be changed. There are various icons in the Clipart which can be chosen according to one’s convenience. One can switch on to text instead of any image as an icon.
  • 13. XML DESIGNING The XML Designing can be done in two ways : By Dragging, Dropping and Positioning items from the Palette to its Graphical Layout (i.e. the UI view). Through Coding in .xml window (basically the backend of Graphical Layout) . One can select AppTheme, UI mode, alter changes in height, width, margins and gravity, switch from portrait to landscape or vice versa according to his/her convenience.
  • 14. DIFFERENT TYPES OF LAYOUTS FrameLayout is a layout manager which draws all child elements on top of each other. Which allows to create nice visual effects. LinearLayout puts all its child elements into a single column or row depending on the android:orientation attribute. Possible values for this attribute are horizontal and vertical, horizontal is the default value. LinearLayout supports assigning a weight to individual children via the android:layout_weight layout parameter. This value specifies how much of the extra space in the layout is allocated to the View. RelativeLayout allow to position the widget relative to each other. This allows for complex layouts. If you want to center a single component., just add one component to the RelativeLayout and set the android:layout_centerInParent attribute to true. GridLayout was introduced with Android 4.0. This layout allows you to organize a view into a Grid. GridLayout separates its drawing area into: rows, columns, and cells.
  • 15. UNDERSTANDING SYNTAXES  The match_parent value tells the to maximize the widget in its parent. The wrap_content value tells the layout to allocate the minimum amount so that widget is rendered correctly.  The ScrollView class can be used to contain one View that might be to big too fit on one screen. ScrollView will is this case display a scroll bar to scroll the context.  The android:fillViewport="true" attribute ensures that the scrollview is set to the full screen even if the elements are smaller then one screen.  android:versionName and android:versionCode specify the version of your application. versionName is what the user sees and can be any String and versionCode must be an integer.
  • 16. UNDERSTANDING SYNTAXES  android:name="android.intent.category.LAUNCHER" defines that this application is added to the application directory on the Android device.  The @string/app_name value refers to resource files which contain the actual value of the application name.  The uses-sdk part of the AndroidManifest.xml file defines the minimal SDK version for which your application is valid.  Various tags used in AndroidManifest.xml are manifest, uses-sdk, application, activity, intent filter, action etc.  Other tags which basically promote designing are RelativeLayout, TextView, EditText, Button etc.
  • 17. VIEWS AND LAYOUT MANAGER Views are user interface widgets, e.g. buttons or text fields. Widgets are interactive components which are primarily used on the Android homescreen.The base class for all views is the android.view.View class. Views have attributes which can be used to configure their appearance and behavior. A layout manager is responsible for arranging other views. The base class for these layout managers is the android.view.ViewGroup class which extends the View class. Layout managers can be nestled to create complex layouts. You should avoid nesting them too deeply as this has a negative impact on the performance.
  • 18. ITEMS WHICH CAN BE DRAGGED AND DROPPED IN THE UI VIEW OF .XML FILE Form Widgets : Buttons, Checkbox, Radio Buttons, Spinner etc. Text Fields : Textboxes, Password Boxes, Number Boxes etc. Layouts : Grid Layout, Linear Layouts, Frame Layout etc. Composite : Tabs, List View, Scroll View, Search View etc. Images And Media : Image Button, Video View, Gallery etc. Time And Date : Time Picker, Date Picker, Calendar View etc. Transitions : Image Switcher, Text Switcher, Stack View etc. Advanced : Texture View, Surface View, Number Picker etc. Others : Text Clock.
  • 19. EMULATOR  The Android SDK includes a virtual mobile device emulator that runs on your computer. The emulator lets you prototype, develop and test Android applications without using a physical device.  It runs a full Android system stack, down to the kernel level, that includes a set of preinstalled applications (such as the dialer) that you can access from your applications. You can choose what version of the Android system you want to run in the emulator by configuring AVDs, and you can also customize the mobile device skin and key mappings. When launching the emulator and at runtime, you can use a variety of commands and options to control its behavior.  During development and testing of your application, you install and run your application in the Android emulator. You can launch the emulator as a standalone application from a command line, or you can run it from within your Eclipse development environment.
  • 20.      
  • 21. DEBUGGING  Debugging allows you to run a program interactively while watching the source code and the variables during the execution.  By breakpoints in the source code you specify where the execution of the program should stop. To stop the execution only if a field is read or modified, you can specify watchpoints .  Breakpoints and watchpoints can be summarized as stop points.  Once the program is stopped you can investigate variables, change their content, etc.  If you are developing in Eclipse with the ADT plugin, you can use the built-in Java Debugger, along with DDMS, to debug your applications.
  • 22. .
  • 23. FOLDER STRUCTURE OF ANDROID APPLICATION MANIFEST FILE : xmlns:android Defines the Android namespace. This attribute should always be set to "http://schemas.android.com/apk/res/android". Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. It describes the components of the application — the activities, services, broadcast receivers, and content providers that the application is composed of. It names the classes that implement each of the components and publishes their capabilities.
  • 24. MANIFEST FILE It determines which processes will host application components. It declares which permissions the application must have in order to access protected parts of the API and interact with other applications. It also declares the permissions that others are required to have in order to interact with the application's components. It declares the minimum level of the Android API that the application requires. It lists the libraries that the application must be linked against.
  • 25. RES AND GEN FOLDER RES : Android supports that resources, like images and certain XML configuration files, can be keep separate from the source code. These resources must be defined in the res directory in a special folder dependent on their purpose. You can also append additional qualifiers to the folder name to indicate that the related resources should be used for special configurations, e.g. you can specify that a resource is only valid for a certain screen size. GEN : The gen directory in an Android project contains generated values. R.java is a generated class which contains references to certain resources of the project. If you create a new resource, the corresponding reference is automatically created in R.java via the Eclipse ADT tools. These references are static integer values and define IDs for the resources. The Android system provides methods to access the corresponding resource via these IDs.
  • 26. CANVAS API The Canvas API allows to create complex graphical effects. The Canvas class provides the drawing methods to draw on a bitmap and the Paint class specifies how you draw on the bitmap. The Canvas class  The Canvas object contains the bitmap on which you draw.  Provides methods for drawing operations, e.g. drawARGB() for drawing a color, drawBitmap() to draw a Bitmap, drawText() to draw a text, drawRoundRect() to draw a rectangle with rounded corners and much more. The Paint Class : The Paint class allows to specify the color, font and certain effects for the drawing operation.
  • 27. GOOGLE PLAY (ANDROID MARKET) Google offers the Google Play service in which programmers can offer their Android application to Android users.  Google phones include the Google Play application which allows to install applications. Google Play also offers an update service, e.g. if a programmer uploads a new version of his application to Google Play, this service will notify existing users that an update is available and allow to install it. Google Play used to be called Android Market.
  • 28. DEPLOYING AN APP Before you can deploy an app, you must verify your domain. Open the Marketplace page at (www.google.com/appsmarketplace) for the app you want to deploy. In the upper-right corner, click Add it now. Enter your Google Apps domain name and click on Go. Sign in to the Google Admin console. The Admin console for your Google Apps domain appears, and you are presented with the terms of service. Read it, then click I agree. Continue. If the app requires access to Google APIs, those APIs are listed here. To give the app access to the necessary APIs, click Grant data access. Click Enable app now or Enable app later. After you add your first app from the Marketplace, it can take up to 24 hours for user cookies to refresh and for that app to appear in the more menu in the universal navigation bar.