tag:blogger.com,1999:blog-2865777313825124004.post5375263903273595573..comments2024-03-12T14:37:46.024-07:00Comments on Android Coding: Get phone type using android.telephony.TelephonyManagerErikhttp://www.blogger.com/profile/04983894331825656853noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2865777313825124004.post-43189232901560102922011-08-10T02:38:37.683-07:002011-08-10T02:38:37.683-07:00thanks, but how can i check if the phone supports ...thanks, but how can i check if the phone supports both GSM and CDMA networksShivihttps://www.blogger.com/profile/04240794873768587813noreply@blogger.comtag:blogger.com,1999:blog-2865777313825124004.post-7078888845677514662011-07-15T01:36:58.159-07:002011-07-15T01:36:58.159-07:00Using
Context.getSystemService(Context.TELEPHONY...Using <br /><br />Context.getSystemService(Context.TELEPHONY_SERVICE) <br /><br />did not work because it says getSystemService is not a static method. <br />But it gave me a hint at using Context that is being received from some activity in my class' constructor and this worked. <br /><br />I did this :<br /><br />TelephonyManager telephonyManager = (TelephonyManager)mContext.getSystemService(Context.TELEPHONY_SERVICE);<br /><br />Thanks a lot. :)<br /><br />Pradypradypradyhttps://www.blogger.com/profile/13559685988016322621noreply@blogger.comtag:blogger.com,1999:blog-2865777313825124004.post-23219640327429912282011-07-15T01:24:10.885-07:002011-07-15T01:24:10.885-07:00try this:
Context.getSystemService(Context.TELEPH...try this:<br /><br />Context.getSystemService(Context.TELEPHONY_SERVICE)And.codinghttps://www.blogger.com/profile/01269407937760285746noreply@blogger.comtag:blogger.com,1999:blog-2865777313825124004.post-71875775845306257862011-07-14T22:53:17.118-07:002011-07-14T22:53:17.118-07:00Hello Eric,
This is very informative article.
Ho...Hello Eric,<br /><br />This is very informative article.<br /><br />However while using your code, I face a little problem. <br /><br />For the following line of code<br /><br /> //retrieve a reference to an instance of TelephonyManager<br /> TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);<br /><br />My compiler isn't able to find getSystemService<br /><br />It shows this error "The method getSystemService(String) is undefined for the type BluetoothMessageAccessor" where BluetoothMessageAccessor is my class name. <br />This can sound a stupid question to you, but I am new to android and java both the technologies.<br /><br />Thanks in advance for your help.<br />Pradypradypradyhttps://www.blogger.com/profile/13559685988016322621noreply@blogger.com