How to get source code of default Messaging application in Android?

by phpandr...@gmail.com » Tue, 14 Apr 2009 19:42:43 GMT


Sponsored Links
 In GitWeb ( http://android.git.kernel.org/ ) I can't see source of
"Messaging" application. Where do I get this source? Plz help me.
Thanks a lot !
--~--~---------~--~----~------------~-------~--~----~

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



Other Threads

1. About the Account and the ContactsContract API

Hi,

I'm creating my first Android application and I'm looking for a few
advices on several subjects. The context is simple: my application
connects itself to several Instant Messaging servers and it creates a
RawContact in the Contact Provider each one for the contacts found on
these servers. At this time, I got everything working, but I'm not
fully satisfied on several points:




First point: AccountManager

I successfully managed to create an simple account authenticator that
create a new account dedicated to my application. There is no real
authentication behind it, it simply create an empty Account if needed,
that's all. Everything works in an emulator v2.2, however, I can't
even bind to my "AuthenticatorService" in an emulator v2.1-update1.

Here is the error I retrieve from the logcat:

DEBUG/AccountManagerService(64): bind attempt failed for Session:
expectLaunch false, connected false, stats (0/0/0), lifetime 0.001,
addAccount, accountType ACCOUNT_UNIFIED_IM_TYPE, requiredFeatures null

Here is the part of the AndroidManifest.xml related to that
Authenticator:

        <service
android:name=".service.core.authenticator.AuthenticatorService"
                android:exported="true">
                <intent-filter>
                        <action 
android:name="android.accounts.AccountAuthenticator" />
                </intent-filter>
                <meta-data android:name="android.accounts.AccountAuthenticator"
                        android:resource="@xml/authenticator" />
        </service>

And here is the content of the file named '/res/xml/
authenticator.xml':

        <?xml version="1.0" encoding="utf-8"?>
        <account-authenticator xmlns:android="http://schemas.android.com/apk/
res/android"
                android:accountType="@string/account_type"
                android:icon="@drawable/unified_im_icon"
                android:smallIcon="@drawable/unified_im_icon"
                android:label="@string/app_name"
        />




Second point: creating a RawContact

Once my Account is created (or retrieved), I try to add a new
RawContact, but it seems to me that this process is reeeeaaaally slow,
so I'm wondering if I do it the right way and if you have any tips
that would allow my to speed it up. Here is my code:

        ContentValues lValues = new ContentValues();
        lValues.put(RawContacts.ACCOUNT_TYPE, lAccountType);
        lValues.put(RawContacts.ACCOUNT_NAME, lAccountName);
        Uri lRawContactUri =
mService.getContentResolver().insert(RawContacts.CONTENT_URI,
lValues);

        Uri lDataUri = Uri.withAppendedPath(lRawContactUri,
Data.CONTENT_DIRECTORY);

        ContentValues[] lData = new ContentValues[2];
        lData[0] = new ContentValues();
        lData[0].put(Entity.RAW_CONTACT_ID, lContact.getSystemId());
        lData[0].put(Entity.MIMETYPE, Im.CONTENT_ITEM_TYPE);
        lData[0].put(Im.PROTOCOL, ProtocolUtils.toSystemProtocol(pProtocol));
        lData[0].put(Im.DATA, pHandle);

        lData[1] = new ContentValues();
        lData[1].put(Entity.RAW_CONTACT_ID, lContact.getSystemId());
        lData[1].put(Entity.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
        lData[1].put(StructuredName.DISPLAY_NAME, pDisplayName);

        mService.getContentResolver().bulkInsert(lDataUri, lData);

(Yeah, I know, and I'm really sorry for the lack of documentation...)




Third point: reading a list of RawContacts

That's the point that  I'm not really proud of, not that the process
is slow, but I'm sure there is a away to make it simpler. Here is what
I do:

1 - First, I query the ContactManager in order to retrieve the _ID of
all the RawContacts that matches my Account:
        Cursor lCursor = lResolver.query(
                RawContacts.CONTENT_URI,
                new String[] {RawContacts._ID},
                RawContacts.ACCOUNT_NAME + "=? AND " + RawContacts.ACCOUNT_TYPE 
+
"=?",
                new String[] {lAccountName, lAccountType},
                null);

2 - Then, for EACH RawContact I query the ContentManager in order to
retrieve its IM data, and an other query in order to retrieve its
Display Name:

        Cursor lRawCursor = lResolver.query(
                lRawContactUri,
                new String[] {Im.PROTOCOL, Im.DATA},
                Data.MIMETYPE + "=?",
                new String[] {Im.CONTENT_ITEM_TYPE},
                null);

        lRawCursor = lResolver.query(
                lRawContactUri,
                new String[] {StructuredName.DISPLAY_NAME},
                Data.MIMETYPE + "=?",
                new String[]{StructuredName.CONTENT_ITEM_TYPE},
                null);




So here are my main problems, I'm pretty sure that there are some tips
that would allow me to do the same thing more efficiently, I just hope
someone will be here to give me them ;)

-- 

2. Suggestion for Google Navigation

This application propose to select a contact postal adress from a
list, extracted in contact list.
But, the ContactList activity propose a similare service with the
intent :

Intent intent=new Intent(Intent.ACTION_PICK);
intent.setType(StructuredPostal.CONTENT_TYPE);
startActivityForResult(intent, DATA);

or

Intent intent=new Intent(Intent.ACTION_GET_CONTENT);
intent.setType(StructuredPostal.CONTENT_ITEM_TYPE);
startActivityForResult(intent, DATA);

Because Google Navigation not used this intent, it's not possible to
use another provider, to select the address from Ldap, white pages,
etc.

What did you expect ?

Regards

Philippe

-- 

3. Scrollable widgets in alternative Home applications.

4. broken pipe exception

5. One of my application is invisible now on the market (Pure messenger / not copy protected)

6. how can we set the background of button with bitmap image........which is cre

7. Jack detection