InfyOm Blog

latest-post

Out of 100 only 30/40 people know about Laravel jobs and how its works or where we can use it.

When there is a need to use it specifically or the senior team asked that "You have to use Laravel Jobs", generally then people come to the web and search :

  • "How Laravel Jobs works ?" Or "Laravel Jobs works in Local Environment?"

In this tutorial, we are going to understand the basic functionality of jobs and their usage in simple words without any complex examples.

What is a Job?

Jobs generally contain a portion of code that runs in the background without blocking any other code.

You first need to create a job and you can write a portion of code into it.

Then you have to dispatch that job.

How Job works?

Let's say we want to send emails to 100 users. In general, terms what we do is: Execute a loop over each user and send emails one by one.

That will definitely take time and we also have to wait for the response.

Overcome that issue by using jobs.

First, we need to create a job that accepts 10 users and sends emails.

Now we will execute a loop over 100 users, so basically we have to dispatch the job 10 times.

So basically 10 times jobs will be dispatched and immediately we will get a response, as jobs run in the background without waiting for any response.

Hope its more clear now.

February 04, 20231 minuteuserVishal Ribdiya

Posts

ProGuard in Android

We may have used ProGuard in our project when developing Android applications. In this blog, all of the features and how to use ProGuard effectively on Android.

1. What is ProGuard?

ProGuard is a free java tool in Android, which helps us to do the following:

  • Shrink(Minify) the code: Remove unused code in the project.
  • Obfuscate the code: Rename the names of class, fields, etc.
  • Optimize the code: Do things like inlining the functions.

In short, ProGuard has the following impact on our project:

  • It reduces the size of the application.
  • It removes the unused classes and methods that contribute to the 64K method count limit of an Android application.
  • It makes the application difficult to reverse engineer by obfuscating the code.

2. How to use it in our project?

To enable Proguard in your project, in the app's build.gradle add,

buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

    }
}

Here, we have minfyEnabled as true. It activates the proguard which takes from the file,

proguard-android.txt

It is under the release block, which means that it will only be applied to the release of the build we generate.

But it can be too much sometimes when the proguard removes too much code and it might break your code for the flow.

So, configuring the code we have to add some custom rules to make sure we remove the set of code from obfuscating. We can fix this by writing out custom rules in our proguard and it will respect while generating the build.

Now, let us see how we can write customs rules in proguard.

1. Keeping class files

Assume we have a data class that is required by some API but that we obfuscate by generating a build. We have a User data class, for example.

data class User(val id: String = "")

and we want not to obfuscate the class which generating build then to ignore it from obfuscating we use @Keep annotation and update the code like,

@Keep
data class User(val id: String = "")

This annotation allows the class to be ignored when minified using proguard. The class and its member functions will be preserved even when not in use.

-keep

to preserve options of class while generating the build. Using -keep over @Keep we get more control over what to preserve and what not to.

2. Keeping a class's members

If we want to keep only the class members and not the entire class while shrinking, we can use,

-keepclassmembers

in the proguard rule file. This will help us to ignore members of a specific class.

Consider the above User class, and we want to preserve all the public methods inside it. We write the rule like,

-keepclassmembers class com.mindorks.sample.User{
    public *;
}

3. Keeping names of the class and members

Let's say we want to keep all of the same class names and members if they are used in the code, i.e. if the class is not used, it will be shrunk by proguard but will not be obfuscated because it has already been shrunk and there is no need for obfuscation.

-keepnames

Practical use of it looks like,

-keepnames class com.mindorks.sample.GlideModule

Here, if the GlideModule would keep all of its names of the class and the member function.

Note:-

As a fragment TAG, do not use something like MainFragment.class.getSimpleName().

While obfuscating, Proguard may assign the same name (A.class) to two different fragments in different packages. Two fragments will have the same TAG in this case. It will result in a bug in your application.

Keep your Proguard mapping file in order to trace back to the original code. You may need to upload it to different locations, such as the PlayStore Console, to see the original stack-trace of the crashes.

June 06, 20223 minutesauthorVivek Beladiya
Top 5 UI/UX Design Tools

UX and UI tools have played a pivotal role in shaping the digital economy since their inception. If a tool, no matter how effective, fails to solve your specific problem, it is not the right tool for you. A tool may be equipped with remarkable functionalities, but it is futile if it is not user-friendly on a day-to-day basis. Moreover, a tool requires being utmost integration-friendly to make the entire design phase transition effortless. Here take a glance at the top 5 UI UX design tools that score well on all these significant aspects.

Adobe XD

Adobe UI UX design tools continue to evolve, and Adobe XD being the latest tool boasts an innovative collaboration feature that empowers you to work collaboratively through seamless document sharing. This flagship UX tool enables you to generate animated micro-interactions with the said elements while allowing you to create elements. However, this solid prototyping tool does not come devoid of cons. It does not allow you and your colleague to work simultaneously on the same document.

Availability: Windows/macOS

Figma

As one of the dynamic, collaborative prototyping UI UX design tools, Figma imparts a second to none collaborative environment wherein you and your colleagues can build prototypes, and test them for usability while tracking all the progress live. Empowered with the noteworthy interface, it provides the element insertion, code, and scrolling animations to build high-fidelity prototypes. Being browser-based, it is a great tool that lets teams create, test, and deliver better designs right from start to end.

Availability: Windows/macOS. It also imparts a mobile app aiming to mirror prototypes.

Sketch

Reckoned as the Godfather of UI UX design tools, Sketch makes it effortless for you to develop engaging mockups. Immaculate and easy-to-use interface, this first 100% UX/UI tool aligns well with the majority of the tools related to prototyping. However, collaboration is one concern as Sketch is compatible only with macOS.

Availability: macOS only

Invision Studio

It is regarded as one of the most dynamic screen UI UX design tools that offer a bundle of 4 tools encompassing Prototyping, Inspection, Freehand tool, and Craft tool while imparting you a hassle-free experience. It aligns well with Sketch. The digital whiteboard feature of this tool empowers team members to translate their ideas effortlessly.

Availability: macOS and Windows

Mockplus

No matter whether you intend to design, collaborate or prototype, leverage the advanced functionalities of Mockplus that swiftly let your ideas turn into functional prototypes with icons, interactions, and components.

Availability: Windows, macOS

June 03, 20222 minutesauthorKishan Savaliya
How to use Multi Tenant with Multi Databases Into Any Laravel Application ?

People are quite afraid :), including me :) when it’s about the developing system that works with multi-tenant / multi-database.

In this tutorial, we will implement a multi-tenant system that will create a separate database when the new tenant will create.

Install Package

composer require stancl/tenancy

Then run the following command :

php artisan tenancy:install

Then add the service provider TenancyServiceProvider to your config/app.php file:

/*
 * Application Service Providers...
 */
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\TenancyServiceProvider::class, // <-- here

Setup Tenant Model

namespace App;

use Stancl\Tenancy\Database\Models\Tenant as BaseTenant;
use Stancl\Tenancy\Contracts\TenantWithDatabase;
use Stancl\Tenancy\Database\Concerns\HasDatabase;
use Stancl\Tenancy\Database\Concerns\HasDomains;

class Tenant extends BaseTenant implements TenantWithDatabase
{
    use HasDatabase, HasDomains;
}

Then, configure the package to use this model in config/tenancy.php:

'tenant_model' => \App\Tenant::class,

Create Migrations For tenant

Create one migration and move that migration file to migrations/tenant. So when we are going to create new tenant this migarations files will run for that new tenant.

You can do the same for seeders. if you want to change the seeder file then you can change it from the config/tenancy.php

Create Actual Tenant

$tenant = Tenant::create([
    'id' => time(),
]);

Result

Now when we run above code it will create new tenant and also create new database with related prefix and given id value.

So it will create following things :

  • New Tenant will be created in main database
  • New tenant database will be created
  • New migrations and seeders will be executed into new tenant database.

Hope that will helps a lot.

June 02, 20221 minuteauthorVishal Ribdiya
How to Generate Organic Leads from Your Website

What are Organic Leads?

Organic leads are your potential customers and customers who search for your company by searching for a specific product, service, or query in a search engine like Google.

In this article, we are going to discuss effective strategies for generating leads organically.

Optimize your website for search engines

Search engine optimization is a tried and tested method of generating organic leads. It may take a while for your website to get on the top pages of Google, but once it gets there, most of your problems will be solved. You can either DIY your search engine optimization campaign, or you can hire a professional to do it for you.

Optimize your website for your target audience

The main rule of generating leads for any business is to give visitors what they want. Of course, this is your website, and you want to design it the way you want it.

But you should not forget that it is the interest of the target audience that will help you get it and drive it.

Enter keywords and phrases in the website content

The best way to insert keywords into your website content is to do it naturally. Your site may be penalized if you try to insert too many keywords into your website content.

Research and survey your products/services. Try to figure out which content works best for them.

Start an active email marketing campaign

Grow your email list and give your email subscribers some extra benefits to stay loyal to your brand. Email marketing will help you learn more about your potential customers on an individual level. It boosts the confidence factor and helps you get more potential organically.

Occasionally share advice, brand videos, and newsletters, and interact with your followers. Ask them for their opinion on your new products/services and give them access to services they would not otherwise have. There are numerous ways to increase your email subscriber list.

Add forms to the pages that get the most traffic.

It is important to benchmark your current position in lead generation before you begin so that you can track your success and determine the areas where you need the most improvement. Some of your pages can create excellent lead generators and you may not even realize it.

June 02, 20222 minutesauthorAnkit Kalathiya
Key Points of Good Test Cases

Testers infrequently suppose about the difference between average and high quality tests. However, also it's frequently inconspicuous, If the test case is good. It indeed simply dissolves in the process of software verification. Testers flash back it only when they find a bug in a system. The following is an analysis showing that your test is of high quality and dependable.Tests Are Suitable for robotisation Occasionally, you can see tests that aren't completely automated. The most popular reason is that commodity is veritably complicated or nearly insolvable.

Test is performed regularly

The test doesn't crash unless the software has changed. Such a rule applies to the basics of original data generation. For illustration, we test the enrolment process for a new stoner. No doubt, if the system doesn’t induce the original dispatch, such a test most probably won’t serve on product.

Test ends with confirmation

It’s true, except in situations where one should clear the information and perform some other processes. Completion by confirmation is the stylish for any test case performing. similar allows you to make sure that the performed action actually passed rightly.

Test is stable and can be habituated in CI/ CD

still, they aren't stable enough to be used with CI/ CD, If your test suites regularly fail. Because every other product company is trying to reach CI and CD, occasionally similar tests aren't only ineffective but indeed dangerous. That’s because they take a lot of time and aren't suitable for automatic use in CI anyway.

Test requires minimum support

Tests aren't created independently. Most frequently, it's the work of a group of people who also have to support them in the future. Any member of the design should understand the test structure snappily and fluently enough. They don’t have to put in too important time and trouble. Indeed if tests are created by one person, occasionally, it can be extremely delicate to understand what this test is responsible for if it isn't created specifically to make tests easier to understand.

Tests Function in resemblant and nothing crashes sooner or latterly, test runs will take a veritably long time. In turn, this leads to slow programming speed and causes the so called “untested patch” effect.

It's worth allowing about resemblant testing so that the checking process would run smoothly. However, it automatically makes resemblant prosecution an easy task of structure debugging rather than a thing of rewriting test cases by all actors of the cargo testing company, If the tests are actuated in resemblant and they do n’t connect.

June 04, 20222 minutesauthorNayan Patel
Sanity Testing: What is it and how is it used?

The Basic Concept of Sanity Testing

When time is brief, Sanity testing are often a far better option than not testing in the least. it's performed to check the modules so their impact are often determined, but without going in-depth. it's useful when deadlines are strict and there's not enough time available to thoroughly test the appliance.

In an Agile environment, big releases are planned systematically and delivered to the client, whereas sometimes, because the situation demands, small releases got to be delivered where there's no overtime available for the testing, leaving no time for documentation of the test cases, bug reporting or Regression Testing.

Items to think about in Sanity Testing

Sanity Testing is performed when time is just too short to check the build thoroughly, and it’s impossible to execute all the test cases. this example risky, and therefore the possible implications are tremendous. To minimise mistakes and oversights, a tester should lookout of a couple of things at their end.

It is advisable to not accept the build where there are not any written requirements available. Sometimes the client conveys changes and/or requirements verbally and expects us to regulate accordingly. Compel the client to supply some written points on acceptance criteria.

Sanity testing is completed when there's not enough time to check the appliance thoroughly, leaving you unable to document bugs and test cases. this is often a but ideal situation so make certain to form your own notes. Document your bugs roughly on your notepad and if there's a while left, share those together with your team for future reference. Throw the ball into the courts of others. Email the list of issues to each stakeholder.

Automation testing can help reduce the pressure of manual efforts.Finally, draft an email containing the most details that you simply have tested, also as what you probably did not test. Give justification and reasons for the bugs that are resolved and people which haven't been.

Advantages of Sanity Testing

Sanity testing focuses on a couple of major areas of functionality which may help in identifying core functionality issues, ultimately saving time Sanity testing is typically non-documented During sanity testing, we are ready to identify missing and dependent functionalities.

Disadvantages of Sanity Testing

The primary focus of the sanity test is to see that the functions of the appliance work needless to say During times when deadlines are tight, organizations like better to perform sanity testing (bypassing regression testing) which leaves a number of the functionalities unattended. this will mean issues continue the assembly environment leaving a nasty impact on the companies. As said, it's non-documented so no official reference is out there.

Conclusion

In the end, the sort of testing you select that situation depends on the intuition of testers. Devise a technique to realize your end-goal. Define how you'll proceed and what you aim to realize with the short time span.

May 03, 20222 minutesauthorNayan Patel
Understand FontIcon Style

Linear

It is the most common style of icon in projects. With its simplicity, it is perfect for a minimalist and modern style.

Linear Icon

Bold

These icons have a fill. We often use them to emphasize the effect of an active option in the navigation of desktop or mobile applications.

Bold Icon

Two colors / Duocolor

As the name suggests, it is a two-color style. this, we can distinguish their more important fragments.

Duocolor Icon

Bulk

It is a combination of the two colors and bold styles. this, the icons are better visible through filling, and at some time, we can emphasize their more important parts.

Bulk Icon

Broken

This style is characterized 'zed by a partial indentation in a given fragment of the icon. This effect distinguishes the icons from the rest and gives them a bit of spice.

Broken Icon

April 24, 20221 minuteauthorPayal Pansuriya
How to Increase Customer Retention Rates

Customer retention is the process of attracting repeat customers and preventing them from moving toward competitors. It is an important aspect of business strategy, and it can help businesses gain a competitive advantage.

The following ways to increase customer retention apply to virtually any type of business

Deliver more than you promised

The next step in the process is to deliver more than you promised - which means going beyond and beyond the call of duty and delivering to your customers the things they didn't expect. For example, you could offer a free bonus (such as a product, discount, or value-added) out of the blue, or anticipate a new customer's need and actively address it.

Meet your customers wherever they are

When you really understand your customers - that is, you know who they are, what they want from you, what their challenges are, and where they spend their time - you will reach them wherever they are. You can create the type of content they want and want (eg blog, video, social media) and then share it wherever they are (eg various websites, media channels, social platforms, etc.).

Good values ​​build good relationships

Your company values ​​are important to you. It should reflect your business processes, the quality of your products, and how you treat your customers. These things should make your values ​​clear to your customers, but reminding them occasionally doesn't hurt.

Trust is the good relationship

Creating a brand that is easily relevant is the first step in building trust with your customers. Having something in common parental trust is the key to building a successful business, through a strong relationship and expansion.

Accept feedback

You never know what your customers really want until you ask. Take regular surveys and request feedback from all your customers. You never know what is missing in you - and what areas need improvement.

Follow up with your existing customers

High touch is the key to retaining the customer. The only unusual thing about personal follow-up is how little companies do it. Getting referrals from happy customers is easier than finding and converting a new business.

April 20, 20222 minutesauthorAnkit Kalathiya