how can the contact be writen to SIM card?

by 钃濇€濅腑 » Thu, 14 May 2009 23:55:56 GMT


Sponsored Links
 Hi guys, I am trying to store a contact in the SIM card, but I found nothing
for it in the G1 phone. Then, I assumed that it may be because G1's
application doesn't use the API for that storage, so I tried the following
code,

       ContentValues values = new ContentValues();
        values.put( "name", "aaaa" );
        values.put( "number", "10086" );
        getContentResolver().insert( Uri.parse("content://sim/adn"), values

it just failed, doing nothing. What is wrong? how can I make it to SIM card?
Thank you.

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



how can the contact be writen to SIM card?

by zhanglei » Tue, 19 May 2009 01:32:27 GMT


 I was told that I can use telephony to create SIM contacts, but I don
know how to do. who can help me?

Thanks in advance for your kind help.

 

  _____  

From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of €
Sent: 2009418:25
To: android-developers@googlegroups.com
Subject: [!! SPAM] [android-developers] how can the contact be writen to SIM
card?

 


Hi guys, 

I am trying to store a contact in the SIM card, but I found nothing for it
in the G1 phone. Then, I assumed that it may be because G1's application
doesn't use the API for that storage, so I tried the following code, 

 

          ContentValues values = new ContentValues();

        values.put( "name", "aaaa" );

        values.put( "number", "10086" );

        getContentResolver().insert( Uri.parse("content://sim/adn"), values
);

 

it just failed, doing nothing. What is wrong? how can I make it to SIM card?

Thank you.




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


Sponsored Links


how can the contact be writen to SIM card?

by Water E » Wed, 15 Jul 2009 00:26:48 GMT


 --values.put( "name", "aaaa" );

replace as :

--values.put( "tag", "aaaa" );
Good Luck!

2009/5/14 € <lan.sizh...@gmail.com>


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



Other Threads

1. Custom View Subclass - How do I properly specify xmlns in my layout.xml file?

I am following the LabelView.java and associated custom_view_1.xml
layout files to guide me, but I am perplexed by the xmlns:app
specification. My custom view is in the com.foo.bar package. What do I
specify as the xmlns:app value to properly bind my XML layout
declarations to the attribute set my custom view constructor
processes?

I've tried xmlns:app="com.foo.bar", xmlns:app="http://
schemas.android.com/apk/res/com.foo.bar", xmlns:app="http://
schemas.android.com/com.foo.bar" to no avail.

Its not clear to me why the api example uses an http: scheme in the
first place. Shouldn't the package name be adequately unique?
--~--~---------~--~----~------------~-------~--~----~

2. How to extend an ArrayAdapter?

Hello,

I'm running into difficulties overriding an ArrayAdapter to be
displayed in a ListActivity.

The ArrayAdapter is filled asynchronously.

What I'm trying to do is add a special "sentinel" object that sits at
the beginning of the list to show the progress of the computation.
Ultimately this may be a progress bar, but right now I am just using a
TextView as a placeholder.

The problem is that the sentinel seems to get inserted multiple times
into the list - not just once at the beginning. It *seems* to be
appearing once per "page" of list data (so if 8 list items fit on the
screen, my sentinel appears as the 1st, then 9th, then the 17th,
etc..), but that interpretation may not be accurate.

While maybe not how ArrayAdapters were intended to be extended, I
thought something like this should work by simply overriding getView()
to show my custom TextView for index 0:

public class CustomAdapter<E> extends ArrayAdapter<E> {

        private View sentinel;

        public CustomAdapter(Context context, int textViewResourceId, List<E>
objects) {
                super(context, textViewResourceId, objects);
                sentinel = new TextView(context);
                ((TextView)sentinel).setText("Still Loading..");
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent)
{
                if(position == 0)
                        return sentinel;
                return super.getView(position, convertView, parent);
        }

        public void finish() {
                //called when async list computation finishes
                remove(getItem(0));
        }

}

The adapter is created in the usual way:

...
ArrayList<String> data = new ArrayList<String>();
data.add('****'); //item 0, this should get replaced
adapter = new CustomAdapter<String>(this,
android.R.layout.simple_expandable_list_item_1, data);
adapter.add("Sentinel");
setListAdapter(adapter);
...


My two guesses so far are: 1) When data is added asynchronously,
something goes wrong with redrawing the list view. 2) I'm not
correctly interpreting the "position" parameter of "getView()".

Any suggestions on why this doesn't work?

Thanks for reading folks.

 - C







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

3. Programmatically delete a home-screen shortcut

4. CONTROL_LOCATION_UPDATES permission failure

5. playing of wma audio

6. Keyguard does not unlock when intent fires while user is at home screen

7. ERROR/MediaPlayer(1066): setDataSource called in state 128