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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:21:50+00:00 2026-05-22T02:21:50+00:00

i am creating own framework api (telephone services related api) i am creating one

  • 0

i am creating own framework api (telephone services related api) i am creating one library app this library app to create myjar.jar i am developing another application just i am adding asset folder this myjar.jar and configure this jar adding buildpath
in coding importing the package

this application run into real device:

MacTesting mp = new MacTesting();
mp.getMacAddress();
Log.v("1111","this is mac add"+ mp.getMacAddress());

result is null

public class MacIdTesting extends Activity implements Parcelable
{
    public static final String KEY_WIFI_MAC_ADDRESS = null;

    public  static final String READ_PHONE_STATE = null;

    /** Called when the activity is first created. */
       public String mMacAddress;
       public String phonenumber;
       void setMacAddress(String macAddress) {
           this.mMacAddress = macAddress;
       }

       public String getMacAddress() {
           return mMacAddress;
       }
       public String getLine1Number() 
       {
       ContextWrapper mContext = null;
       mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
           MacIdTesting mPhone = null;
        return mPhone.getLine1Number();
       }

      public void onCreate(Bundle savedInstanceState) 
      {
        super.onCreate(savedInstanceState);

        WifiManager manager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
        WifiInfo wifiInfo = manager.getConnectionInfo();
        String MACAddress = wifiInfo.getMacAddress(); 
        System.out.println("macsddress "+MACAddress);
       }

    @Override
    public int describeContents()
    {
        // TODO Auto-generated method stub
        return 0;


    }
    @Override
    public void writeToParcel(Parcel dest, int flags)
    {
        // TODO Auto-generated method stub
        dest.writeString(mMacAddress);  
    }
}

see this screenshot

how can solve this problem

  • 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-22T02:21:51+00:00Added an answer on May 22, 2026 at 2:21 am

    Your class is an activity and has onCreate method, but not a constructor.

    I change the onCreate method to be a constructor like that (and remove the extends activity):

     public MacIdTesting(Context ctx) 
          {
            WifiManager manager = (WifiManager) ctx.getSystemService(Context.WIFI_SERVICE);
            WifiInfo wifiInfo = manager.getConnectionInfo();
            mMacAddress = wifiInfo.getMacAddress();
           }
    

    And call it from the activity like that:

    MacTesting mp = new MacTesting(this);
    

    Also, I would keep private members instead of public (private String mMacAddress).

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

Sidebar

Related Questions

I'm creating my own script using the CodeIgniter MVC framework. Now, i want users
Im creating my own blog managing app in rails (for experimental purposes).... What would
Whenever I create a PHP library (not a framework) I tend to reinvent everything
Im developing my own framework that uses namespaces. Doctrine is already integrated into my
I am using the Slim framework with PHP to create a RESTful API for
I'm working on creating my own DI framework that creates delegate factories as a
I am in the middle of creating my own custom MVC web framework for
Aside from the framework, is jQuery worth using rather than creating your own javascript?
I have been learning MVC recently and have started creating my own framework (for
I'm creating a PHP library for a third-party site's REST API. The library will

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.