Learnings Posts
How can I run my app on my phone without USB connection with my pcAndroid Development

How can I run my app on my phone without USB connection with my pcAndroid Development
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
Step 2: Click Plugins
Step 3: Install ADB Wi-Fi Plugin
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
Click ADB Wifi and the below screen will be displayed.
- 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.
How to increase profit in our business - 2Sales

How to increase profit in our business - 2Sales
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
8. Find a new Customer
9. Remove unprofitable service and product
10. Reduce labor costs with part-time workers
11. Develop a CEO monthly letter to employees to create teamwork and communication
12. Invest in your people
13. Send personal notes of congratulations or thank employees at their home
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.
How to generate thumbnails by using Spatie Media LibraryLaravel

How to generate thumbnails by using Spatie Media LibraryLaravel
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.
How to create APK and Bundle in android javaAndroid Development

How to create APK and Bundle in android javaAndroid Development
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:
- Debug APK
- 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
How to implement Google Analytics into Gatsby SiteGatsby

How to implement Google Analytics into Gatsby SiteGatsby
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.
How to integrate Zoom Meeting APIs with LaravelLaravel

How to integrate Zoom Meeting APIs with LaravelLaravel
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
- Go to Zoom marketplace and do sign in
- Click the Develop button on the header and select Build App menu.
- Choose the JWT and create an application with the app name that you want.
- 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.
How to increase profit in our business - 1Sales

How to increase profit in our business - 1Sales
Introduction
1. Improve 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
3. Increase your advertising
4. Raising prices
- 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
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
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
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?
How to explain the tricks to close your next dealSales

How to explain the tricks to close your next dealSales
Introduction
Let's review the persuasion strategy you can implement today to close your next deal.
1. Personalize your message
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
3. Give social proof
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
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.