mirsad
mirsad

Reputation: 182

Android App - Show GSM Cell ID in TextView

I have simple question,

How to make a simple app in which someone can press button and in textview will show the GSM Cell ID?

P.S.: I'm new in this kind of programming.

Upvotes: 0

Views: 533

Answers (2)

Kosh
Kosh

Reputation: 6334

by using TelephoneManager you can get that here is an example:

final TelephonyManager tm = (TelephonyManager) ctx
            .getSystemService(Context.TELEPHONY_SERVICE);
    String simNo = tm.getSimSerialNumber();

edit:
don't forget to add this permission to your manifest

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

Upvotes: 1

lc2817
lc2817

Reputation: 3742

1) Learn how to write basic android app

2) Write a basic app with a button and a label

3) When the button is clicked request a cell location (check google's documentation)

4) Once you have a cell location extract the cell id (http://developer.android.com/reference/android/telephony/gsm/GsmCellLocation.html#getCid%28%29) and put it on the label

Upvotes: 2

Related Questions