MediaRecorder / MediaPlayer simultaneous use?

by Anandi » Wed, 21 Apr 2010 12:24:21 GMT


Sponsored Links
 Doesn't anyone know if mediarecorder and mediaplayer can be used?

can anyone from android team please help?







>



MediaRecorder / MediaPlayer simultaneous use?

by ani » Wed, 21 Apr 2010 14:33:09 GMT


 I guess the problem is not from the framework side but the problem
lies in the fact
that your driver will not support this use case of simultaneously
recording and playing
back.
As recording is generally done at 8k and playing back is done at 44.1k.

--


Sponsored Links


Other Threads

1. Loading random image when activity is brought up...Not working any ideas?

I've been staring at this for hours. It compiles fine with no errors
and loads the activity on my nexus. The button and the menu items load
fine with no issues at all. It's simply not loading any of the
drawables i'm specifying :/ any ideas what I did wrong?

All I want is whenever this activity is brought up it randomly chooses
an image from the drawables i specify.



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
HERE'S MY CODE FOR THE JAVA
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

package com.package.name;

import java.util.Random;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View.OnClickListener;

public class RandomImage extends Activity implements OnClickListener{



    private static final Random rgenerator = new Random();

    Integer [] mImageIds = {
            R.drawable.icon,
            R.drawable.shoticon,
            R.drawable.mixicon,
            };


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.randomimage);




    Integer q = mImageIds[rgenerator.nextInt(mImageIds.length)];

    ImageView iv = (ImageView) findViewById(R.id.imageviewyeah);
    iv.setTag(q);

    View nextButton = findViewById(R.id.next_image_button);
    nextButton.setOnClickListener(this);

}






    @Override
    public void onClick(View v) {
    switch (v.getId()) {
    case R.id.next_image_button:
        Intent i = new Intent(this, RandomImage.class);
        startActivity(i);
        break;
    }

}
    @Override
        public boolean onCreateOptionsMenu (Menu menu) {
                super.onCreateOptionsMenu(menu);
                MenuInflater inflater = getMenuInflater();
                inflater.inflate(R.menu.menu3, menu);
                return true;
        }

@Override
public boolean onOptionsItemSelected (MenuItem item) {
                switch (item.getItemId()) {
                case R.id.menu:
                        startActivity(new Intent(this, Main.class));
                        return true;

}
return false;
        }



}






////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
AND HERES MY CODE FOR THE LAYOUT.XML

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget0"
android:background="@drawable/nhiebg"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
    android:layout_gravity="center" >



<ImageView
        android:id="@+id/imageviewyeah"
        android:tag="q"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center">
</ImageView>


<Button
        android:id="@+id/next_image_button"
        android:text="Next Image"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="10dip"
        android:typeface="serif"/>

</LinearLayout>

-- 

2. Dubious extra call to OnCreate on orientation change

Hi,

I've been experimenting with orientation change and have seen a
strange behavior (at least to my opinion) when I change the
orientation from landscape to portrait. To make the explanation more
concrete let's consider the following super-simple code:

1.  import android.app.Activity;
2.  import android.os.Bundle;
3.
4.  public class HelloAndroid extends Activity
5.  {
6.    @Override
7.    public void onCreate(Bundle savedInstanceState)
8.    {
9.      super.onCreate(savedInstanceState);
10.   }
11.
12.  @Override
13.  protected void onDestroy()
14.  {
15.    super.onDestroy();
16.  }
17. }

I put breakpoints at lines 9 and 15 and start the emulator in debug
mode. The application starts and hits the breakpoint at line 9; so far
so good. Then I press Ctrl+F11 to change the orientation from portrait
to landscape. The de{*filter*} stops first at line 15 and then line 9.
Everyhting normal so far. I hit once again Ctrl+F11 to change the
orientation from landscape to portrait and some mumbo-jumbo starts
happening. Here is the sequence of function calls I observe:

1.onDestroy()
2.onCreate()
3.onDestroy()
4.onCreate()

I really fail to understand why the platform needs to make the calls
"2.onCreate()" and "3.onDestroy()". Can anyone explain why this is
happening? At least I don't find it convenient because I need to
implement more logic, because the extra calls "2.onCreate()" and
"3.onDestroy()" cause side effects in my case. However, it would be
interesting to know why these extra calls are taking place.

Thank you in advance,

-Ali

-- 

3. Transition animation for dynamic (single) view.

4. oot chanel mana yang nyiarin brazil ya?

5. The No.1 Magic Community Talk - Share and Learn Magic Tricks.

6. Transition animation for dynamic (single) view.

7. How to set Connection mode?