Android

Split view in Layout | Android

android:layout_weight assigns weight to the children of LinearLayout. For example, if there are three child items within the LinearLayout, then the space assigned will be in proportion to the weight which means the child with larger weight will be allow to expand more. Be sure to set the layout_width to 0dp or your [...]

2019-12-24T11:32:06+05:30Categories: Android|

Relative Layout | Android

RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left or center). Center [...]

2019-12-24T11:11:13+05:30Categories: Android|

Fragment | Android

Introduction A Fragment is a piece of an application's user interface or behavior that can be placed in an Activity. Interaction with fragments is done through FragmentManager. Fragments must be embedded in activities; they cannot run independently of activities. Like an Activity, a Fragment has its own lifecycle. An Activity [...]

2019-12-22T21:56:55+05:30Categories: Android|

FragmentManager | Android

Introduction FragmentManager help us to handle Android fragment trasaction between fragments.  With Android fragment transaction we mean a sequence of steps to add, replace or remove fragments. FragmentManager interacts with Fragment which are within an Activity. A fragment can be created by following ways Static method Dynamic method Static Method [...]

2019-12-22T21:41:02+05:30Categories: Android|

android:name Attribute | Android

The android:name attribute in the <fragment> specifies the Fragment class to instantiate in the layout. When the system creates this activity layout, it instantiates each fragment specified in the layout and calls the onCreateView() method for each one, to retrieve each fragment's layout. The system inserts the View returned by [...]

2019-12-22T21:09:28+05:30Categories: Android|

Bitmap | Android

Introduction A bitmap is a digital image composed of a matrix of dots. When viewed at 100%, each dot corresponds to an individual pixel on a display. A bitmap can be acquired by loading a file, reading in a collection of bytes or even taking a photo from device camera. [...]

2019-11-30T22:23:20+05:30Categories: Android|

BitmapFactory | Android

Introduction The Bitmap (android.graphics.Bitmap) class represents a bitmap image. You create bitmaps using the BitmapFactory (android.graphics.BitmapFactory) class. Bitmaps can be created using BitmapFactory from a resource, a file, or an InputStream. From file Pass path to the image to BitmapFactory.decodeFile() to load the image previously copied to the sdcard. The [...]

2019-11-30T21:58:42+05:30Categories: Android|

Activity for result | Android

To get data from our other activity (Say SecondActivity) that is opened by an activity(Say MainActivity), use startActivityForResult().  SecondActivity send back result via intent. While sending back intent it will set the response using setResult() RESULT_OK : Result send is OK. RESULT_CANCELED : Activity cancel to send result. Finally in [...]

2019-12-02T22:34:04+05:30Categories: Android|

Serialization and Parcelable | Android

Primitive data types like string, integer, float, etc. can be passed through intents, by putting the data with unique key in intents and send it to another activity. To send Java class objects from one activity to another activity using the intent, object passing techniques are Serialization and Parcelable. Parcelable [...]

2019-11-21T00:01:23+05:30Categories: Android|

ItemDecoration | Android

RecyclerView.ItemDecoration is used to decorate the children of a RecyclerView. RecyclerView is a ViewGroup, with each of its children representing an item in a list. With ItemDecoration you can easily modify the appearance of these child views. Methods in RecyclerView.ItemDecoration class are getItemOffsets() : Provides offset data onDraw() : Draws [...]

2019-11-19T00:18:22+05:30Categories: Android|
Go to Top