Android

Understanding Android Architecture Components  By Example

Android Architecture Components A new collection of libraries that help you design robust, testable, and maintainable apps. — developer.android.com We will see three main components : Room ViewModel LiveData So first, let’s find out what these components actually are. Then, we’ll learn how we can use them. Get Source code From HERE. By creating an Event app I …

Understanding Android Architecture Components  By ExampleRead More »

A Simple Basic Example of ViewModel

 ViewModelExample  is a very straightforward app with buttons that increase Or decrease  the no of items. The finished app has a bug though; if you rotate the phone, your selected number of items will again set up with the initial value.          What’s going on? Rotating a device is one of a few configuration changes …

A Simple Basic Example of ViewModelRead More »

Android Room Persistence Library Example

 Room Persistence Library Major problem with SQLite usage is There is no compile-time verification of raw SQL queries.For example if you write a SQL query with a wrong column name that does not exist in real database then it will give exception during run time and you can not capture this issue during compile time. …

Android Room Persistence Library ExampleRead More »

Android Working With Firebase Realtime Database and Storage

Firebase A fully managed platform for building iOS, Android, and web apps that provides automatic data synchronization, authentication services, messaging, file storage, analytics, and more. All the data is stored in JSON format and any changes in data, reflects immediately by performing a sync across all the platforms & devices. This allows us to build …

Android Working With Firebase Realtime Database and StorageRead More »

Android ViewPager Example To Create Sliding Screens

ViewPager Android ViewPager widget is found in the support library and it allows the user to swipe left or right to see an entirely new screen. Today we’re implementing a ViewPager by using Fragment and FragmentPagerAdapter. Get GITHUB code from Here. Creating New Project 1.In Android Studio, go to File ⇒ New Project and fill all the details required to …

Android ViewPager Example To Create Sliding ScreensRead More »

Android Retrofit Example

Retrofit Retrofit is a REST Client for Android and Java developed by Square. It makes it relatively easy to retrieve and upload JSON (or other structured data) via a REST based webservice. In Retrofit you configure which converter is used for the data serialization. Typically for JSON you use GSon, but you can add custom …

Android Retrofit ExampleRead More »

Android Working With Tabs

Tabs Tabs make it easy to explore and switch between different views. TabLayout TabLayout provides a horizontal layout to display tabs. ViewPager Integration If you’re using a ViewPager together with this layout, you can call setupWithViewPager(ViewPager) to link the two together. This layout will be automatically populated from the PagerAdapter’s page titles. Get GITHUB code from Here. Creating New Project …

Android Working With TabsRead More »

Android Fragment Example

Fragment A fragment is an independent Android component which can be used by an activity. A fragment encapsulates functionality so that it is easier to reuse within activities and layouts. A fragment runs in the context of an activity, but has its own life cycle and typically its own user interface. Android devices exists in a variety …

Android Fragment ExampleRead More »

Android CheckedTextView Example

Checked TextView CheckedTextView is an extension of normal TextView that has a checkbox along with some text. It is mainly used in a ListView where we want to show which item is selected or not. Checkmark attribute is used to provide a graphic or a drawable to CheckedTextView. Download GITHUB code from Here.   Creating New Project 1. …

Android CheckedTextView ExampleRead More »

%d bloggers like this: