Learnings Posts

How can I run my app on my phone without USB connection with my pc

We will learn to run the app without connecting a USB cable in this blog. The main purpose of this blog is to let users run apps without any restriction. Sometimes if the cable is connected with the device and if the device cable gets disturbed then the app does not run properly.

Let's see how we can run the app without cable.

Step 1: Click File Menu => Settings

2021-01-08-5ff84742652f6

Step 2: Click Plugins

2021-01-08-5ff8475b600ed

Step 3: Install ADB Wi-Fi Plugin

2021-01-08-5ff8476c3d0f6

Notes:

  • In the third image, I already installed the plugin in my android studio. But in your case, you may need to install it.
  • Then your android studio restarts.

After the restart, your android studio will show the "ADB Wifi" option showing as per the following image

2021-01-08-5ff847ae6fa6b

Click ADB Wifi and the below screen will be displayed.

2021-01-08-5ff847f31608f

  • Click to connect
  • Make sure your device and pc are connected to the same wifi. Otherwise, it will not get connected.
  • You will need to connect one time when the android studio is opened for the first time.
November 21, 20201 minutePankaj ValaniPankaj Valani
How to increase profit in our business - 2
In the previous article, we learned 6 areas or tips on How to increase profits in our business - part 1.

In this article, we will learn more about how to increase profit in our business. Maximizing Profit depends on the strategies that business owners take. There are only two ways to do this:
1. Increase Prices
2. Reduce Cost.

You simply cannot say that you are going to increase the profit of your business without a specific strategy. All you can do to increase profit is to improve the variables that ultimately determine your Profitability. Let's see 7 more points to increase profit.

7. Know your sales Channel




To stimulate your sales channel, you need to generate excitement and a reason to buy. This can be done by introducing vibrant, brightly colored sales that include all your products and services and by expressing a sense of urgency, encouraging sales partners, and adding subscription sales.

8. Find a new Customer




Follow up after meetings. Contact the people you meet to see if they are likely. If they say they no longer need your services, ask them when it's a good time to call, or if they have business associates who can use what you sell now.

9. Remove unprofitable service and product




If you have more than one product or service, any analysis will determine if one is more profitable than the other. If you have a lot of products in your offering, you can trust that some of them will not make money. The trick is to find out what they are and then put in motion plans to eliminate them. The basic tool for doing this is an orderly list that ranks all your products and services showing total revenue and all direct costs and total profits.

10. Reduce labor costs with part-time workers




Employment is lower than full-time workers than part-time workers. Take advantage of this luxury by hiring multiple part-time workers. Warn that if these people are presented to your company with a full-time opportunity they will leave them first.

11. Develop a CEO monthly letter to employees to create teamwork and communication




You'll want to have monthly conversations with your team, letting them know about any updates, highlighting individual performances, and reminding them of goals for the quarter and year. This will help build team morale and focus on expectations.

12. Invest in your people




Your team will only be able to make exceptional work progress and be competent when you invest in their improvement. Invest in their continuing education and also provide the best resources to do their job effectively.

13. Send personal notes of congratulations or thank employees at their home




When you send complimentary notes to employees ’homes, it shows that you think of them as a person rather than just a worker. This helps increase employee loyalty to your company.

That's it. If you want to run a profitable business, take these tips and apply them to your business. It will help your business perform better, keep growing, and increase profits.
October 09, 20202 minutesAnkit KalathiyaAnkit Kalathiya
How to generate thumbnails by using Spatie Media Library

Hope you guys are familiar with Spatie Media Library. It's a very useful and time-saving package to manage file uploading.

It's also providing support to convert your images to thumbnails while storing images. you can generate a thumbnail of the image with the size (height, width) you want.

They are calling thumbnails to Conversions. You can generate multiple thumbnails with different sizes as you want.

So let's see some short examples which help us to create thumbnails of an uploaded image.

Implement the HasMediaTrait into your Model

Here we have a User model and we want to generate a thumbnail of the user uploading his profile image. you have to add HasMediaTrait to the User model and need to extend HasMedia.

use IlluminateDatabaseEloquentModel;
use SpatieMediaLibraryModelsMedia;
use SpatieMediaLibraryHasMediaHasMedia;
use SpatieMediaLibraryHasMediaHasMediaTrait;

class User extends Model implements HasMedia
{
    use HasMediaTrait;

    public function registerMediaConversions(Media $media = null)
    {
        $this->addMediaConversion('profile-thumb')
              ->width(150)
              ->height(150);
    }
}

Here we have defined a function registerMediaConversions in which we can manage the size of a thumbnail, which means how much height or width we want for the thumbnail.

So when we upload an image using the media library,

$media = User::first()->addMedia($pathToImage)->toMediaCollection();

it will auto-generate the thumbnails with the given height and width.

How to fetch the generated thumbnail?

$media->getPath();  // the path to the where the original image is stored
$media->getPath('profile-thumb') // the path to the converted image with dimensions 150*150

$media->getUrl();  // the url to the where the original image is stored
$media->getUrl('profile-thumb') // the url to the converted image with dimensions 150*150

How to generate multiple thumbnails for a single image?

..... in User Model .....
use SpatieImageManipulations;

    public function registerMediaConversions(Media $media = null)
    {
        $this->addMediaConversion('profile-thumb')
              ->width(150)
              ->height(150);
    }

        $this->addMediaConversion('old-profile-thumb')
              ->sepia()
              ->border(8, 'black', Manipulations::BORDER_OVERLAY);
    }

so, it will generate 2 thumbnails with different image properties. you can use different image properties directly while generating thumbnails.

That's it, you can read more about the spatie media library conversions (thumbnails) here.

Keep connected to us for more interesting posts about laravel.

November 28, 20202 minutesVishal RibdiyaVishal Ribdiya
How to create APK and Bundle in android java

While developing apps in Android Studio, developers can create an APK file and share it with other developers or to QA people for testing purposes.

APK can be created with two types:

  1. Debug APK
  2. Release APK
  • Debug APK is very fast in building and Release APK is a little bit slow.

How to create a Release APK File:

  • Flowing below all steps
  • Open android studio
  • Click Build on the toolbar
  • Click Generate Signed Bundle/APK.
  • Select APK
  • Click the Next button
  • After clicking the next button, you will see the following dialog.
  • Click the "Create new..." button, highlighted in the following image by a red circle if you are creating an APK for the first time. Otherwise, you can choose from existing.
  • It will open one another dialog box
  • Key store path in select save location .jks file
  • Fill in all the information
  • Set a valid name for the key alias
  • Set 100 as validity years
  • Fill Certificate Information
  • Click OK
  • After you click on it, select "release" from the dialog box
  • Select "V1 (Jar Signature)" & "V2 (Full APK Signature)" checkboxes
  • Click Finish
  • It will start the process of building your APK

How to create a debug .apk file

  • Click Build and select Build Bundles(s)/APK(s)
  • Select "Build APK(s)" from the dialog box
  • It will start the process of building your debug APK file creating
November 25, 20201 minutePankaj ValaniPankaj Valani
How to implement Google Analytics into Gatsby Site

We have recently developed a site into the gatsby. We want to add Google Analytics to the website.

So, this is the way we implemented Google Analytics in the Gatsby site.

Use Gatsby Google GTag Plugin

Gatsby has a plugin gatsby-plugin-google-gtag that be used to easily add Google Global Site Tag to your Gatsby site.

Install the package by running the following command:

npm i gatsby-plugin-google-gtag --save

Configuration

Once the installation is complete, you can now add this plugin to your gatsby-config.js:

Configure trackingIds and other options. Add this into the plugins array. Like,

module.exports = {
  // ...
  plugins: [
    {
      resolve: `gatsby-plugin-google-gtag`,
      options: {
              // You can add multiple tracking ids and a pageview event will be fired for all of them.
              trackingIds: [
                "GA-TRACKING_ID", // Google Analytics / GA
                "AW-CONVERSION_ID", // Google Ads / Adwords / AW
                "DC-FLOODIGHT_ID", // Marketing Platform advertising products (Display & Video 360, Search Ads 360, and Campaign Manager)
              ],
              // This object gets passed directly to the gtag config command
              // This config will be shared across all trackingIds
              gtagConfig: {
                optimize_id: "OPT_CONTAINER_ID",
                anonymize_ip: true,
                cookie_expires: 0,
              },
              // This object is used for configuration specific to this plugin
              pluginConfig: {
                // Puts tracking script in the head instead of the body
                head: false,
                // Setting this parameter is also optional
                respectDNT: true,
                // Avoids sending pageview hits from custom paths
                exclude: ["/preview/**", "/do-not-track/me/too/"],
              },
      },
    },
  ],
}

This plugin automatically sends a “pageview” event to all products given as “trackingIds'' on every Gatsby's route change.

If you want to call a custom event you have access to window.gtag where you can call an event for all products.

Check out this code.

typeof window !== "undefined" && window.gtag("event", "click", { ...data })

NOTE: This plugin only works in production mode! To test your Global Site Tag is installed and

You need to run the following command for firing events correctly.

gatsby build && gatsby serve

If you need to exclude any path from the tracking system, you can add one or more to this optional array.

November 22, 20202 minutesShailesh LadumorShailesh Ladumor
How to integrate Zoom Meeting APIs with Laravel

Zoom Marketplace is providing APIs to create zoom meetings directly using the web interface and calling its API. So first of all you need to create your zoom ap into zoom marketplace and need to generate the API Keys and credentials.

Create a Zoom Application

  1. Go to Zoom marketplace and do sign in
  2. Click the Develop button on the header and select Build App menu.
  3. Choose the JWT and create an application with the app name that you want.
  4. Input required information and click Continue until your app will be activated.

I hope you already have installed fresh laravel.Now you have to add the following packages to your composer.json to integrate the zoom API.

composer require firebase/php-jwt
composer require guzzlehttp/guzzle

And Now run composer update

And don't forget that we also need to modify .env files to set the zoom API credentials.

ZOOM_API_URL="https://api.zoom.us/v2/"
ZOOM_API_KEY="INPUT_YOUR_ZOOM_API_KEY"
ZOOM_API_SECRET="INPUT_YOUR_ZOOM_API_SECRET"

can find the zoom credentials from your zoom app.

Now just copy the given ZoomMeetingTrait to your controller and call-related methods.

namespace App\Traits;

use GuzzleHttp\Client;
use Log;

/**
 * trait ZoomMeetingTrait
 */
trait ZoomMeetingTrait
{
    public $client;
    public $jwt;
    public $headers;

    public function __construct()
    {
        $this->client = new Client();
        $this->jwt = $this->generateZoomToken();
        $this->headers = [
            'Authorization' => 'Bearer '.$this->jwt,
            'Content-Type'  => 'application/json',
            'Accept'        => 'application/json',
        ];
    }
    public function generateZoomToken()
    {
        $key = env('ZOOM_API_KEY', '');
        $secret = env('ZOOM_API_SECRET', '');
        $payload = [
            'iss' => $key,
            'exp' => strtotime('+1 minute'),
        ];

        return \Firebase\JWT\JWT::encode($payload, $secret, 'HS256');
    }

    private function retrieveZoomUrl()
    {
        return env('ZOOM_API_URL', '');
    }

    public function toZoomTimeFormat(string $dateTime)
    {
        try {
            $date = new \DateTime($dateTime);

            return $date->format('Y-m-d\TH:i:s');
        } catch (\Exception $e) {
            Log::error('ZoomJWT->toZoomTimeFormat : '.$e->getMessage());

            return '';
        }
    }

    public function create($data)
    {
        $path = 'users/me/meetings';
        $url = $this->retrieveZoomUrl();

        $body = [
            'headers' => $this->headers,
            'body'    => json_encode([
                'topic'      => $data['topic'],
                'type'       => self::MEETING_TYPE_SCHEDULE,
                'start_time' => $this->toZoomTimeFormat($data['start_time']),
                'duration'   => $data['duration'],
                'agenda'     => (! empty($data['agenda'])) ? $data['agenda'] : null,
                'timezone'     => 'Asia/Kolkata',
                'settings'   => [
                    'host_video'        => ($data['host_video'] == "1") ? true : false,
                    'participant_video' => ($data['participant_video'] == "1") ? true : false,
                    'waiting_room'      => true,
                ],
            ]),
        ];

        $response =  $this->client->post($url.$path, $body);

        return [
            'success' => $response->getStatusCode() === 201,
            'data'    => json_decode($response->getBody(), true),
        ];
    }

    public function update($id, $data)
    {
        $path = 'meetings/'.$id;
        $url = $this->retrieveZoomUrl();

        $body = [
            'headers' => $this->headers,
            'body'    => json_encode([
                'topic'      => $data['topic'],
                'type'       => self::MEETING_TYPE_SCHEDULE,
                'start_time' => $this->toZoomTimeFormat($data['start_time']),
                'duration'   => $data['duration'],
                'agenda'     => (! empty($data['agenda'])) ? $data['agenda'] : null,
                'timezone'     => 'Asia/Kolkata',
                'settings'   => [
                    'host_video'        => ($data['host_video'] == "1") ? true : false,
                    'participant_video' => ($data['participant_video'] == "1") ? true : false,
                    'waiting_room'      => true,
                ],
            ]),
        ];
        $response =  $this->client->patch($url.$path, $body);

        return [
            'success' => $response->getStatusCode() === 204,
            'data'    => json_decode($response->getBody(), true),
        ];
    }

    public function get($id)
    {
        $path = 'meetings/'.$id;
        $url = $this->retrieveZoomUrl();
        $this->jwt = $this->generateZoomToken();
        $body = [
            'headers' => $this->headers,
            'body'    => json_encode([]),
        ];

        $response =  $this->client->get($url.$path, $body);

        return [
            'success' => $response->getStatusCode() === 204,
            'data'    => json_decode($response->getBody(), true),
        ];
    }

    /**
     * @param string $id
     * 
     * @return bool[]
     */
    public function delete($id)
    {
        $path = 'meetings/'.$id;
        $url = $this->retrieveZoomUrl();
        $body = [
            'headers' => $this->headers,
            'body'    => json_encode([]),
        ];

        $response =  $this->client->delete($url.$path, $body);

        return [
            'success' => $response->getStatusCode() === 204,
        ];
    }
}

And add the following constants to your controller.

const MEETING_TYPE_INSTANT = 1;
const MEETING_TYPE_SCHEDULE = 2;
const MEETING_TYPE_RECURRING = 3;
const MEETING_TYPE_FIXED_RECURRING_FIXED = 8;

So the final controller will look like,

namespace App\Http\Controllers;

use App\Models\ZoomMeeting;
use App\Traits\ZoomMeetingTrait;
use Illuminate\Http\Request;

class MeetingController extends AppBaseController
{
    use ZoomMeetingTrait;

    const MEETING_TYPE_INSTANT = 1;
    const MEETING_TYPE_SCHEDULE = 2;
    const MEETING_TYPE_RECURRING = 3;
    const MEETING_TYPE_FIXED_RECURRING_FIXED = 8;

    public function show($id)
    {
        $meeting = $this->get($id);

        return view('meetings.index', compact('meeting'));
    }

    public function store(Request $request)
    {
        $this->create($request->all());

        return redirect()->route('meetings.index');
    }

    public function update($meeting, Request $request)
    {
        $this->update($meeting->zoom_meeting_id, $request->all());

        return redirect()->route('meetings.index');
    }

    public function destroy(ZoomMeeting $meeting)
    {
        $this->delete($meeting->id);

        return $this->sendSuccess('Meeting deleted successfully.');
    }
}

So this is all you need to integrate the zoom API, so easy 😊 Right. Enjoy the code.

November 11, 20201 minuteVishal RibdiyaVishal Ribdiya
How to increase profit in our business - 1

Introduction

How to maximize profits is on the minds of most business owners. There are only two ways to do this: increase prices or reduce costs. You cannot simply say that you are going to increase the profit of your business without a specific strategy. All you can do to increase profits is to improve the variables that ultimately determine your profitability. Consider the following strategies to make more money for you and your business in 2021.

1. Improve your website

People are using your website to research your company before doing business with you. Can you improve their experience and build their trust so they can use your product or service? There are four things you should clearly do on your website:
  • Explain who you are and what you sell
  • Entice a potential customer to buy
  • Make it easy to buy a product or service
  • There is a way to easily contact sales or customer support with questions

2. Invest in your business

At first glance, you would hesitate to put more money into your business. Especially when you’re trying to figure out how to make more money, not less. Often, especially in times of turmoil where new opportunities arise, the best decision is a short-term price for long-term payments.

3. Increase your advertising

You will not hesitate to spend money on advertising. Maybe you’ve been burned by a marketer in the past who promised results and didn’t get results. Or you tried advertising yourself, such as Facebook ads, and you don't think it works.

4. Raising prices

Both of these strategies are a thoughtful and unpleasant option in today’s economic environment. Still, sometimes, to stay in business, you need to raise prices. To determine the price, consider:
  • How much does it cost you to make a product
  • How much does it cost to deliver
  • Costs for running a business - including administration and employee salaries
  • Competitive price
  • The last time you raised a price
After reviewing this data, determine a possible reasonable price increase. Include any pricing data in your business plan so that if you choose to review it later, you can.
Next, deliver this increase to customers. Explain why you came to this decision. If there’s any way to add value to a product without cutting a profit, do it and let customers know they’re getting more.

5. Follow the 80/20 rule

The 80/20 rule is to focus your most important efforts on your most valued customers. The idea is that 20% of your customers usually bring in 80% of your revenue; These are the people you want to focus on.
On the flip side, 20% of your customers frequently present 80% of your problems. Identify those problem-customers and fire them to free up your time on more positive business activities.

6. Cut costs

One way to think about reducing costs is to consider the profit leverage effect (PLE). P.L.E. The idea is that every dollar saved in the production of goods or delivery of services adds a dollar profit to your bottom line without selling too much.
Check your current processes to reduce costs:
  • Are there areas where you can improve efficiency?
  • Negotiate cheap products or services?
  • Will adopting new software or renting a service save you money in the long run?
We will see more points in our next tutorial.
November 08, 20203 minutesAnkit KalathiyaAnkit Kalathiya
How to explain the tricks to close your next deal

Introduction

Persuasion is a method of communication aimed at influencing the attitudes, beliefs, or behaviors of others. In terms of sales, understanding usually occurs when a sales representative tries to convince a prospect that their product or service is the best solution to their problem.
Let's review the persuasion strategy you can implement today to close your next deal.

1. Personalize your message

If you want to explain the possibility of considering your product, resist the request to follow the general sales script. When you make excessive rehearsal noise or don’t share messages or information that seems to suit your prospect, your efforts go to one ear and go to the other.
This doesn't mean you need to fully wing your sales calls, it does mean you need to be prepared to adjust your message based on what interests you in the potential.

2. Focus on problem-solving

Instead of telling the prospect all the reasons why they should buy your product (which may feel pressure and emotion), focus on sharing all the reasons why your product can help them solve their problem. By focusing on their concerns and locating your offer as a solution, you are showing the value of your product without excessive pressure.

3. Give social proof

Letting your past customers sell to you - knowing when to take advantage of social proof can be a powerful persuasive trick.
While buyers may take your point as a sales representative with a grain of salt because they know you want to sell, they are more likely to trust a testimonial or story from a previous customer who was looking for a similar solution.

4. Assume goals

Picture: You feel ready to call your sales call. You think you have a solid understanding of who the prospects are and what they are looking for. Your notes have been typed and you are ready to close the deal.
Then during a call, potentially throws out several turns, asking you questions and mentioning objections that you weren’t prepared to account for - the dream of every sales rip. But don't go too far. This is a valuable learning experience.

5. Empower empowerment decision making

After all, you want your customers to buy from you because they really want to, not because they feel pressured. And let’s be realistic - including your prospects, don’t like to tell anyone what to do, so you’ll avoid being too direct in your approach. As a sales representative, it is your job to provide the context and information that makes your product a thought-provoking product.

6. Make personal connections

It's a basic rule of human interaction - we're all ready to trust and engage with people we really love on a deeper level. While buyers can choose your product or brand as a sales representative, you are the main source of human engagement representing your company.

7. Don’t rush into the process

Last but not least, don't rush your prospect through the sales process. We get it - you have goals on a regular basis. However, effective persuasion should seem natural to the prospect. They do not feel pressured or rushed to sign the dotted line. This doesn’t mean you can’t implement a sense of urgency or be on time - in fact making a little sense of urgency (such as paying a special price for a limited time) can be an effective trick.
October 16, 20203 minutesAnkit KalathiyaAnkit Kalathiya