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
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):And call it from the activity like that:
Also, I would keep
privatemembers instead ofpublic(private String mMacAddress).