Skip to content

Instantly share code, notes, and snippets.

View mukeshkumar7470's full-sized avatar
🚩

MUKESH KUMAR PATEL mukeshkumar7470

🚩
View GitHub Profile
@mukeshkumar7470
mukeshkumar7470 / full_screen.java
Created March 8, 2022 09:27
Android - Making activity full screen with status bar on top of it
//put below of code inside onCreate()
private void setStatusBarTransparent() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
View decorView = window.getDecorView();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import java.text.SimpleDateFormat;
import java.util.Calendar
public class MainActivity extends AppCompatActivity {
TextView dateTimeInLongTextView, format1, format2,
format3, format4, format5, format6, format7;
@mukeshkumar7470
mukeshkumar7470 / get_current_location_flutter.dart
Last active December 17, 2021 12:27
Get Current location
<!--Add Dependency-->
geolocator: ^8.0.1
geocoding: ^2.0.1
<!----------- requirement --------->
android {
compileSdkVersion 31
@mukeshkumar7470
mukeshkumar7470 / delete_project_from_google_console.md
Last active August 7, 2021 07:00
How to delete Project from Google Developers Console
@mukeshkumar7470
mukeshkumar7470 / printhash.java
Created August 6, 2021 16:46
printKeyHash generate
printKeyHash(this);
public static String printKeyHash(Activity context) {
PackageInfo packageInfo;
String key = null;
try {
//getting application package name, as defined in manifest
String packageName = context.getApplicationContext().getPackageName();
---------or create a new repository on the command line-------------
echo "# LoginDemo" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M master
git remote add origin https://github.com/mukeshkumar7470/LoginDemo.git
git push -u origin master
---------or push an existing repository from the command line---------------
/*Java solution
The "-" is used to left indent
The "15" makes the String's minimum length it takes up be 15
The "s" (which is a few characters after %) will be substituted by our String
The 0 pads our integer with 0s on the left
The 3 makes our integer be a minimum length of 3 */
import java.util.Scanner;
public class Solution {
@mukeshkumar7470
mukeshkumar7470 / Add_two_arrays.cpp
Created July 21, 2021 17:37
Write a program to add the corresponding elements of two arrays, each of size N and print the sums. N can be any integer between 1 and 100.
/* Instructions:
We have defined an integer variable N for you.
We have provided the code to get the input for variable N.
We have defined integer arrays , and .
We have provided the code to get the input for the array elements.
You have to write the logic to add the array elements.
Store the sum values in respective elements of variable
Print all the elements of with space between them
Sample Input:
@mukeshkumar7470
mukeshkumar7470 / Sum_of_N_numbers.cpp
Created July 21, 2021 17:35
Write a program to print the sum of all the elements of an array of size N where N can be any integer between 1 and 100.
/*Instructions:
We have defined an integer variable N for you.
We have provided the code to get the input for variable N.
We have defined an integer array .
We have provided the code to get the input for the array elements.
You have to write the logic to add the array elements.
Print the sum.
Sample Input:
N = 3
@mukeshkumar7470
mukeshkumar7470 / sum_of_two.cpp
Created July 21, 2021 17:32
Write a program to print the sum of two integers.
/* Maths and logic are the necessary parts of programming that can be learned through practice. Here is a simple mathematical problem of addition for you to solve.
Write a program to print the sum of two integers.
Instructions:
We have defined two integer variables and for you.
We have provided the code to get the input for the two variables.
You have to write the logic to add the two variables.
Print the sum. */