Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8874441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:43:19+00:00 2026-06-14T18:43:19+00:00

I would like to detect if the phone running my Android application uses hardware

  • 0

I would like to detect if the phone running my Android application uses hardware buttons or virtual buttons (Galaxy Nexus).

Is there a way to get this information?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:43:21+00:00Added an answer on June 14, 2026 at 6:43 pm

    Since API level 14 you can use ViewConfiguration.hasPermanentMenuKey() to detect if a device has a permanent menu key.

    Generally, virtual and physical buttons are mutually exclusive, so this would help you. Example:

    public class MyActivity extends Activity {
    
        // ...
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            boolean hasPermanentMenuKey = ViewConfiguration.get(this).hasPermanentMenuKey();
            boolean hasVirtualKeys = !hasPermanentMenuKey;
            String message = hasVirtualKeys ? "This device has virtual menu keys" : "This device has physical keys";
            Toast.makeText(this, message, Toast.LENGTH_LONG).show();
        }
        // ...
    
    }
    

    WARNING: There are some cases in which this won’t help you. For example, say a manufacturer decides to use virtual keys along with physical menu keys; then this method wouldn’t help you. Another case would be if the phone has no virtual keys and no physical menu key (e.g. Samsung S5).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to detect if the current users phone has a hardware keyboard
I would like to detect if file1.xml is different than file1.xmlCheck is there a
I would like to detect a change in uitextfield and when ever there is
In an Android app I'm making, I would like to detect when a user
Is there a way to list all the applications installed on the Android Phone,
I would like to develop a application that checks if the current Windows Phone
I would like to detect the position of the Android mobile device without internet
I would like to detect when a page load request give to a UIWebView
I would like to detect the following sequences: a aA aAa aAaA ... where
I have a database with almost 100,000 comments and I would like to detect

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.