android.pim.vcard

by asw » Mon, 14 Mar 2011 23:35:53 GMT


Sponsored Links
 Hi folks,

I am just starting to learn android, and so far my first impression was not 
too good.

Why the package android.pim.vcard is not made public? There are also a lot 
of other packages and useful methods not in public API. You can call the 
hidden APIs in the actual device, but you can't compile it in the first 
place because they are not available in the SDK. Is there any hack to enable 
the hidden API in the SDK (like patching the .jar)?
It seems that Google does not promote library reuse much. It should not be 
too hard to maintain the public APIs for vcard functionality.

Alvin

-- 



Other Threads

1. Helep!! Nexus One Nyangkuttt di 'X'..

Dapet N1 yg gak bisa booting (not mine).. terakhir sempet dapet OTA Update..
trus sempet mati karena batre abis.. skrg nyangkut di logo X (dah ada gembok
kebukanya).. barusan gw coba unlock bootloader.. trus install superboot..
flash amon_ra.. abis itu mo masuk recovery tetep gak bisa.. nyangkut di X..
-____-"

any idea??

-- 
"Indonesian Android Community [id-android]" 

2. ApiDemos/Graphics/CamerPreview Nexus One force close

I did have this same problem.  The issue is that the Camera.open
method bombs out.

I created a camera wrapper class that does a bunch of initialization
to ensure that open works, then takePicture works, etc.  I found the
initialization code by looking through the Camera source code for
Google's main Camera app.

I think the code you need is:

        private synchronized void preOpen(Context context) {
        mPreferences =
PreferenceManager.getDefaultSharedPreferences(context);
        upgradePreferences(mPreferences);
        }


    public static final String KEY_VERSION = "pref_version_key";
    public static final String KEY_RECORD_LOCATION =
        "pref_camera_recordlocation_key";
    public static final String KEY_VIDEO_DURATION =
            "pref_camera_video_duration_key";
    public static final String KEY_JPEG_QUALITY =
"pref_camera_jpegquality_key";

    public static final int CURRENT_VERSION = 3;

    private static void upgradePreferences(SharedPreferences pref) {
        int version;
        try {
            version = pref.getInt(KEY_VERSION, 0);
        } catch (Exception ex) {
            version = 0;
        }

        logPreferences(pref);

        if (version == CURRENT_VERSION) return;

        SharedPreferences.Editor editor = pref.edit();
        if (version == 0) {
            // For old version, change 1 to 10 for video duration
preference.
            if (pref.getString(KEY_VIDEO_DURATION, "1").equals("1")) {
                editor.putString(KEY_VIDEO_DURATION, "10");
            }
            version = 1;
        }
        if (version == 1) {
            // Change jpeg quality {65,75,85} to
{normal,fine,superfine}
            String quality = pref.getString(KEY_JPEG_QUALITY, "85");
            if (quality.equals("65")) {
                quality = "normal";
            } else if (quality.equals("75")) {
                quality = "fine";
            } else {
                quality = "superfine";
            }
            editor.putString(KEY_JPEG_QUALITY, quality);
            version = 2;
        }
        if (version == 2) {
            editor.putString(KEY_RECORD_LOCATION,
                    pref.getBoolean(KEY_RECORD_LOCATION, false)
                    ? "on"
                    : "off");
            version = 3;
        }
        editor.putInt(KEY_VERSION, CURRENT_VERSION);
        editor.commit();
    }


I can't imagine a reason this would be required, but after I added it,
Camera.open worked.  Strangely, later I commented out the call to
upgradePreferences and it still worked... I don't know if that's
because the critical thing is just acquiring the preferences, or
somehow one time initialization is enough.

I noticed also that rebooting my phone and making the Camera.open be
the very first thing I did also worked (without the preOpen call).

None of this behavior makes sense to me; I'm just reporting what I
saw, and what has continued to work for me.

BTW, you also have to startPreview before you can takePicture.

Bobby



> 

3. CoreException thrown by IProject.build

4. (WTI) promo gt+mega diskon 500 rb+cicilan 0% 12 bln for Spica

5. code for capturing screenshot of android device

6. Is it possible to develop and upload Android 2.1 apps onto Motorola backflip?

7. How to warn user when back button is pressed to navigate out of my application?