Posts
Useful Shortcut Keys for Android StudioAndroid Development
Useful Shortcut Keys for Android StudioAndroid Development
Hello, friend, the shortcut way everyone likes. but remember a shortcut is to improve yourself and save time. It's a very good way. so in this blog learning the android studio shortcut key.use all short cut key and save time and performance improve
Search Keys:
- Shift+Shift — Search Everywhere
- Ctrl+F — Find Text within a Single File
- Ctrl+Shift+F-Find Text in All Files
- Ctrl+R — Replace Selected Text in a Single File
- Ctrl+Shift+R — Replace Selected Text in all Files (Be Careful while Using This)
- Ctrl+Shift+A —Search for IDE Commands
Navigation Keys:
- Ctrl+N — Navigate to Class
- Ctrl+Shift+N — Navigate to a File
- Ctrl+B — Jump to Declarations
- Alt+ ↑ — Jump to the Previous Method
- Alt+↓ — Jump to Next Method
- Ctrl+G — Jump to Line
- Ctrl+E — Recent Files
- Ctrl+Shift+Backspace — Jump to Last Edited Location
- Ctrl+B — Find Declarations
- Ctrl+Left Mouse(or)Ctrl+Alt+F7— Show Usage
- Alt + F7 / Ctrl + F7 — Find usages /Find usages in file
- Ctrl+Shift+B — Find Implementations
- F3 — Find Next
- Shift+F3 — Find Previous
BookMark Keys:
- F11 — Toggle bookmark
- Ctrl+F11 — Toggle bookmark with the mnemonic(0–9 or A-Z)
- Ctrl +(0–9) — Go to numbered bookmark
- Shift+F11 — Show all Bookmarks
- Ctrl + Shift + F7 — Highlight usages in file
Selection Keys:
- Ctrl + W — Extend selection (selects a word->line->method->Class )
- Ctrl +Shift+ W — Decrease Selection
- Alt + J — Select next occurrence
- Ctrl + Alt + Shift + J — Select all occurrences
- Alt + Shift + J — Unselect occurrence
- Ctrl+Shift+V — Paste from recent buffers (from a History of Copied Contents)
Editing Keys:
- Ctrl+F6 — Refactor Code
- Ctrl+D — Duplicate a Line/Selected part
- Ctrl+Y — Delete a Line/Selected part
- Ctrl+Q — Quick Documentation
- Ctrl + Space — Code completion
- Ctrl+Shift+Space — Smart code completion (by expected type removes unrelated suggestions)
- Alt+Insert — Generate Code
- Ctrl+J — Insert Live template
- Ctrl + O — Override methods
- Ctrl + I — Implement methods
- Ctrl + Alt + T — Surround with…
- Ctrl + / — Comment / uncomment with line comment
- Ctrl + Shift + / — Comment / uncomment with block comment
- Ctrl+Alt+L — Reformat code
Run:
- Ctrl + F9 — Compile and Run Make a project
- Ctrl + Shift + F9 — Compile selected file, package or module
- Shift + F10 — Run
- Shift + F9 — Debug
- Ctrl + Shift + F10 — Run context configuration from editor
Debugging:
- F8 / F7 — Step over / into
- Shift + F7 / Shift + F8 — Smart step into/Step out
- Alt + F9 — Run to cursor
- Alt + F8 — Evaluate expression
- F9 — Resume program
- Ctrl + F8 — Toggle breakpoint
- Ctrl + Shift + F8 — View breakpoints
How to Implement Splash Screen in AndroidAndroid Development
How to Implement Splash Screen in AndroidAndroid Development
What is a SplashScreen?
A splash screen is a screen that appears when you open an app on your mobile device. So, we can say that it is the first impression for the user. It is commonly used to show an application logo or an image associated with an application.
Implementation
So instead of using a layout file, we'll refer to the splash screen as the background of the activity theme. first, create an XML drawable splash_background.xml inside the res/drawable folder in
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/white" />
<item android:drawable="@drawable/ic_icon_vector" android:gravity="center" />
</layer-list>
next step, set splash_groundground.xml as the background for your splash activity in the theme. Add a new splash to your splash activity.
<!-- Splash Screen theme. -->
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_background></item>
</style>
Add your theme to AndroidManifest.xml as your splash activity theme.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.exmple.splash">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme">
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest></pre><div>
}
Create a blank activity for SplashActivity.java without XML. This class will only redirect to MainActivity.java.
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
startActivity(new Intent(SplashActivity.this, MainActivity.class));
finish();
}
}
How to implement Mailchimp into Gatsby SiteGatsby
How to implement Mailchimp into Gatsby SiteGatsby
We have recently developed a site into the gatsby. Basically, the contact us feature is common on all websites. and we are implementing Mailchimp because it's a very popular platform in the email market. So, I will show you how to set up a Mailchimp on the Gatsby site.
Using gatsby-source-mailchimp
Use your Mailchimp API key to download your campaigns into Gatsby’s GraphQL data layer! Install the package by running the following command: npm i gatsby-source-mailchimp --save
. How to configure Once the installation is complete, you can now add this plugin to your gatsby-config.js, like so: Configure Mailchimp Key and add this {resolve: gatsby-source-mailchimp
} into the plugins array. code looks like,
module.exports = {
// ...
plugins: [
{
resolve: 'gatsby-source-mailchimp',
options: {
// Avoid including your key directly in your file.
// Instead, opt for adding them to .env files for extra
// security ;)
key: 'asd712jdas90122jdas90122jkadsd1-usXX',
rootURL: 'https://usXX.api.mailchimp.com/3.0',
},
},
],
// ...
}
This plugin was made out of a specific necessity, so it doesn't cover all of Mailchimp’s data sources, focusing only on campaigns.
This plugin provides a few options. you can refer here
Using .env
variables to hide your key
If you don’t want to attach your API key to the repo, you can easily store it in .env files by doing the following:
Put this in your .env file
MAILCHIMP_KEY = 'asd712jdas90122jdas90122jkadsd1-usXX';
Put this in your gatsby-config.js file
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
});
module.exports = {
// ...
plugins: [
{
resolve: 'gatsby-source-mailchimp',
options: {
key: process.env.MAILCHIMP_KEY,
rootURL: '[https://usXX.api.mailchimp.com/3.0',](https://usxx.api.mailchimp.com/3.0%27,)
// ...
},
},
],
// ...
};
Recruitment:The things HR need to keep in mindHuman Resource
Recruitment:The things HR need to keep in mindHuman Resource
We all know that recruitment becomes tough day by day as the competition is growing in the market. If I talk about the IT industry each Organisation is fighting hard to find candidates for various IT profiles. Now all IT HRs are in trouble with lots of targets of hiring and it’s not as easy as ABC in practical. Sometimes it takes a very long time to get a response from the market for a particular profile. Still, we need to pay attention to many things to make a smooth & effective recruitment process.
- Build your network
- Attractive & Innovative Job Posting
- Choose Right Person & Be polite to others
- Communication: Be a good listener
- Affordability
- Talent v/s Experience
1.Build your network:
“Network is net-worth”. Without a network, it is too difficult to reach the right one. Every HR needs to develop a professional network. If I talk about the IT field we need to develop a network on LinkedIn to reach maximum people. Send connection requests to them Talk with them and scan candidates over there. Not only this we can use Facebook as well as the young generation addicted to it and target the suitable person over there.
2. Attractive & Innovative Job posting:
We are living in a competitive era, where we are fighting hard to even get responses from the market side and that’s why we need to be creative & innovative while preparing Job descriptions. prepare star lines to attract people, use different ways to post the job, give information regarding facilities the company is providing, any other attraction if the company has.
3. Choose the Right Person & Be polite to others:
After receiving lots of CVs for a particular role, it’s too critical to scan all and invite a few for Interviews. After interviewing all people we need to think about the best suitable person for the job.
HR needs to develop a habit to wish all the best to the not selected candidate. It creates a positive image of the company in that person's mind. And yes the second thing is, never use the “REJECTED” word for any candidate just say ‘unfortunately you are not selected’, even you can say ‘sorry to say that you are not best fit for the job’. I am saying this because there is no rejection, only the thing is our requirement and the capabilities of the applicant are quite different.
4. Communication: Be a good listener:
Communication skill is essential for all HR Professionals. While interacting with candidates, be open, communicate each and everything. HR needs to communicate all the rules, regulations, policies, agreement terms & conditions (If you have), Training period, and the pay scale during training ( If you are hiring fresher), etc. After discussing all the required things with the candidate, if the candidate is found comfortable then only arrange his/her interview otherwise it will be a waste of time for both Employers as well as Employees.
While taking interviews not only ask questions and get answers, be a good listener. Listening to the candidate with patience may be a different way of presenting but one has really deep knowledge about the same and at least gives the chance to present.
5. Affordability:
Always keep in mind the budget of the company for a particular position and don’t waste your valuable time with overqualified people. Say NO to them with respect, you can say ‘we don't have any requirement regarding your profile’.
6. Talent v/s Experience:
While recruiting people never fixed the experience parameter as it may be possible that the less experienced person has more talent. Carefully analyze the person and then only select the best out of them.
I will discuss more tips on recruitment in my next blog….
How to Create Custom CardView in AndroidAndroid Development
How to Create Custom CardView in AndroidAndroid Development
Customized CardView
dependencies {
implementation
‘androidx.cardview:cardview:1.0.0’
}
res > drawable > New > Drawable Resource File.
background1.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
background2.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
background3.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
Now create a card view in the main XML file. Here I used LinearLayout as the root widget, after using the card view. Below the codes that give you an idea of how to customize the card.
You can change it according to your needs.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="173dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Assam"
android:textColor="#000000"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Current Location"
android:textColor="#000000"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="25"
android:textColor="#000000"
android:textSize="28sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="o"
android:textColor="#000000"
android:textSize="13sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="18 %"
android:textColor="#000000"
android:textSize="14sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="6dp"
android:text="11.25 AM"
android:textColor="#000000"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="173dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg2"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Delhi"
android:textColor="@color/white"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2 days ago"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="39"
android:textColor="@color/white"
android:textSize="28sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="o"
android:textColor="@color/white"
android:textSize="13sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="35 %"
android:textColor="@color/white"
android:textSize="14sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="6dp"
android:text="01.05 PM"
android:textColor="#D6D6D6"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="173dp"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
app:cardCornerRadius="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg3"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Darjeeling"
android:textColor="#000000"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2 weeks ago"
android:textColor="#000000"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="30dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="12"
android:textColor="#000000"
android:textSize="28sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:text="o"
android:textColor="#000000"
android:textSize="13sp" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="9 %"
android:textColor="#000000"
android:textSize="14sp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="6dp"
android:text="05.00 AM"
android:textColor="#000000"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
Make fully configurable livewire searching componentLaravel
Make fully configurable livewire searching componentLaravel
Nowadays, laravel livewire is becoming more trendy for geeks. as most developers are using it, more and more issues are facing while developing the products. one of them is searching the records.
Recently we have developed the livewire common searchable component which makes your searching easier, as you can specify which fields you want to search by just giving the field name into the component.
What you have to do is just create a SearchableComponent class into your App\Http\Livewire directory. just copy the following class on the given namespace.
<?php
namespace App\Http\Livewire;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Livewire\Component;
use Livewire\WithPagination;
use Str;
abstract class SearchableComponent extends Component
{
use WithPagination;
/**
@var string
/
public $search = '';
/**
@var int
/
protected $paginate = 12;
/* @var Builder /
private $query;
/**
SearchableComponent constructor.
@param $id
/
public function construct($id)
{
parent::construct($id);
$this->prepareModelQuery();
}
/
Prepare query
/
private function prepareModelQuery()
{
/ @var Model $model */
$model = app($this->model());
$this->query = $model->newQuery();
}
/**
@return mixed
/
abstract function model();
/**
Reset model query
/
protected function resetQuery()
{
$this->prepareModelQuery();
}
/**
@return Builder
/
protected function getQuery()
{
return $this->query;
}
/**
@param Builder $query
/
protected function setQuery(Builder $query)
{
$this->query = $query;
}
/**
@param bool $search
@return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*/
protected function paginate($search = true)
{
if ($search) {
$this->filterResults();
}
$all = $this->query->paginate($this->paginate);
$currentPage = $all->currentPage();
$lastPage = $all->lastPage();
if ($currentPage > $lastPage) {
$this->page = $lastPage;
}
return $this->query->paginate($this->paginate);
}
/**
@return Builder
/
protected function filterResults()
{
$searchableFields = $this->searchableFields();
$search = $this->search;
$this->query->when(! empty($search), function (Builder $q) use ($search, $searchableFields) {
$searchString = '%'.$search.'%';
foreach ($searchableFields as $field) {
if (Str::contains($field, '.')) {
$field = explode('.', $field);
$q->orWhereHas($field[0], function (Builder $query) use ($field, $searchString) {
$query->whereRaw("lower($field[1]) like ?", $searchString);
});
} else {
$q->orWhereRaw("lower($field) like ?", $searchString);
}
}
});
return $this->query;
}
/**
@return mixed
/
abstract function searchableFields();
}
Now you have to extend your existing Laravel component by SearchableComponent. Let's say we already have the Tags livewire component. and it looks like the following.
App\Http\Livewire;
use App\Models\Tag;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
class Tags extends SearchableComponent
{
public function render()
{
$tags = $this->searchTags();
return view('livewire.tags', [undefined])->with("search");
}
/**
@return LengthAwarePaginator
/
public function searchTags()
{
$this->setQuery($this->getQuery());
return $this->paginate();
}
function model()
{
return Tag::class;
}
function searchableFields()
{
return [
];
}
}
So here we have extended our existing Tags component by SearchingComponent.
In searchable fields, you can specify the field name that you want to search. and replace the Model with your records Modal.
That's it. Now you don't need to write search queries again and again. just extend your livewire component by a searchable component.
Here are some Interesting livewire tutorials that you need to check :
What are some important qualities of graphic designers?Design
What are some important qualities of graphic designers?Design
The technical skills outlined above are necessary for graphic designers to execute the actual tasks assigned to them. But there are several transferable skills needed in order to successfully bring an idea from concept to creation.
Our analysis helped us identify five important qualities employers are seeking in graphic design candidates. Here's what we found
Creativity:
This one probably goes without saying, but graphic designers are tasked with identifying creative solutions to deliver a message or solve a problem. This requires an innate ability to think outside the box and bring forth innovative ideas on a regular basis.
Analytical:
A graphic designer should be able to step outside their own mind and view the product or service analytically and from different perspectives. That way they can help anticipate how the audience will receive it.
Communication:
Graphic designers must possess strong written and oral communication skills in order to effectively work with team members and clients alike. Asking inquisitive questions helps them understand expectations so their designs will align with their client's vision.
Time management:
Designers are often faced with the challenge of working on several projects with various deadlines at the same time. Being able to juggle multiple projects and meet stringent deadlines is essential to a successful design career.
Research:
Graphic design techniques and trends are constantly evolving, which means learning is never done for designers. In order to ensure their designs are meeting client objectives, they need to be willing to dig up insights about their audience and explore new strategies.
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.