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 1095829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:11:16+00:00 2026-05-17T00:11:16+00:00

I have been trying to use reflection for a specifiec Field in the android.os.build

  • 0

I have been trying to use reflection for a specifiec Field in the android.os.build class, the MANUFACTURER field…
I have tried by using this code :

try
    {
        Class myBuildClass = android.os.Build.class;
        Field m1 = Build.class.getDeclaredField("MANUFACTURER");
        validField = true;

        manufacturer = Build.MANUFACTURER;
    }
    catch(Exception ex)
    {
        manufacturer = Build.PRODUCT;
        System.err.println("getDeviceSpecifics, got an exception during getting Field : " + ex.toString());
    }

I am gettign the following errors :

06-01 11:26:37.639: WARN/dalvikvm(7342): VFY: unable to resolve static field 2 (MANUFACTURER) in Landroid/os/Build;
06-01 11:26:37.639: WARN/dalvikvm(7342): VFY:  rejecting opcode 0x62 at 0x0048

06-01 11:26:37.639: WARN/dalvikvm(7342): VFY:  rejected Lmypackage/android/managementModule/Management;.getDeviceSpecifics ()V
06-01 11:26:37.639: WARN/dalvikvm(7342): Verifier rejected class Lmypackage/android/managementModule/Management;

And when debugging I noticed that InvocationtargetException is continuesly thrown, so I am guessing I haven’t been implementing the whole Reflection principle correctly…
Any idea where things are going wrong or otherwise on how to implement Refelction for a single Field correctly ?

  • 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-05-17T00:11:16+00:00Added an answer on May 17, 2026 at 12:11 am

    Perfect solution

    try // reflection
      {
       Field manufacturerField = android.os.Build.class
         .getDeclaredField("MANUFACTURER");
       manufacturerField.setAccessible(true);
       String manufacturerName = manufacturerField.get(
         android.os.Build.class).toString();
       System.out.println("manufacturerName: " + manufacturerName);
    
      } catch (Exception ex) {
    
       System.err
         .println("getManufacturerName, got an exception during getting Field : "
           + ex.toString());
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to use the hibernate dialect for SQLite from http://code.google.com/p/hibernate-sqlite/ in
I have been trying to use my new IOIO for android, and needed to
I have been trying to use date_format , however as far as I know,
I have been trying to use array_unique to remove duplicates from the search results
I have been trying to use routes.rb for creating a URL /similar-to-:product (where product
I have been trying to use/save the boolean value of a checkbox in other
I have been trying to use 3rd party tool called visiblox for rendering charts
I have been trying to use the document.getElementByID to pull information from an HTML
Right now I have been trying to use Launchpad's API to write a small
Ok I'm stumped. I have been trying to use Simpletip to create a tooltip

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.