TechPaliyal | Android Tutorial for Developers
900 FOLLOWERS
The TechPaliyal blog is especially for android developers or who want to become an android developer
TechPaliyal | Android Tutorial for Developers
3y ago
Android Fast Networking is a great library for networking I am using since 2016, It has many features that are not available in similar networking libraries.
AFN provides direct support for RxJava but not for Coroutines, so we create by ourself
Adding AFN and Kotlin Coroutines to the project
// GSON
implementation 'com.google.code.gson:gson:2.8.6'
// Android Fast Networking
implementation 'com.amitshekhar.android:android-networking:1.0.2'
// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
In this project we are using State Management approach class Resour ..read more
TechPaliyal | Android Tutorial for Developers
3y ago
Exoplayer is a Powerfull MediaPlayer Library that is developed by Google and better than the MediaPlayer API.
It has many advantages over MediaPlayer API.
It is used by many video platform applications like Youtube, Netflix, etc.
First thing first: Add Dependency
implementation 'com.google.android.exoplayer:exoplayer:2.13.3'
Add Player to UI
<com.google.android.exoplayer2.ui.PlayerView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="paren ..read more
TechPaliyal | Android Tutorial for Developers
4y ago
Navigation refers to the interactions that allow users to navigate across, into, and back out from the different pieces of content within your app. Android Jetpack’s Navigation component helps you implement navigation, from simple button clicks to more complex patterns, such as app bars and the navigation drawer.
Source: developer.android.com
The navigation component provides a flexible solution to handle the fragments and maintain the backstack.
Features
Easy to implement.
Handling Up and Back actions correctly by default.
Handling fragment transactions.
Safe Args – a Gradle plugi ..read more
TechPaliyal | Android Tutorial for Developers
4y ago
What is kotlin coroutines?
Kotlin coroutines are one of the most exciting features in Kotlin. With them, you can simplify the work of asynchronous tasks in an impressive way, and make the code much more readable and easy to understand.
How are kotlin coroutines implemented?
dependencies {
...
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:x.x.x"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:x.x.x"
}
Why use kotlin coroutines?
Coroutines are a great way to write asynchronous code that is perfectly readable and maintainable.
The post Kotli ..read more
TechPaliyal | Android Tutorial for Developers
4y ago
Hello friends, In android application development the most repetitive task is to setup recycler view, in this post, we will discuss how we can create a universal recycler view adapter for most of the cases with the help of MVVM and data binding.
Enable Data Binding
Add below code in app level build.gradle inside android{ }
dataBinding {
enabled = true
}
Add Dependencies
First dependency for MVVM components like ViewModel, etc.
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
Create a recycler view item (item_simple.xml)
<?xml version="1.0 ..read more
TechPaliyal | Android Tutorial for Developers
4y ago
Hello, friends, I am here with another android tutorial about tab layout or tabs with a swipe gesture.
Tab layout is visible below toolbar with View pager, used to create swipeable views on. Tabs are designed to work with fragments. Use them to swipe fragments in view pager. In this article, we are going to show you how to implement material design tabs in your android app.
After creating a new project open build.gradle and add this dependency and sync project.
implementation 'com.google.android.material:material:1.0.0'Add Tab Layout and View Pager in activity_main.xml
<?xml ..read more
TechPaliyal | Android Tutorial for Developers
4y ago
That’s what we will create, so start the fun part step by step. Step 1: Implement Material Design library In material design, there is a bottom app bar, so we use that to meet our requirements.
put this in build.gradle (:app)
implementation 'com.google.android.material:material:1.1.0-beta01'
Step 2: Create a menu
create menu file to use in BottomNavigationView
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_home"
android:title="Home"
android:icon="@d ..read more
TechPaliyal | Android Tutorial for Developers
4y ago
Hello friends, I came back with a new post. In this post, we are going to learn how to handle notifications with an image from the firebase console.
Here are a few steps I think we can skip. # Login/Register to the firebase. # Setup your project in android studio. # Create a project on the firebase console. # Add firebase to your project.
Step 1: Add dependency (in “app/build.gradle”)
implementation 'com.google.firebase:firebase-messaging:20.0.0'
Step 2: Create a class that extends FirebaseMessangingService in my case it is “MyFirebaseMessangingService” Your class look like th ..read more
TechPaliyal | Android Tutorial for Developers
4y ago
To help clarify this madness, I’d like to begin by apologizing on behalf of all Android users for Google’s downright ridiculous treatment of the soft keyboard. The reason there are so many answers, each different, for the same simple question because this API, like many others in Android, is horribly designed. I can think of no polite way to state it.
I want to hide the keyboard. I expect to provide Android with the following statement: Keyboard.hide(). The end. Thank you very much. But Android has a problem. You must use the InputMethodManager to hide the keyboard. OK, fine, this is Androi ..read more