This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Thursday, 16 April 2020

Sniper 3D: Fun Offline Gun Shooting Games Free v3.8.0 Feature app

Sniper 3D: Fun Offline Gun Shooting Games Free v3.8.0 Feature app

What news:

we change to new type of mod menu.
In this version, please use SAI tool to install this APK if you got any problem.


Sniper 3D: Fun Offline Gun Shooting Games Free v3.5.2 Unlock All

Sniper 3D v3.2.6 Game (Unlock Money, Gun and Gear, anti update)





Description:

Call the best shooter, the guns are ready to action! Download now Sniper 3D for free, the popular free fun gun shooting game. Be the one men army, the sniper assassin to killing in online and offline world. Sniper 3D, the cool fun shooting and action game!




In this fun cool game you are the army's best sniper, shooting guns and killing to stop assassins in the daily war. When the sniper assassin gets the gun in action, no army can stop him! Choose the best gun and start shooting the best fun game for free, online and offline.

Ultra-realistic 3D Graphics
  • The best 3D action game, quality in guns and cool shooting.
Popular Free Army Game
  • Easy and intuitive new controls, aim and shoot to be the best sniper in the war.
New Cool Missions
  • Be the number 1 sniper and help the war shooting the running assassin and killing the kingpin in cool offline missions or join the army and be the best online killer.
Upgrade your Gun
  • Unlock cool guns and upgrade them to build the ultimate weapon. Buy all types of guns: the best sniper rifles for offline missions, shotguns or pistols to free your power in online war! Upgrade the ammo, grip, and the caliber to get bullets that make more damage in the war.
Fun Online and Offline Game
  • The best shooting action experience! Play with new and cool snipers from all around the world, it's fun! Become the best sniper from online and offline games!
The sniper assassin is waiting for you, get a gun and go to action! Join the army and start killing assassins right now for free! Only the best sniper will win the war.

Fun Games For Free made for you the best free and fun action shooting game: Sniper 3D: Fun Offline Gun Shooting Games Free ! Start gaming now, online or offline!




Information:

Root requirement: No

Internet connection requirement: Yes

Mod Features:
  • Free Shop (Can Select Any Weapon - Demo)
  • Hack Gun (Unlimited Bullet, No Spread, All Silence, High Speed)
  • Hack Gear
  • Cheat 1500 Worlds Ops: This function will allow you get 1500 red skull for each map you play in WORLDS OPs.
  • Enable Sniper Vault
  • Can Watch Ads: This function will allow you to watch ads to earn diamonds as much as you want.
  • Fake Premium Data: This is just a FAKE Data.
  • Unlock Hidden Region For New Account
  • Cheat Arena Challenger: This is just a fake data to get you alwasy in challenger. Not sure working.
  • Auto AIM & Show Enemy Location: This function will allow you find the location of enemy automatically. And also pop up the damage if they was shot. So you can find them easily and Kill Steal (KS) if you are faster.
  • Cheat Exp: This function will let you reach the maximum level after playing any map.
  • Disable Anti Cheat: This function will allow you use Diamonds without any error.
  • Disable Force Update
How to install game:


Download the desired APK file and tap on it to install it on your device. Please make also sure to uninstall your game first if you have it installed!

Preview in this mod:


With this Feature app, you can play this game with all Money, Gun and Gear, anti update. It's really a funny game for everything.

Join author's conversation for getting information about Feature App

Video Preview:


Official Source:

Download from Google Play Store.

Sunday, 12 April 2020

My Cafe - Restaurant game v2020.4.6 Free Shop (Ruby, Coin, Crystal) & More

My Cafe - Restaurant game v2020.4.6 Free Shop (Ruby, Coin, Crystal) & More

What's new in this version:
  • Dice 1 Point: This function will let you dice with 1 point in Bunny Map
  • Cheat Crystal Festival Mission: This function will let you increase 1000 crystal per 1 mission which you finish in Festival
  • Fix Dice Roll: Will help you not get negative number when dice roll.
  • Game have a Huge update, with total new 483 Anti Cheat Function. We have to delay this version to check them very carefully before add the Bypass Code.









Description:

Join more than 50 million coffee lovers around the world and unleash your entrepreneurial spirit in this FUN and RELAXING restaurant game. Decide on your cafe or restaurant business STRATEGY and earn income, even when you are offline!





RESTAURANT GAME SIMULATION


  • With My Cafe you can own and grow a coffee shop or a restaurant of your dreams
  • Decorate your coffee shop as you wish, hire and train staff, decide on cafe menu items and even set prices as you see fit
  • CAFE MAKEOVER
  • Do you have a knack for design? Hone your interior design skills and do a total cafe or a restaurant makeover
  • In this cooking game, you can choose from numerous decor styles, position furniture as you wish, and make a coffee shop totally yours by accentuating with elements that show your true self
INTERACTIVE STORYLINES IN YOUR CAFE


  • As a true coffee shop owner, you will get to meet your customers from various backgrounds and get to help them navigate through life. In this restaurant game you can pick between different lines of dialogue with customers and see where your story takes you!
  • Do you like drama? Romance? In My Cafe, the choice is all yours!
  • GO SOCIAL WITH MY CAFE
  • Play my cafe with friends and meet like-minded coffee lovers to form townships and compete against owners of other coffee shops
  • Fulfill festival tasks and lead your town to success together!
COFFEE AND CAFE MANIA: Do you love coffee as much as we do?


  • Unleash your barista superpower and create custom coffee and tea drinks for all your guests
  • Unlock unique coffee recipes and spice up everyone’s life in your cafe with distinctive coffee drink combinations
••••••••••••••••••••••

My Cafe: Recipes & Stories is FREE to download and play with no obligations to pay. However, some in-game items can be purchased for real money. If you wish to disable this feature, please turn off in-app purchases in your device’s settings





••••••••••••••••••••••


Information:

Root requirement: No

Internet connection requirement: Yes

Mod Features:
    • Free Shop: This function will let you buy with free (Using gold, crystal and ruby)
    • Hack Exp: This function will add 1.376.256 exp to you for each item you put on your Shop
    • Unlock Shop: This function will unlock all of item in shop which require level to unlock
    • Refresh Data From Server: This function will let you can open daily gift continuous, play Quiz, dice roll with magaret, sell Furniture without any limit.
    • Cheat Roll Dice: This function will allow you roll dice in Mini Board Game (With bunny) with free ticket.
    • Fake Vip Level: This function will fake the vip level for you to level 7. You can hire 5th staff. This is just fake data. Not real.
    • Cheat Deliever oder: This function will let you delieve phone oder immediately without any limit. you can get unlimit spice from here.
    • Hack Speed Staff: This function will let your staff move with very fast speed.
    • Cheat mission: This function will unlock all mission for you. And the only thing you need is completed by talking with your customer.
    • Instant refill machine: This function will refill your machine immediately.
    • Disable Anti Cheat: This function will make you safe with cheat. i added the Anti Ban also to this MOD.
    • Dice 1 Point: This function will let you dice with 1 point in Bunny Map
    • Cheat Crystal Festival Mission: This function will let you increase 1000 crystal per 1 mission which you finish in Festival
    • Fix Dice Roll: Will help you not get negative number when dice roll.
    P/s: Please take care and do not push your level too quick or your account will be banned manual by admin.
How to install game:


Download the desired APK file and tap on it to install it on your device. Please make also sure to uninstall your game first if you have it installed!

Preview in this mod:


With this Feature app, you can play this game with all Free Shop, Free Ruby, Free Coin, Free Crystal. It's really a funny game for your kids.


Join author's conversation for getting information about Feature App

Video Preview:



Official Source:


Download from Google Play Store.

Saturday, 11 April 2020

Plants vs. Zombies™ Heroes v1.34.32 Feature App (1 hit kill, zero damage and more)

Plants vs. Zombies™ Heroes v1.34.32 Feature App (1 hit kill, zero damage and more)

Plants vs. Zombies™ Heroes - Game Unlock All (1 hit kill, zero damage and more)






Description:



From the makers of Plants vs. Zombies 2 and Plants vs. Zombies Garden Warfare 2 comes the next great game in the epic battle between doom and bloom – Plants vs. Zombies Heroes. Collect Heroes with outrageous and incredible super powers and build your ultimate battle team. Embark on a journey to discover new characters, and confront mighty opponents along the way. And, for the first time ever on mobile, play as either plants or zombies. It’s the lawn of a new battle!

COLLECT YOUR HEROES
Collect and choose from 20 unique Plant and Zombie Heroes and unlock their lawn-inspiring super powers. Will you pick Plants and deploy the masked, sharp-shooting avenger, Green Shadow? Or will you choose a Zombie Hero and call on the superbly superficial Super Brainz, Zomboss’s secret weapon with a powerful punch and fondness for hair gel? Each Hero’s selection of super powers will help determine your team’s winning strategy.

FORM YOUR TEAM
Every Hero needs a crew. Build yours and diversify your skills by collecting teammates – from the PvZ characters you know and love, to daring new plants and zombies. There are hundreds to discover! Devise distinct strategies for your Hero by selecting compatible teammates and experiment with devastating combos. Or, use Auto Team-Builder to quickly create your team, try out new strategies, and automatically upgrade your teams as you collect new characters.





GO ON COURAGEOUS ADVENTURES
Journey through the universe of PvZ Heroes as each action-packed skirmish takes you further along an ever-blooming map. Battle brain-thirsty or botanical foes – each side has a different path to follow. Encounter challenging bosses with tricky powers and abilities, and defeat them for legendary rewards!

PLAY AGAINST FRIENDS AND FOES
Test your team when you take on other players in exciting real-time matches. Earn rewards for defeating your bite-iest adversaries, and build your bank when you complete Daily Missions from Crazy Dave. Who will become the ultimate horticultural hero? Harvest your courage – the battle is on!

Important Consumer Information: Requires acceptance of EA’s Privacy & Cookie Policy and User Agreement. Collects data through third party analytics technology (see Privacy & Cookie Policy for details). Contains direct links to the Internet and social networking sites intended for an audience over 13.

Information:

Root requirement: No

Internet connection requirement: Yes

Mod Features:


  • 1 Hit Kill: This function will let you and your enemy does 2304 damage
  • Zero Damge: This function will let you and your enemy does 0 Damage.
  • Hack Tickets Daily Battle: This function need to enable at starting of the game. It will let you get 4800 tickets in daily battle.
  • Enable Daily Battle & Anti cheat: This function will let you can play daily battle without waiting time (You can retry without waiting 1 hour)
  • Zero sun cost: This function will let you and AI (Sure because it only happen in your device) play cards with zero sun cost.
  • Unlock all cards: This function will unlock all of heroes and every cards for you.

P/s: This function cannot play in pvp mode. But with a little brain, you can play in pvp mode. Just switch at the right time.

Get all Quest: This function may not work correctly. So do not mind this.

How to install game:


Download the desired APK file and tap on it to install it on your device. Please make also sure to uninstall your game first if you have it installed!

Preview in this mod:


With this Feature app, you can play this game with all 1 hit kill, zero damage and more. It's really a funny game for your everything.


Join author's conversation for getting information about Feature App

Video Preview:


Official Source:

Download from Google Play Store.

Friday, 10 April 2020

How can i install Xposed on Nox Android 7.1.2?

How can i install Xposed on Nox  Android 7.1.2?


Lot of people will ask about this problem. Because on Nox android 7.1.2, there is no Xposed installer can install Xposed module. So how can we do that?

To install Xposed, we will need these file:


  1. Xposed SDK Module
  2. Xposed installer 3.15
  3. Terminal Emulator for Android

We do not need to install Super Su. Because Nox will be broken after install Super SU.




After download and install all of the tool above. Follow these steps.


  1.  Extract the Xposed SDK Module and you will get the "xposed" Folder.
  2. Copy this Folder and paste to the /sdcard. 
  3. Run Terminal Emulator. 
  4. Type the command "super su"
  5. Type the command "cd /sdcard/xposed"
  6. Type the command "sh flash-script.sh"
  7. Wait until the process complete. And then reboot Nox.
  8. Run the Xposed installer, and you will see that Xposed module was installed on Nox.


If you still get any problem, just leave a comment here and we will help you.

Rising Super Chef - Craze Restaurant Cooking Games v4.2.3 (Unlimited everything, unlock everything, disable anticheat)

Rising Super Chef - Craze Restaurant Cooking Games v4.2.3 (Unlimited everything, unlock everything, disable anticheat)








Description:





Dive into the master chef’s fever of cooking, feel the cooking madness of serving feverish customers, from town to town, city to city, bakery to cafe, dash for cooking tasty burger & pizza in a crazy kitchen, baking cakes & desserts in the bakery, making all kinds coffee in the cafe, and serving tasty fast food all over the world in the fast-paced Rising Super Chef - Craze Restaurant Cooking Games - a crazy time management cooking game with more than 1000 levels, simply the most unmissable free new cooking game in 2019!



Are you up for the madness and craze of cooking in Rising Super Chef - Craze Restaurant Cooking Games? Emma has learned a lot of cooking skills from the cooking academy and stepped on her own cooking adventure to write a new story of her cooking cruise. But she won’t make it without the help from someone like the star master chef Ramsey. Do you want to experience cooking fast food in a food truck around the world, running a burger shop in the cafe land, completing the everyday task on the cooking diary, scrambling for the time of the kitchen wares and serving various feverish customers before it overcooked? Then this is your best choice!



Game features:

* More than 25 maps.

* More than 600 food from real recipes to cook & bake using 200 ingredients.
* More than 1000 fun craze levels.
* Hundreds of upgrades for kitchen and dress
* Offline cooking game, feel free to play offline without Wi-Fi anytime anywhere!

Tasty Restaurant Recipes:
- Breakfast & Cafe Cooking Game: King Burger, Hamburger, Coffee, Toast, Bacon, Omelet, Fruit salad, Pan cake, Sausage, Scramble egg, Muffins, Bread ...🇺🇸
- British Cuisines Cooking Game: English Roast Beef, Cottage Pie, Scones, Fried Fish, British Chips, Yorkshire Pudding, Cornish Pasties, Bruschetta, ...🇬🇧
- Bakery Desserts Cooking Game: Brownie, Cupcake 🥧, Cheese cake 🍮, Chocolate cake, Cranberry cake, Blueberry cake, Milkshake, Pie, Muffins, Yogurt salads, Crushed Candy ...🇩🇪
- Ice Cream Shop: Banana yogurt ice cream, Chocolate ice cream, Waffles, Fruit ice creams🍧 ...🇫🇷
- Italian Cuisines Tasty Cooking Game: Caesar salad, Beef tomato sauce, Fish baking melaleuca, Fish pasta, Grilled shrimp, Grilled fish, Mussels, Shrimp pasta 🍝, Seafood soups ...🇮🇹
- Mexican Cuisines Tasty Cooking Game: Avocado Salad and Sauce, Baking Beef Cornflakes🌮, Green Salsa, Red Salsa, Tacos, Tortilla ...🇲🇽
- Thai Cuisines Tasty Cooking Game: Tom Yum Soup, Thai-style shrimp sashimi, Thai Sour Chili Sauce, Thai crab curry, Squid Curry, Chicken Curry, Baking Squid, Tom Yam Prawn Pizza, Lemongrass Baking Chicken, Sticky Rice, Fried Rice ...🇹🇭
And there are also dozens of theme cooking games such as seafood, Chinese food, Japanese food, Turkish food, BBQ, ……. Just too many tasty restaurants and food to count, why not download for free and give it a try now!

Have you caught a fever of fun craze Cooking Games, Bakery Games, Restaurant Simulator or Cafe Games? Would you like to keep up with rush hours and be better in time management? And learn how to cook tasty burger, pizza, coffee, cakes and all kinds of worldwide cuisines? Do you feel like the master chef of cooking games? Then this is the cooking game for you. Don’t wait, download it for free now!


Information:

Root requirement: No

Internet connection requirement: Yes

Mod Features:


Unlimited everything
unlock everything
disable anticheat

Do not turn on cheat all the time. Just turn on when you need to buy anything.

Note: If you enable cheat at the beginning of the game, it will unlock everything to you. When you purchase anything, it will become unlimited. The MOD version will let the game save the progress to your profile (Facebook ...) and you can restore your progress on other device to play without MOD. You can use the MOD on android and restore on IOS to play.

Please use SAI tool to install this game.

Please watch the video very carefully to know how to use the MOD.

How to install game:


Download the desired APK file and tap on it to install it on your device. Please make also sure to uninstall your game first if you have it installed!

Preview in this mod:


With this Feature app, you can play this game with all of characters, unlimited Pony Power. It's really a funny game for your kids.


Join author's conversation for getting information about Feature App

Video Preview:




Official Source:

Download from Google Play Store.

How many solution to Request permissions in Android Application?

How many solution to Request permissions in Android Application?



Starting from Android 6.0 (API 23), users are not asked for permissions at the time of installation rather developers need to request for the permissions at the run time. Only the permissions that are defined in the manifest file can be requested at run time.
Types of Permissions:



  1. Install-Time Permissions: If the Android 5.1.1 (API 22) or lower, the permission is requested at the installation time at the Google Play Store.
     

    If the user Accepts the permissions, the app is installed. Else the app installation is cancelled.
  2. Run-Time Permissions: If the Android 6 (API 23) or higher, the permission is requested at the run time during the runnnig of the app.






If the user Accepts the permissions, then that feature of the app can be used. Else to use the feature, the app requests the permission again.

So, now the permissions are requested at runtime. In this article, we will discuss how to request permissions in an Android Application at run time.

Steps for Requesting permissions at run time :
  1. Declare the permission in Android Manifest file: In Android permissions are declared in AndroidManifest.xml file using the uses-permission tag.

     <uses-permission android:name=”android.permission.PERMISSION_NAME”/> 
    Here we are declaring storage and camera permission.

    <!--Declaring the required permissions-->
    <uses-permission
    android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission
    android:name="android.permission.CAMERA" /> 
  2. Modify activity_main.xml file to Add two buttons to request permission on button click:

    Permission will be checked and requested on button click. Open activity_main.xml file and add two buttons in it.



    <!--Button to request storage permission-->
    <Button
    android:id="@+id/storage"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Storage"
    android:layout_marginTop="16dp"
    android:padding="8dp"
    android:layout_below="@id/toolbar"
    android:layout_centerHorizontal="true"/> 

    <!--Button to request camera permission-->
    <Button
    android:id="@+id/camera"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Camera"
    android:layout_marginTop="16dp"
    android:padding="8dp"
    android:layout_below="@id/storage"
    android:layout_centerHorizontal="true"/> 
  3. Check whether permission is already granted or not. If permission isn’t already granted, request user for the permission:

    In order to use any service or feature, the permissions are required. Hence we have to ensure that the permissions are given for that. If not, then the permissions are requested.

    Check for permissions:

    Beginning with Android 6.0 (API level 23), the user has the right to revoke permissions from any app at any time, even if the app targets a lower API level. So to use the service, the app needs to check for permissions every time.

    Syntax:


    if(ContextCompat.checkSelfPermission(thisActivity,
    Manifest.permission.WRITE_CALENDAR)
    != PackageManager.PERMISSION_GRANTED)
    {
    // Permission is not granted
    }


    Request Permissions: When PERMISSION_DENIED is returned from the checkSelfPermission()
    method in the above syntax, we need to prompt the user for that
    permission. Android provides several methods that can be used to request
    permission, such as requestPermissions().


    Syntax:




    ActivityCompat.requestPermissions(MainActivity.this,
    permissionArray,
    requestCode);
    Here permissionArray is an array of type String.





    Example:




    // Function to check and request permission public void checkPermission(String permission, int requestCode) {
    // Checking if permission is not granted if (ContextCompat.checkSelfPermission( MainActivity.this, permission) == PackageManager.PERMISSION_DENIED) { ActivityCompat .requestPermissions( MainActivity.this, new String[] { permission }, requestCode); } else { Toast .makeText(MainActivity.this, "Permission already granted", Toast.LENGTH_SHORT) .show(); } }


    This function will show a toast message if permission is already granted otherwise prompt user for permission.


  4. Override onRequestPermissionsResult() method: onRequestPermissionsResult() is called when user grant or decline the permission. RequestCode is one of the parameteres of this function which is used to check user action for corresponding request. Here a toast message is shown indicating the permission and user action.




  5. Example:
    // This function is called when user accept or decline the permission.
    // Request Code is used to check which permission called this function.
    // This request code is provided when user is prompt for permission.
    @Override
    public void onRequestPermissionsResult(int requestCode,
    @NonNull String[] permissions,
    @NonNull int[] grantResults)
    {
    super
    .onRequestPermissionsResult(requestCode,
    permissions,
    grantResults);
    if (requestCode == CAMERA_PERMISSION_CODE) {
    // Checking whether user granted the permission or not.
    if (grantResults.length > 0
    && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
    // Showing the toast message
    Toast.makeText(MainActivity.this,
    "Camera Permission Granted",
    Toast.LENGTH_SHORT)
    .show();
    }
    else {
    Toast.makeText(MainActivity.this,
    "Camera Permission Denied",
    Toast.LENGTH_SHORT)
    .show();
    }
    }
    else if (requestCode == STORAGE_PERMISSION_CODE) {
    if (grantResults.length > 0
    && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
    Toast.makeText(MainActivity.this,
    "Storage Permission Granted",
    Toast.LENGTH_SHORT)
    .show();
    }
    else {
    Toast.makeText(MainActivity.this,
    "Storage Permission Denied",
    Toast.LENGTH_SHORT)
    .show();
    }
    }
Below is the complete code of this application:

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.geeksforgeeks.requestPermission">
<!--Declaring the required permissions-->
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.CAMERA" />
<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/AppTheme">
<activity
android:name=".MainActivity">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest> 

MainActivity.java

import android.Manifest;
import android.content.pm.PackageManager;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
// Defining Buttons
private Button storage, camera;
// Defining Permission codes.
// We can give any value
// but unique for each permission.
private static final int CAMERA_PERMISSION_CODE = 100;
private static final int STORAGE_PERMISSION_CODE = 101;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
storage = findViewById(R.id.storage);
camera = findViewById(R.id.camera);
// Set Buttons on Click Listeners
storage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
checkPermission(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
STORAGE_PERMISSION_CODE);
}
});
camera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
checkPermission(Manifest.permission.CAMERA,
CAMERA_PERMISSION_CODE);
}
});
}
// Function to check and request permission.
public void checkPermission(String permission, int requestCode)
{
if (ContextCompat.checkSelfPermission(MainActivity.this, permission)
== PackageManager.PERMISSION_DENIED) {
// Requesting the permission
ActivityCompat.requestPermissions(MainActivity.this,
new String[] { permission },
requestCode);
}
else {
Toast.makeText(MainActivity.this,
"Permission already granted",
Toast.LENGTH_SHORT)
.show();
}
}
// This function is called when the user accepts or decline the permission.
// Request Code is used to check which permission called this function.
// This request code is provided when the user is prompt for permission.
@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults)
{
super
.onRequestPermissionsResult(requestCode,
permissions,
grantResults);
if (requestCode == CAMERA_PERMISSION_CODE) {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(MainActivity.this,
"Camera Permission Granted",
Toast.LENGTH_SHORT)
.show();
}
else {
Toast.makeText(MainActivity.this,
"Camera Permission Denied",
Toast.LENGTH_SHORT)
.show();
}
}
else if (requestCode == STORAGE_PERMISSION_CODE) {
if (grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(MainActivity.this,
"Storage Permission Granted",
Toast.LENGTH_SHORT)
.show();
}
else {
Toast.makeText(MainActivity.this,
"Storage Permission Denied",
Toast.LENGTH_SHORT)
.show();
}
}
}
activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".MainActivity">
<!-- To show toolbar-->
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:background="@color/colorPrimary"
app:title="GFG | Permission Example"
app:titleTextColor="@android:color/white"
android:layout_height="?android:attr/actionBarSize"/>
<!--Button to request storage permission-->
<Button
android:id="@+id/storage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Storage"
android:layout_marginTop="16dp"
android:padding="8dp"
android:layout_below="@id/toolbar"
android:layout_centerHorizontal="true"/>
<!--Button to request camera permission-->
<Button
android:id="@+id/camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Camera"
android:layout_marginTop="16dp"
android:padding="8dp"
android:layout_below="@id/storage"
android:layout_centerHorizontal="true"/>
</RelativeLayout>