android.drm.mobile1

by dpelleti » Tue, 28 Apr 2009 11:03:33 GMT


Sponsored Links
 Can anyone tell me where I can find this package? I just downloaded
the latest version of the SDK (1.5) and I cannot find any drm package.
I've seen several references to it on the web.

Also, are there any code samples that show how to forward lock a file
on the device?

Thanks!

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



Other Threads

1. 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>

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

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

My HT-03A firm ware is Android 1.5.  But my computer's Android SDK is
1.6. So I 'd like to update firmware of HT-03A. But I don't know where
is a update package of HT-03A. please tell me for them.

Thanks.


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

3. Modifying text for ListView with SimpleCursorAdapter

4. Nesting an ActivityGroup as atTab content

5. proposed Android rogramming course

6. Application compatibility between SDK 1.5 and 1.6

7. Application compatibility between SDK 1.5 and 1.6