Posts

Showing posts from June, 2020

Passing data between activities in Android Apps.

Image
In this blog post, we will demonstrate on how to pass data between activities in an android app in Android Studio. There are many ways to communicate data to different activities in an application, but today we will be passing the data using Intents.So whats an intent ? An Intent  is a messaging object you can use to request an action from another app component . Although intents facilitate communication between components in several ways, there are three fundamental use cases:  Starting an activity Starting a service  Delivering a broadcast There are two types of intents : Implicit Intents Explicit Intents Explicit Intents    specify which application will satisfy the intent, by supplying either the target app's package name or a fully-qualified component class name. You'll typically use an explicit...

Custom SeekBar in Android Studio .

Image
In this post, you will learn to create a custom seekbar   in android studio.  A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can touch the thumb and drag left or right to set the current progress level or use the arrow keys to do so. To create a custom seekbar need follow these steps .  Create a drawable resource file in the drawable folder. Name it whatever you want. In this we will create a custom appearance for the thumb of the seekbar .  Copy the following code in this drawable folder :   custom_thumb.xml: Now create another drawable resource file for the custom background of the seekbar . Paste in the following code in this. Now in your activity_main.xml file, copy this code : activity_main.xml: Output:

Implementing Simple CardView in android app with Android Studio .

Image
In this post, you will learn simple implementation of Cardview in android studio .Cardview is a widget which was introduced un Android 7.0 . Based on its elevation, cardview gives a shadow effect the makes the app UI more beautiful and appealing. CardView is mainly considered as a container as it wraps for each item within a ListView or a RecyclerView . Here is a simple way to implement CardView in your application. Add the following code to your xml file : <? xml version ="1.0" encoding ="utf-8" ?> <RelativeLayout xmlns: android ="http://schemas.android.com/apk/res/android" xmlns: app ="http://schemas.android.com/apk/res-auto" xmlns: tools ="http://schemas.android.com/tools" android :layout_width ="match_parent" android :layout_height ="match_parent" android :background ="#E5E5E5" tools :context =".MainActivity" > <androidx.cardview.widget.CardView ...