Skip to content

Android Stuff

Apps and Tips for Android…

Archive

Archive for October, 2009

The easiest way to get the name of the Current Network Operator to which the Android phone is currently connected is to get hold of the android.telephony.TelephonyManager and get it from there:

TelephonyManager telephonyManager =((TelephonyManager) Context.getSystemService(Context.TELEPHONY_SERVICE));
String operatorName = telephonyManager.getNetworkOperatorName();

similarly the sim operator can be retrieved by using:

String operatorName = telephonyManager.getSimOperatorName();

If you download or copy any audio files in the /sdcard/Podcasts folder then the files will automatically appear in a play list called “Podcasts” in the Music Player. It seems to be an undocumented feature of the Android Music Player.

If you are used to using One Key Dial or Hot Key or Speed Dial features of other phones, you’ll notice that there is no option to create Direct Dial shortcuts on the Android Phone (unless you are using Hero) so if you want to quickly call someone the only way is to open the dialer or the contacts then search for it and then dial (or may be use the favourites list). I use a free app called Any Cut to create one click shortcuts to dial my often called numbers, makes it so much easy to dial often called numbers.

Update: Support for creating shortcuts is now natively supported in Android from v1.6 onwards.

This list of APNs is stored in the shared content in the system and requires a ContentResolver to be used to access the data. The Uri to be used to access the APNs is “content://telephony/carriers/“. The columns available in the table are:

  • _id
  • name
  • numeric
  • mcc
  • mnc
  • apn
  • user
  • server
  • password
  • proxy
  • port
  • mmsproxy
  • mmsport
  • mmsprotocol – optional, not available in all phones/ROMs
  • mmsc
  • type
  • current
  • insert_by

For example, to retrieve a list of names of all APNs in code:

Uri contentUri = Uri.parse(“content://telephony/carriers/”);

Cursor cursor = null;
try
{
cursor = context.getContentResolver().query(contentUri, new String[]{“name”}, null, null, null);
if (cursor != null)
{
while (cursor.moveToNext())
{
String name = cursor.getString(0);
//do something with name
}
}
}
catch (Exception ex)
{
//Handle exceptions here
}
finally
{
if (cursor != null) cursor.close();
}