This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Use Image Libraries: If need to load image in itemview, use Glide, Picasso or Fresco library. | |
2. setHasStableIds: This method should be used setHasStableIds(true) to enable stable item IDs. This helps in efficiently | |
updating and reordering items without unnecessary rebinds. | |
3. setHasFixedSize: If RecyclerView size itself is fixed and wouldn’t change due to its content and, | |
using setHasFixedSize(true) can help improve performance by avoiding unnecessary layout calculations. | |
4. setItemViewCacheSize: Adjust the cache size using this method to control how many offscreen views are | |
retained. This can help in managing memory usage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private var intentFilter: IntentFilter? = null | |
private var smsReceiver: SMSReceiver? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
// Init Sms Retriever >>>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private var smsReceiver: SMSReceiver? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
// Init Sms Retriever >>>> | |
initSmsListener() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shishirthedev.smsretriverapi | |
import android.annotation.TargetApi | |
import android.content.Context | |
import android.content.ContextWrapper | |
import android.content.pm.PackageManager | |
import android.util.Base64 | |
import android.util.Log | |
import java.nio.charset.StandardCharsets | |
import java.security.MessageDigest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private var intentFilter: IntentFilter? = null | |
private var smsReceiver: SMSReceiver? = null | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.shishirthedev.smsretriverapi | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import com.google.android.gms.auth.api.phone.SmsRetriever | |
import com.google.android.gms.common.api.CommonStatusCodes | |
import com.google.android.gms.common.api.Status | |
import java.util.regex.Pattern | |
class SMSReceiver : BroadcastReceiver() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implementation 'com.google.android.gms:play-services-auth:19.0.0' | |
implementation 'com.google.android.gms:play-services-auth-api-phone:17.5.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:deliveryboy/data/pref/Keys.dart'; | |
import 'package:deliveryboy/data/pref/PreferenceManager.dart'; | |
import 'package:deliveryboy/ui/components/item_view/item_on_borading.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/services.dart'; | |
import 'auth/login/login_screen.dart'; | |
class OnboardingScreen extends StatefulWidget { | |
static const route = "/on-boarding-screen"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun isInternetAvailable(context: Context): Boolean { | |
var isConnected: Boolean = false // Initial Value | |
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
val activeNetwork: NetworkInfo? = connectivityManager.activeNetworkInfo | |
if (activeNetwork != null && activeNetwork.isConnected) | |
isConnected = true | |
return isConnected | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val retrofit = new retrofit2.Retrofit.Builder() | |
.baseUrl(BASE_URL) | |
.addConverterFactory(GsonConverterFactory.create()) | |
.client(okHttpClient) | |
.build(); |
NewerOlder