How can I get active apn name?

by mbaroukh » Sat, 09 May 2009 01:30:28 GMT


Sponsored Links
 yes.

I need to do this to retrieve current apn proxy.
Her is how I did it :

Cursor mCursor = getContentResolver().query(Uri.parse("content://
telephony/carriers"), new String[] {"name"}, "current=1", null, null);
                                if (mCursor!=null) {
                                        try {
                                        if (mCursor.moveToFirst()) {
                                            String name = mCursor.getString(0);
                                            .. do what ever you wan't with it 
...
                                            }
                                        }
                                        } finally {
                                                mCursor.close();
                                        }
                                }

So, as you see, it's where clause "current=1" that select the current
apn.
Fields you can retrieve can be found in
com.android.providers.telephony.TelephonyProvider :

db.execSQL("CREATE TABLE " + CARRIERS_TABLE +
                "(_id INTEGER PRIMARY KEY," +
                    "name TEXT," +
                    "numeric TEXT," +
                    "mcc TEXT," +
                    "mnc TEXT," +
                    "apn TEXT," +
                    "user TEXT," +
                    "server TEXT," +
                    "password TEXT," +
                    "proxy TEXT," +
                    "port TEXT," +
                    "mmsproxy TEXT," +
                    "mmsport TEXT," +
                    "mmsc TEXT," +
                    "type TEXT," +
                    "current INTEGER);");





--~--~---------~--~----~------------~-------~--~----~



How can I get active apn name?

by biAji » Tue, 12 May 2009 16:16:45 GMT


 Thanks a lot !!

That's exactly what I want to know .  You are so great!




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Camera Preview format problems

hi all,

I am trying to do Camera Capture and displaying the captured data. i
have successfully captured and able to display on the framebuffer
device (/dev/fb0).the problem is the format of the data ,my camera can
send only UYVY or YUV420sp(NV12) data out ,so i have do the conversion
of pixel format from UYVY to RGB565 . I have implemented this
Conversion module in the Camera HAL and that involves software
overhead. there is a delay or latency of 4 to 5 sec for the Camera
Preview or display. its clear that this conversion module is consuming
the resources and delaying the preview by 4 or 5 sec.

I want to avoid this delay by directly displaying UYVY data .when i am
directly displaying UYVY data ,i can only see Y component ,the color
components are missing .

is there any way that i can directly UYVY data without the doing
software conversion .my SOC chip supports V4l2 devices (Video windows)
which i can use for direct Video Display and which support UYVY and
NV12 data .

can i overcome the delay by directly routing captured data to v4l2
devices,if so how can i implement the controls on the preview
display ,since v4l2 devices(video windows) wont support graphics ?

i see there is Overlay HAL on android froyo version ,how can i use
this Overlay HAL in android to achieve the purpose of direct display
of captured data without software conversion module ,and in case if i
use v4l2 devices how can i have both controls (graphics) and camera
display at a time.

i am stuck at this thing,any help is appreciated .

thanks

-- 

2. How to start media player to play HTTP stream?

Hi,

I want to use Media Player to play a file which stored on HTTP server, I use
following code to play it, but the browser came up and then the browser
start the media player to play the file.

Intent i = new Intent(Intent.ACTION_VIEW,Uri.parse("
http://domain.name/test.mp4"));
startActivity(i);

Does anybody know how to directly call the media player to play HTTP
streaming content?

Thanks,

-- 

3. JDK 5 problem

4. Screen XT720 blank akibat formatting

5. How does Beautiful Widget do it?

6. Failed to complete the kernel build

7. Tanya recovery mode tidak bisa boot lewat tombol