How to fetch phone's phone number or unique ID

by Nando Android » Sun, 27 Jun 2010 08:09:14 GMT

Sponsored Links
 Exactly, I want an unique ID to it.

How can I call it? Do I have to instantiate something?



Other Threads

1. Camera takePictu onPictureTaken() never called?

Hello all,
creating very basic camera code I got stuck at this: in followin code
method onPictureTaken() is never being called:

private PictureCallback pcb = new PictureCallback() {
                        public void onPictureTaken(byte[] data, Camera camera) {
                                // Do something here - this place is never 

                        Camera c =;
                        Parameters cp = c.getParameters();
                        int JPEG = 0x100;
                        c.takePicture(null, null, pcb);

Have you met this behavior before? If so, how to overcome this?
Behavior is consistent in emulator and in real hardware, versino is
Thanks for reading this.


2. Weird problems with soft keyboard for filtering list view

Hi all,

In my application I want to display a list of stuff and provide the
user with the ability to filter the list by using the soft keyboard.
To that end I added a popup with a button that should trigger (hide/
show) the soft keyboard for filtering. I don't want to have a visible
edit text control, cause it would take up unnecessary space on the
screen. Rather than that, I would like to display a toast showing the
filter query as the user types, much as the
'android:textFilterEnabled' attribute for ListView does. To my
understanding there is no obvious way of doing this with available
Android components. So I tried the following approach (this is only
the part for toggling soft keyboard):

1) creating a layout containing invisible edit text and the list view:
<LinearLayout xmlns:android="
              style="@style/main" >
    <View   class="com.blahblah.view.InsertTextView" <-- this is
basically EditView

    <ListView android:id="@+id/mylist"

- adding button as a popup and invoking InputMethodManager on click to
toggle the soft input (called in onCreate):

    private void initButton() {
        Button buttonView = (Button)
getLayoutInflater().inflate(R.layout.keyboard_button, null);
        buttonView.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                final View target = findViewById(;
                InputMethodManager imm = (InputMethodManager)
                // this does not work...
InputMethodManager.SHOW_FORCED, 0);
                // ... so need to track this in an instance variable -
which sucks
                if (imeShowing) {
imm.hideSoftInputFromWindow(target.getWindowToken(), 0);
                    imeShowing = false;
                } else {
                    // check that the filterbox got focus
                    imm.showSoftInput(target, 0);
                    imeShowing = true;
        buttonPopup = new PopupWindow(buttonView);
        // ... code to display the button as a popup

As mentioned in the code sample, the 'obvious' approach (calling
toggleSoftInput) does not work, so I had to revert to this ugly if-
else. This is however, a secondary problem. The primary problem is
that when I run this in the emulator, the soft keyboard is displayed
correctly, but as soon as I start typing in it, an intent to the
google search activity is raised! And the typed characters appear in
the Google search box displayed as a result. What is even more weird,
this only happens the first time I type after deploying and running
the app. I.e. if I go back to my app from the Google search box,
everything works as expected (no redirects to the search box again).
Before showing the display I make sure that the invisible edittext
gets focus, so it _should_ be the target of the soft keyboard, right??

Does anyone have any idea what is happening here?



3. Create a bitmap from a decoded pixel array

4. recovery-package generator script

5. DownloadManager lack of functionality. Bug or intentional limitation?

6. Change android status bar height

7. New added raw contacts are not shown