Letting user save as ringtone or Notification... Please help

by SteelJ0ker » Mon, 08 Feb 2010 09:30:33 GMT


Sponsored Links
 I've got a soundboard application created, but i want to allow the
users to be able to long press on one of the sounds and they can
select to save the tone as a ringtone or notification.
I've tried finding good solid examples i could learn from but i just
can't seem to figure it out....

any help would be appreciated. Thank you..

--



Other Threads

1. how to dynamically remove widgets from a layout inside a layout ( nested ).

Hi All,

 I have LinearLayout. Inside to that i have added one more Linearyout
( checkbox & text ).

(LinearLayout) one textView, (LinearLayout) Checkbox,textview , one
textview

Now whenever clicks the checkbox, i need to dynamically display
EditBox after the checkbox.

main.xml
---------------
<?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android" android:orientation="horizontal"
android:id="@+id/MainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25sp"
android:text="Enter category :" />

<LinearLayout
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:id="@+id/locationLayout">

<CheckBox android:id="@+id/checkbox"
android:layout_width="40dp"
android:layout_height="40dp"
android:checked="true"/>

<TextView android:id="@+id/checkboxtext"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:paddingLeft="20dp"
android:layout_gravity="center_horizontal"
android:layout_centerHorizontal="true"
android:textSize="25sp"
android:text="Current Location" />

</LinearLayout>
<TextView android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25sp"
android:text="End of category :" />

</LinearLayout>

test.xml:
-------------

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">

<EditText android:id="@+id/categotytextbox"
android:hint="eg. pubs,restuarants "
android:layout_width="250dip"
android:layout_height="wrap_content"
android:maxLines="1"/>

</LinearLayout>

On the click of checkbox listener i added a code like below.
            public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main1);
                final CheckBox location =
(CheckBox)findViewById(R.id.checkbox);

                location.setOnClickListener(new Button.OnClickListener(){

      public void onClick(View v) {

        if(location.isChecked() == true)
                        {
                         LinearLayout l = (LinearLayout)
findViewById(R.id.locationLayout);
                         LayoutInflater linflater = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                             View myView = linflater.inflate(R.layout.main,
null);
                            l.addView(myView);
                   }
                        else
                        {
                                 LinearLayout l = (LinearLayout)
findViewById(R.id.locationLayout);
                                 LayoutInflater linflater = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);

                             View myView = linflater.inflate(R.layout.main,
null);

                                l.removeView(myView);  // I want to the layout
which was added earlier. How do i do that.? I know this is not correct
solution.

                        }
                }
        });

Can anyone help me here.?

Thanks,
- mani

-- 

2. problem with GL_CLAMP_TO_EDGE

hello guys,

I cannot guarantee my texture size be a power of two,   therefore, i'm
using GL_CLAMP_TO_EDGE,

but when i call glTexImage2D, or glutil.teximage2d, i always get the
Opengl Error Code 1281 Invalid Value.

this same setting seems to work on iphone.

does this mean that android only supports power of two texture maps?

if i hard code the bitmap size to be power of two, then my program
will work. otherwise the texture map is black.


see, this is how i set the texture map, it is exactly the same as the
official sample.

thanks




        Log.d("Ball Texture","textureID "+textureID+"; lengthx "+lengthx+";
lengthy "+lengthy);
                //lengthx=64;
                //lengthy=64;
                if(textureID==0)
                {
                        int[] textures = new int[1];
                        gl.glGenTextures(1,textures,0 );
                        textureID=textures[0];
                }

                gl.glBindTexture(GL10.GL_TEXTURE_2D, textureID);

                gl.glTexParameterf(GL10.GL_TEXTURE_2D,
GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_NEAREST);
 
gl.glTexParameterf(GL10.GL_TEXTURE_2D,GL10.GL_TEXTURE_MAG_FILTER,GL10.GL_NEAREST);

        gl.glTexParameterf(GL10.GL_TEXTURE_2D,
GL10.GL_TEXTURE_WRAP_S,GL10.GL_CLAMP_TO_EDGE);
        gl.glTexParameterf(GL10.GL_TEXTURE_2D,
GL10.GL_TEXTURE_WRAP_T,GL10.GL_CLAMP_TO_EDGE);

        gl.glTexEnvf(GL10.GL_TEXTURE_ENV,
GL10.GL_TEXTURE_ENV_MODE,GL10.GL_REPLACE);
        Log.d("opengl error 1", "error code "+gl.glGetError());

                Bitmap bitmap=Bitmap.createBitmap(lengthx, lengthy,
Bitmap.Config.RGB_565);
                Canvas mCanvas=new Canvas(bitmap);

                //mCanvas.drawColor(Color.BLUE);

                Path path=new Path();

                int pointnum=(int) (pointSet.length*0.5);

        //      Log.d("point cound:",pointnum+";");
                path.moveTo(pointSet[0], pointSet[1]);
                for(int i=1;i<pointnum;++i)
                {
                //      Log.d("point: ",pointSet[i*2]+";"+pointSet[i*2+1]);
                        path.lineTo(pointSet[i*2], pointSet[i*2+1]);

                }
                path.close();

        //      mC
                mCanvas.drawPath(path, ballPaint);
                //(lengthx*0.5f, lengthy*0.5f, 30.0f,ballPaint);

                ByteBuffer dst ;
                dst=ByteBuffer.allocate(bitmap.getHeight()*bitmap.getWidth()*4);

                bitmap.copyPixelsToBuffer(dst);

                gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGB, lengthx,
lengthy, 0, GL10.GL_RGB, GL10.GL_UNSIGNED_BYTE,dst );

-- 

3. Where to find the Sample code ???

4. Slide Show sample code.

5. resource in conflict

6. DDMS Heap Dump permissions problem

7. Implementing a self-contained library project test project