Updated to Android SDK 1.5 r1 - adb connectivity problems

by Rob Franz » Tue, 28 Apr 2009 22:46:44 GMT


Sponsored Links
 Well I've not flashed the new image on the device - my target is still 1.1
(waiting until TMobile pushes 1.5 out to all users).  Anything I develop for
1.5 I'm running on the simulator which works fine... that's good enough for
my purposes at the moment.
However it looks like I fixed the problem with a simple reboot - everything
looks ok now.  I can logcat, push APKs to the phone, etc.

Either that instruction to reboot the phone is not listed in the guide OR I
just plain missed it.  The latter is not completely out of the question.

Anyway, thanks for the response, Chandler.

-Rob






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



Other Threads

1. Getting Bitmap of all the Views in ViewFlipper?

Hi,

solved it by setting the visibility of all the views to visible.


Regards
Sunil

-- 

2. Need Help for Storing the Values

Hi I want to store the values which I am fetching from this code, I
have stated the problem where I think I can save the numbers, please
help. I have here copied the layout I want I am able to capture the
current phonebook and can display the phonebook, now I want to store
the numbers in particular values that I can later pass for Calling.
But I need this activity as a SubActivity which passes variable to
some other subactivity.

Thanks in Advance
NUBH

P.S. : The Code works fine, but its slow someone suggested to put the
methods outside the onCreate() please suggest.




The Layout:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:text="Please Save the Speed Dials"/>
    <ListView android:id="@+id/listView"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"/>

<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:text="Number 1:"/>
<Spinner
         android:id="@+id/spinner"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content" />
<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:text="Number 2:"/>
<Spinner
         android:id="@+id/spinner1"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content" />

<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:text="Number 3:"/>
<Spinner
         android:id="@+id/spinner2"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content" />
<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dip"
        android:text="Number 4:"/>
<Spinner
         android:id="@+id/spinner3"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
          />
<TableRow android:layout_marginTop="10dip">
<Button android:text="Save"
         android:id="@+id/SaveBtn"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
<Button android:text="Cancel"
         android:id="@+id/CancelBtn"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content" />

</TableRow>

</TableLayout>

& the Code:

public class HelloSpinner extends Activity
{
        // Here we initiate the spinners and provide a result
        public void onCreate(Bundle savedInstanceState)
        {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
                // We define what we want to show here
                //@SuppressWarnings("unused")
                //String[] PROJECTION = new String[]
                //{
                                //      People._ID, People.NAME
                //};
                Spinner spinner = (Spinner) findViewById(R.id.spinner);
                Spinner spinner1 = (Spinner) findViewById(R.id.spinner1);
                Spinner spinner2 = (Spinner) findViewById(R.id.spinner2);
                Spinner spinner3 = (Spinner) findViewById(R.id.spinner3);

                spinner.setOnItemSelectedListener(new
MyOnItemSelectedListener());
                Cursor cur = getContentResolver().query(People.CONTENT_URI,
null, null, null, null);
                SimpleCursorAdapter adapter3 = new
SimpleCursorAdapter(this,
                                android.R.layout.simple_spinner_item,
                                // Use a template
                                // that displays
a
                                // text view
                                cur,
                                // Give the cursor to the list adapter
                                new String[] {People.NAME},
                                // Map the NAME column in the
                                // people database to...
                                new int[] {android.R.id.text1});
                                //      The "text1" view defined in
                                // the XML template
 
adapter3.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                                spinner.setAdapter(adapter3);

                                spinner1.setOnItemSelectedListener(new
MyOnItemSelectedListener1());
                        Cursor cur1 =
getContentResolver().query(People.CONTENT_URI, null, null, null,
null);
                                SimpleCursorAdapter adapter2 = new
SimpleCursorAdapter(this,
                                                
android.R.layout.simple_spinner_item,
                                                // Use a template
                                                // that displays
a
                                                // text view
                                                cur1,
                                                // Give the cursor to the list 
adapter
                                                new String[] {People.NAME},
                                                // Map the NAME column in the
                                                // people database to...
                                                new int[] {android.R.id.text1});
                                                //      The "text1" view 
defined in
                                                // the XML template
 
adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                                                spinner1.setAdapter(adapter2);

                                spinner2.setOnItemSelectedListener(new
MyOnItemSelectedListener2());
                            Cursor cur3 =
getContentResolver().query(People.CONTENT_URI, null, null, null,
null);
                                SimpleCursorAdapter adapter1 = new
SimpleCursorAdapter(this,
 
android.R.layout.simple_spinner_item,
                                                // Use a template
                                                // that displays
a
                                                // text view
                                                cur3,
                                                // Give the cursor to the list
adapter
                                                new String[] {People.NAME},
                                                // Map the NAME column in the
                                                // people database to...
                                                new int[] {android.R.id.text1});
                                                //      The "text1" view 
defined in
                                                // the XML template
 
adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                                                spinner2.setAdapter(adapter1);

                            spinner3.setOnItemSelectedListener(new
MyOnItemSelectedListener3());
                            Cursor cur4 =
getContentResolver().query(People.CONTENT_URI, null, null, null,
null);
                               SimpleCursorAdapter adapter = new
SimpleCursorAdapter(this,
 
android.R.layout.simple_spinner_item,
                                           // Use a template
                                           // that displays
a
                                           // text view
                                           cur4,
                                           // Give the cursor to the list
adapter
                                           new String[] {People.NAME},
                                           // Map the NAME column in the
                                           // people database to...
                                           new int[] {android.R.id.text1});
                                                //      The "text1" view 
defined in
                                                // the XML template
 
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                                                spinner3.setAdapter(adapter);

        } // The create method ends

                // This is method for first spinner
                public class MyOnItemSelectedListener implements
OnItemSelectedListener
                {
                        public void onItemSelected(AdapterView<?> parent,
                                        View view, int pos, long id)
                        {
                                //
                                        Toast.makeText(parent.getContext(),
                                        "The Person is " +
                                        
parent.getItemAtPosition(pos).toString(),
                                        Toast.LENGTH_LONG).show();
                        }
                        public void onNothingSelected(AdapterView<?> parent)
                        {
                                // Do nothing.
                        }
                }

                //      This is method for second spinner
                public class MyOnItemSelectedListener1 implements
OnItemSelectedListener
                {
                        public void onItemSelected(AdapterView<?> parent,
                                        View view, int pos, long id)
                        {
                                // The value saves here
                                Toast.makeText(parent.getContext(),
                                                "The Person is " +
                                                
parent.getItemAtPosition(pos).toString(),
                                                Toast.LENGTH_LONG).show();
                        }
                        public void onNothingSelected(AdapterView<?> parent)
                        {
                                // Do nothing.
                        }
                }

                // This is method for third spinner
                public class MyOnItemSelectedListener2 implements
OnItemSelectedListener
                {
                        public void onItemSelected(AdapterView<?> parent,
                                        View view, int pos, long id)
                        {
                                // The value saves here
                                                
Toast.makeText(parent.getContext(),
                                                                "The Person is 
" +
                                                                
parent.getItemAtPosition(pos).toString(),
                                                                
Toast.LENGTH_LONG).show();
                        }
                        public void onNothingSelected(AdapterView<?> parent)
                        {
                                // Do nothing.
                        }
                }

                // This is method for fourth spinner
                public class MyOnItemSelectedListener3 implements
OnItemSelectedListener
                {
                        public void onItemSelected(AdapterView<?> parent,
                                        View view, int pos, long id)
                        {
                                // The value saves here
                                                
Toast.makeText(parent.getContext(),
                                                                "The Person is 
" +
                                                                
parent.getItemAtPosition(pos).toString(),
                                                                
Toast.LENGTH_LONG).show();
                        }
                        public void onNothingSelected(AdapterView<?> parent)
                        {
                                // Do nothing.
                        }
                }

}// the class ends here

-- 

3. Announcing RoboGuice 1.0

4. Dalvik VM : Memory Section of Zygote

5. Can set constant rate into wifi driver of Dev 1?

6. How to pass album art while using native media player

7. Any way to get some equivalent to the adb log while the device is not plugged into computer?