• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to fragments in android
 

Introduction to fragments in android

on

  • 4,543 views

Introduction to fragments in android by Ritesh Bhattarai

Introduction to fragments in android by Ritesh Bhattarai

Statistics

Views

Total Views
4,543
Views on SlideShare
4,498
Embed Views
45

Actions

Likes
1
Downloads
71
Comments
0

2 Embeds 45

http://mobilenepal.net 42
http://www.mobilenepal.net 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to fragments in android Introduction to fragments in android Presentation Transcript

    • An Introduction ToFragments In Android By: Ritesh Bhattarai (reetesh.com.np)Date: 13th October, 2012
    • What is a fragment?A fragment is, as the name suggests, a chunkof user interface with its own lifecycle whichmust exist within an activity.Multiple fragments can be used in a singleactivity to form a multi-pane UI or reuse afragment in multiple activities.
    • Advantages of fragments• It can modularize a single activity into smaller units of UI, making it more flexible and easier to manage.• A fragment can exist without a UI screen and act as an invisible worker for the activity.• A fragment can be reused with multiple activities.• A fragment lets us maintain a "back-stack" of its state.
    • Implementation in different screens
    • Implementations in paged layouts
    • Writing Fragment LayoutA fragment layout is similar to an activity layout.
    • Writing A Basic Fragment Class
    • Including Fragment Into Main Layout
    • Writing Main Activity Class
    • Fragment TypesListFragmentDialogFragmentCustom Fragment (e.g Grid)
    • CompatibilityYou can download the compatibility package using the AndroidSDK Manager as shown below.
    • Compatibility (contd.)To use the compatibility package, you must addit to your project and include in the build path.This can be done by Right clicking your Androidproject-> Selecting Android Tools-> Addcompatibility Library.
    • ResourcesAPI Guidehttp://developer.android.com/guide/components/fragments.htmlTutorialshttps://github.com/posco2k8/fragment_basic_tutorialhttps://github.com/posco2k8/fragment_tabs_tutorialExampleshttps://github.com/jrgleason/android-fragments-example
    • Thank You