SBSuraj Bahadurinsurajbahadur.hashnode.dev·Dec 22, 2022 · 1 min readMonitor internet connection in androidCreate a class that notifies observe classes about the network connection and disconnection. /** * Internet Util class to observer connection. */ class InternetConnectionUtil constructor(context: Context, listener: (Int) -> Unit) { init { ...00
SBSuraj Bahadurinsurajbahadur.hashnode.dev·Dec 14, 2021 · 3 min readFirebase Notifications in Background & Foreground in AndroidWhen developers need to integrate push notifications in their Android apps, the first thing that comes to mind is Firebase Notifications or Firebase Messaging. But when they integrate, there are a few common issues that they stuck into. One of those ...00
SBSuraj Bahadurinsurajbahadur.hashnode.dev·Dec 9, 2021 · 1 min readCompare Two Date In KotlinYou can use the below extension to compare the given date to the current date fun isDateValid(myDate: String) : Boolean { try { val date = SimpleDateFormat("yyyy-MM-dd").parse(myDate) return !date.before(Date()) } catch(ignore...00
SBSuraj Bahadurinsurajbahadur.hashnode.dev·Dec 8, 2021 · 2 min read50 Productivity And Personal Development Skills For Career And BusinessSkills For Before Starting To Work Self-awareness and self-exploration to choose the right life goals for yourself Figuring out and deciding on your life purpose and direction Goal setting to set large, achievable goals that will excite and motiva...00
SBSuraj Bahadurinsurajbahadur.hashnode.dev·Dec 8, 2021 · 1 min readKeep these things in mind when using ViewModel in your applicationDon't let ViewModels know about Android framework classes. (A general rule of thumb is to make sure there are not(android.) imports in your ViewModels(with an exception like android.arch.) Keep the logic in activities and Fragments to a minimum. Av...00