Native IM application

by AP08 » Wed, 14 Jan 2009 01:50:51 GMT


Sponsored Links
 Hi,

Since gtalkservice is not present in SDK 1.0 onwards; how can i use
the native IM client (provided by Esmertec) ? The IM client code does
not compile.

Or where can I get the source code /jar file for the required
packages ?

thank you,
Amit
--~--~---------~--~----~------------~-------~--~----~



Native IM application

by Andrew Stadler » Wed, 14 Jan 2009 02:44:25 GMT


 Hi Amit-

Questions or issues regarding the open source build or debugging
platform applications should be posted to android-platform.  This list
is for discussion development of apps using the published SDK.

See <source.android.com/discuss> for more information

Thanks
Andy




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


Sponsored Links


Other Threads

1. How to change Android splash screen??

Hi...

I want to have my image as the splash image instead of the default
Android splash image.
Could someone advise how to customise the default android splash
screen in the source code?
Is it true that I need to change initlogo.rle? If yes, how to do
that?


Thank you in advance... :)


Cheers,
Smallzz


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

2. Help Needed : MediaRecorder error: java.io.IOException: prepare failed

Hi all

I am trying to write a sample program to record the video (say
camcorder application).
When i run my program using the emulator (I have android-sdk-
windows-1.5_r3) I see java.io.IOException: prepare failed. error in
logcat output.

Further I can see that I have came across this error when i call
MediaRecorder.prepare()
from CamcorderActivity.surfaceCreated()
But I am surprised to see that activity got launched and I am seeing
the camera preview!  Again the preview is seen only in half of the
screen! Its weird!!!

Further when i do recorder.start() to record the video I get
java.lang.IllegalStateException. Yes this is obvious since the prepare
() has failed.
But the question is why prepare() has failed ?

Can someone please help me to understand whats happening here!
Am i missing something ???

thanks in advance
~pp

Here is my code ...
package com.example;

import java.io.IOException;

import android.app.Activity;
import android.graphics.PixelFormat;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class CamcorderActivity extends Activity implements
        SurfaceHolder.Callback
{
    private MediaRecorder recorder;
    private SurfaceView   surfaceView;
    private SurfaceHolder surfaceHolder;

    private boolean       recording = false;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        // configure the surface
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        setContentView(R.layout.main);
        surfaceView = (SurfaceView) findViewById(R.id.camcordersurface);
        surfaceHolder = surfaceView.getHolder();
        surfaceHolder.addCallback(this);
        surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
        configureRecorder();
    }

    private void configureRecorder()
    {
        // configure media recorder
        recorder = new MediaRecorder();
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
    }

    private void stopRecorder()
    {
        try
        {
            if (recorder == null)
            {
                return;
            }
            recorder.stop();
            recorder.reset();
            recorder.release();
            recording = false;
            recorder = null;
        }
        finally
        {
            if (recorder != null)
            {
                recorder.release();
            }
        }
    }

    private void startRecorder()
    {
        recorder.start();
        recording = true;
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
        {
            // if not recording then start
            if (!recording)
            {
                startRecorder();
            }
            else
            {
                // if already recording then stop
                stopRecorder();
                finish();
            }
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

    @Override
    public void surfaceChanged(SurfaceHolder holder, int format, int
width,
            int height)
    {
        // do nothing
    }

    @Override
    public void surfaceCreated(SurfaceHolder holder)
    {
        recorder.setOutputFile("/sdcard/test" + System.currentTimeMillis()
                + ".mp4");
        recorder.setPreviewDisplay(holder.getSurface());
        try
        {
            recorder.prepare();
        }
        catch (IOException e)
        {
            Log.e("error -- ", e.toString(), e);
            // TODO:
            // show error message
        }
    }

    @Override
    public void surfaceDestroyed(SurfaceHolder holder)
    {
        stopRecorder();
    }
}

And the layout ...

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <SurfaceView android:id="@+id/camcordersurface"
                android:layout_width="fill_parent" android:layout_height="10dip"
                android:layout_weight="1">
        </SurfaceView>
</LinearLayout>

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

3. Please tell me how to update firmware of HT-03A from Android 1.5 to 1.6.

4. Modifying text for ListView with SimpleCursorAdapter

5. Nesting an ActivityGroup as atTab content

6. proposed Android rogramming course

7. Application compatibility between SDK 1.5 and 1.6