First, emulators don't have phone numbers AFAIK. Second, getLine1Number() is not guarantee to return the right phone number -- it may return null, an empty string, or the wrong phone number.
MartinM wrote: > Hi, I'm trying to get the phone no. of the handset in the Emulator as > follows: > > private Context context; > > > context = getApplicationContext(); > TelephonyManager mTelephonyMgr = > (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); > strPhoneNo = mTelephonyMgr.getLine1Number().toString(); > strIME = mTelephonyMgr.getDeviceId(); > Toast.makeText(ReadWebpage.this, strPhoneNo, > Toast.LENGTH_LONG).show(); > > > > > However, on the emulator, both strPhoneNo and strIME are blank. I > have > > <uses-permission android:name="android.permission.READ_PHONE_STATE"></ > uses-permission> > > Do I need to enter some values for the Emulator somewhere, or should I > get 'something' ! > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Consulting: http://commonsware.com/consulting -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

