Posts

Showing posts with the label TelephonyManager

How to check support for Call & SMS on Android device?

Sometime we have requirements to implement call & sms support with in our android app. Now how to check whether device has support for call & sms feature. To verify, we can check the device phone type, which indicates the type of radio used to transmit voice calls. In addtion to this we can also check that the device has a telephony radio with data communication support or not. The method is as follows:- public static boolean supportCallAndSMS(Context context) { boolean isSupported = false; TelephonyManager telephonyManager = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); boolean isPhone = !(telephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE); boolean featureTelephony = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_TELEPHONY); if(isPhone && featureTelephony) { isSupported = true; } return isSupported; }

How to get IMEI on Android Devices?

Image
Hi Readers, As per your queries about IMEI on Android devices; I am posting this article, please do let me know with your feedback and further queries. The solution is as follows:- Device, network, SIM & data state related info on Android platform is managed by TelephonyManager. Your application can use the methods defined in this class to determine the desired information. Please note, you cannot instantiate this class directly; instead you need to retrieve a reference to an instance like this:- String serviceName = Context.TELEPHONY_SERVICE; TelephonyManager m_telephonyManager = (TelephonyManager) getSystemService(serviceName); To access some telephony information you need to set appropriate permission in your application manifest file, because few informations are permission protected. In our case we need to set permission for our app:- Now let's start with actual source code to retrieve the information:- public String findDeviceID() {       String de...