A.I, Data and Software Engineering

Categoryfront-end

front-end development

Constraints with Android Worker

petamind

Sometimes, we want our app to perform some background tasks under certain conditions, such as Battery level or network etc. With Worker and Constraints, we can conveniently achieve that. The example problem A worker class that prints a message to the console. class MyWorker(context: Context, params: WorkerParameters): Worker(context,params) { override fun doWork(): Result { Log.i(LOG_TAG...

PETAMIND IS NOW LIVING ON AWS

petamind

After 3 years residing on Google Cloud, we decided to move to AWS. GC is generally OK, however, there is some issue related to the architecture of the previous one that may hinder the future scalability! As such, we decided to re-architecture the site and its workload for the future. There may be some issues after the migration. However, we will check and fix any issue asap. Refer to the...

WHY DO WE NEED TO OVERRIDE EQUALS AND HASHCODE METHODS IN JAVA/Kotlin

In this post, we will discuss why it is important to override equals and hashCode method in Java/Kotlin. Item 9 in Josh Bloch’s Effective Java suggests always override hashCode() method if the class overrides equals(). In this post, we will discuss why this is necessary and good practice.  We know that two objects are considered equal only if their references point...

Material Design — Custom Alert Dialog

Google did an amazing job to promote material design. However there is not many articles about how to quickly style the custom dialog. So, we will cover some missing stuff here. Prerequisites Add material design dependency in Gradle file: implementation "com.google.android.material:material:<latest-version>" Make sure your AppTheme inherited from a material theme like:...

Advanced android room persistent storage

Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite. Because Room takes care of several concerns for you, e.g. caching, networking, Android highly recommend using Room instead of SQLite. If you are coming from iOS, the good news is that Room is very similar to the core data in iOS development. The task Field...

A.I, Data and Software Engineering

PetaMinds focuses on developing the coolest topics in data science, A.I, and programming, and make them so digestible for everyone to learn and create amazing applications in a short time.

Categories