How to mount the microSD disk programmatically?

by telematics » Fri, 06 Mar 2009 10:15:05 GMT


Sponsored Links
 I am a new member of this group, and have tried to post this question
twice already and have not seen my post on this forum for a day now.
Moderators, please post it, or if you know this has already been
answered before, please provide me a link.

I want to know how my application can mount the microSD disk as the
USB mass storage upon receiving UMS_CONNECTED.

Thank you in advance.
--~--~---------~--~----~------------~-------~--~----~



How to mount the microSD disk programmatically?

by Mark Murphy » Fri, 06 Mar 2009 10:21:07 GMT


 


You mean like these two?



Sponsored Links


How to mount the microSD disk programmatically?

by telematics » Fri, 06 Mar 2009 11:28:48 GMT


 When I plug the T-mobile G1 phone into the PC via USB, it will give me
a notification "USB Connected", then I can go to the notification
screen to "mount" the SD. So, if this native Android app can do this,
I assume there should be an "unpublished" API for 3rd party apps to do
the same thing. Am I wrong?






> 



How to mount the microSD disk programmatically?

by telematics » Fri, 06 Mar 2009 15:26:26 GMT


 Thank you for the clarification. One more question, the older version
of Android firmware has the "Use for USB Mass Storage" option in the
Settings screen, and I saw android.provider.Settings.System has a
property named USB_MASS_STORAGE_ENABLED, if I set this property, is it
equivalent to the old "Use for USB Mass Storage" option? If not, is
there any plan to add this old option back in the future firmware
release?







> >



Other Threads

1. Getting selected data from spinner using getSelectedItem() results in error

Hi,
The spinner is binded with data's from from database using
SimpleCursorAdapter
and to display the selected data I used the method as below

   textview.setText(spinner.getSelectedItem().toString())

this gives me an out put like
android.database.sqlite.sqlitecur...@437451a0

Is this the right way to get the selected data?



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

2. How to add an icon in the List view?

I am trying to add an icon in the list view.
Below is my code snippet and realted xml, without the icon(i.e. just
list view).

Code:
final View addUser = factory.inflate(R.layout.addusers, null);
                                mEditText = (EditText)addUser.findViewById
(R.id.EditText_UserName);

                                builder = new AlertDialog.Builder(this);
                                builder.setView(addUser);
                                
builder.setTitle(R.string.dialog_addusers_title);
                                builder.setIcon(R.drawable.adduser);
                                builder.setPositiveButton(R.string.button_ok,
                                                new 
DialogInterface.OnClickListener() {
                                                public void 
onClick(DialogInterface dialog, int id) {
                                                        mStrings.add(0, 
mEditText.getText().toString());
                                                        mEditText.setText("");
                                                        
lap.notifyDataSetChanged();


                                        }
                                });
                                
builder.setNegativeButton(R.string.button_cancel,null);
                                alertDialog = builder.create();
                                dialog = alertDialog;

                                myListView = 
(ListView)findViewById(R.id.ListView_UserList);

                                lap = new ArrayAdapter<String>(this, 
R.layout.userlist, mStrings);

Original "userlist.xml"

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
                                        android:layout_width="fill_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_marginTop="7dp"
                                        android:singleLine="true"/>


Then I tried to add the image view widget to add my icon in each list.
Modified "userlist.xml"

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

                <ImageView xmlns:android="http://schemas.android.com/apk/res/
android"
                                        android:id="@+id/ImageView_UserIcon"
                                        android:layout_width="48dp"
                                        android:layout_height="48dp"
                                        android:layout_alignParentLeft="true"
                                        android:layout_marginRight="7dp"
                                        android:layout_marginTop="7dp"
                                        android:scaleType="fitXY"
                                        android:src="@drawable/carol"/>
                <TextView       android:id="@+id/TextView_UserName"
                                        android:layout_width="fill_parent"
                                        android:layout_height="wrap_content"
                                        android:layout_marginTop="7dp"
                                        android:singleLine="true"/>

</LinearLayout>

But I am not successful. It is crashing. Any suggestion on how to add
icons in the list view?
--~--~---------~--~----~------------~-------~--~----~

3. Android OMAP 35X EVM

4. OpenGL Implementation and texture sharing

5. how to make a little time stop between two works

6. Take a long time to make call

7. Inserting large volumes of data into SQLite - speed issues