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. How to factor code for Free/Paid app versions?

I have a project which I want to split into a paid and a free version.

I do not care to double my management of the res/ folder and would
even like the AndroidManifest.xml to be the same file except for the
package line.   Worrying little about hacking (at this stage -- my app
is not copyprotected anyhow so other avenues of vulnerability are
already open), it might be sufficient for me to have all the logic in
the free app, and to enable/disable functions based on the app's own
package info.

What strategies have others used in this regard?

I have soft-linked the source from a new Android Eclipse project
folder tree to the existing one (the new is to become the paid version
and the old one will become the free one with some logic paths being
conditionally stubbed at runtime), reserving the new source file
hierarchy in the new one to the sole purpose of containing an
MyMainActivity.java file (as it will need to be in a different package-
folder than the one for the free app's).   But the res folder appears
as though it might be more difficult.

Ideas?

tone

2. Best way to launch messaging app via intent

Hi.  What is the recommended way to launch the messaging app (for
sending an MMS message) via an intent?
The following code works on my HTC Magic ...

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra("address", "0215555555");
    intent.putExtra("sms_body", "my message text");
    intent.putExtra(Intent.EXTRA_STREAM, imageUri); // imageUri set
previously
    intent.setType("image/jpeg");
    startActivity(intent);

... but it first launches the Resolver activity,
(com.android.internal.app.ResolverActivity),
prompting the user to select the appropriate app (Email, Gmail,
Messaging, Picasa).  The user has to
select Messaging before proceeding.

The only way I've found to bypass the resolver is to explicity set the
desired component
on the intent before starting the activity as follows:

    intent.setClassName("com.android.mms",
"com.android.mms.ui.ComposeMessageActivity");

However, I'm guessing this approach will not work on devices that have
a customised UI, like
the HTC Hero.  Can someone confirm/deny?

I'm also struggling to find official documentation for the "address"
and "sms_body" fields
that can be supplied as extra data as per the above example.
Is it expected that these will be supported by the default messaging
app in future SDK versions
and in customised UIs (like HTC's Sense UI)?

Thanks in advance ...

3. Unable to run emulators with SDKs 2.0, 2.0.1, or 2.1 - all hang on startup

4. Audio Output Analysis

5. Android NDK - ObjC and code portability?

6. Regarding SharedPreferences

7. How to add buttons in StatusBar..