Skip to main content

Posts

Showing posts from January, 2014

working with Fragments in android

Fragments are one of the most useful user interface components in android. Making of a very complex user interface made easy by using the fragments. We can easily categorize an android activity into separate modules using the fragment feature of android. Ads by Google   Why we use the fragment ? We know that there are a lot of android devices with different screen resolutions are available on the market. So the making of an android app for a particular device or resolution is not practical. Fragments help us to solve this problem. We can categorize the UI of an activity using fragments. If the app open in a high resolution device then the detailed representation of the activity shown and if it is a standard definition device then the system shows only one or more fragment view of that activity. You can implement the Fragments in two ways 1. Insert the Fragment directly in to the XML file of an activity. 2. Insert the Fragment programatically to an activity. W