Android Tutorial
Android history
The development of the Android operating system was started in 2003 by Android, Inc.
Later on, it was purchased by Google in 2005.
The beta version of Android OS was released on November 5, 2007.
while the software development kit (SDK) was released on November 12, 2007.
The first Android mobile was publicly released with Android 1.0 of the T-Mobile G1 (aka HTC Dream) in October 2008.
The code names of android ranges from A to J currently, such as Aestro, Blender, Cupcake, Donut, Eclair, Froyo, Gingerbread, Honeycomb, Ice Cream Sandwitch, Jelly Bean, KitKat and Lollipop.
1) Initially, Andy Rubin founded Android Incorporation in Palo Alto, California, United States in October, 2003.
2) In 17th August 2005, Google acquired android Incorporation. Since then, it is in the subsidiary of Google Incorporation.
3) The key employees of Android Incorporation are Andy Rubin, Rich Miner, Chris White and Nick Sears.
4) Originally intended for camera but shifted to smart phones later because of low market for camera only.
5) Android is the nick name of Andy Rubin given by coworkers because of his love to robots.
6) In 2007, Google announces the development of android OS.
7) In 2008, HTC launched the first android mobile.
Q - What is Android?
Android is a software package and linux based operating system for mobile devices such as tablet computers and smartphones.
- It is developed by Google and later the OHA (Open Handset Alliance).
Q- Explain Fragment
Introduction to Fragments | Android
Fragment is a piece of an activity that enables a more modular activity design. A fragment encapsulates functionality so that it is easier to reuse within activities and layouts. Android devices exist in a variety of screen sizes and densities.
Fragments simplify the reuse of components in different layouts and their logic. You can build single-pane layouts for handsets (phones) and multi-pane layouts for tablets. You can also use fragments also to support different layouts for landscape and portrait orientation on a smartphone.
The below image shows the use cases of fragments through navigations.
Fragment Lifecycle
Android fragments have their own lifecycle very similar to an android activity.
Looking to become an expert in Android App Development? Whether you're a student or a professional aiming to advance your career in mobile app development, our course, "Android App Development with Kotlin," available exclusively on GeeksforGeeks, is the perfect fit for you.
onAttach() : The fragment instance is associated with an activity instance. The fragment and the activity is not fully initialized. Typically you get in this method a reference to the activity which uses the fragment for further initialization work.
onCreate() : The system calls this method when creating the fragment. You should initialize essential components of the fragment that you want to retain when the fragment is paused or stopped, then resumed.
onCreateView() : The system calls this callback when it’s time for the fragment to draw its user interface for the first time. To draw a UI for your fragment, you must return a View component from this method that is the root of your fragment’s layout. You can return null if the fragment does not provide a UI.
onActivityCreated() : The onActivityCreated() is called after the onCreateView() method when the host activity is created. Activity and fragment instance have been created as well as the view hierarchy of the activity. At this point, view can be accessed with the findViewById() method. example. In this method you can instantiate objects which require a Context object
onStart() : The onStart() method is called once the fragment gets visible.
onResume() : Fragment becomes active.
onPause() : The system calls this method as the first indication that the user is leaving the fragment. This is usually where you should commit any changes that should be persisted beyond the current user session.
onStop() : Fragment going to be stopped by calling onStop()
onDestroyView() : Fragment view will destroy after call this method
onDestroy() :called to do final clean up of the fragment’s state but Not guaranteed to be called by the Android platform.
Types of Fragments:
Single frame fragments : Single frame fragments are using for hand hold devices like mobiles, here we can show only one fragment as a view.
List fragments : fragments having special list view is called as list fragment
Fragments transaction : Using with fragment transaction. we can move one fragment to another fragment.
UNIT - 2
Q - 1 Explain Android Architecture.
Twined Animation, often referred to as "Tween Animation," is a type of animation in Android that allows you to animate the properties of a view over a specified duration. This can include properties such as position, size, rotation, and alpha (transparency). Tween animations are typically defined in XML or can be created programmatically in Kotlin.
Key Concepts of Twined Animation
Types of Twined Animations :
- Translate: Moves the view from one position to another.
- Scale: Changes the size of the view.
- Rotate: Rotates the view around a pivot point.
- Alpha: Changes the transparency of the view.
Frame-by-frame animation, also known as sprite animation, is a technique where a sequence of images (frames) is displayed in rapid succession to create the illusion of movement. In Android, you can implement frame-by-frame animation using the Animation Drawable class. This method is particularly useful for animations that require a series of images to be displayed in a specific order.
Key Concepts of Frame-by-Frame Animation
- Frames: A series of drawable resources (images) that represent different states of the animation.
- Animation Drawable: A class that manages the sequence of frames and controls the timing of the animation.
- Duration: Each frame can have a specific duration for how long it is displayed before moving to the next frame.



Comments
Post a Comment