Edit Contacts Database

by ramesh kumar bh » Tue, 14 Apr 2009 20:56:21 GMT


Sponsored Links
 HI

I am new to this Android. I want to edit the contacts database.. i
want to insert some other information like home address office
address,office ph nos etc to the existing database.
How can i do that? what is the existing database. how can i view that.
please let me know.
Regards
Ramesh B
--~--~---------~--~----~------------~-------~--~----~



Edit Contacts Database

by Mark Murphy » Tue, 14 Apr 2009 20:58:35 GMT


 > I am new to this Android. I want to edit the contacts database.. i

You will need to use the Contacts content providers (e.g.,
Contacts.People, Contacts.Organizations).

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!



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


Sponsored Links


Other Threads

1. Help needed with MediaRecorder - first time dev

I am working on a very simple recorder app:

I want to record a person's voice for a few seconds.  Then I want to
be able to play it back.  Then I want to FTP it to an FTP server.
Should be relatively simple - but I can't get the first portion of
this done.  As soon as I set the Audio Source I get a crash in both
the simulator (expected since MediaRecorder is not supported) and on
my phone (not expected unless I am doing something stupidly wrong).  I
feel like I am importing the world here trying to find something that
works - and I have gone through like 4 sets of example code (merging
most of it).

Here is what I think is the most simple version of my code that
compiles and runs it just crashes on me when I click the button::::


package com.example.helloandroid;

import java.io.File;
import java.io.IOException;
import java.lang.Object;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.EditText;
import android.widget.Toast;
import android.media.*;
import android.os.Environment;
import android.media.MediaRecorder;
import android.content.*;
import android.provider.*;
import android.net.*;

public class HelloAndroid extends Activity {

        MediaRecorder recorder = new MediaRecorder();
        String path = "/mnt/sdcard/filename.3gp";

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

        final Button button = (Button) findViewById(R.id.button);
        button.setOnClickListener(new View.OnClickListener() {

                        public void onClick(View v) {

                                String state = 
android.os.Environment.getExternalStorageState();
                                if 
(!state.equals(android.os.Environment.MEDIA_MOUNTED)) {
                                        new IOException("Path to the file could 
not be created.");
                                }

                                
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
                            //
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
                            
//recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
                            //recorder.setOutputFile(path);

                            //recorder.prepare();
                            //recorder.start();

                                Toast.makeText(HelloAndroid.this, path,
Toast.LENGTH_SHORT).show();
                                //recorder.stop();

                        }
                });
    }

}


Any help here would be greatly appreciated!

-- 

2. openGL problem

Hi at all, I have a terrible issues with texure sphere mapping.

This is my code:

public void onSurfaceCreated(GL10 gl10, EGLConfig config) {

                GL11 gl = (GL11) gl10;
                gl.glDisable(GL10.GL_DEPTH_TEST);                       
//Disable Depth Testing
                gl.glEnable(GL11.GL_TEXTURE_2D);
                gl.glEnable(GL11.GL_CULL_FACE);
                gl.glCullFace(GL11.GL_FRONT);
                gl.glFrontFace(GL11.GL_CCW);
                sphere.loadGLTexture(gl10, context);
}

public void onDrawFrame(GL10 gl10) {

                GL11ExtensionPack gl= (GL11ExtensionPack) gl10;

                gl10.glMatrixMode(GL10.GL_PROJECTION);
                gl10.glLoadIdentity();
                gl10.glFrustumf(-5.0f, 5.0f, -5.0f, 5.0f, 1.0f, 100.0f); //Mio
                gl10.glMatrixMode(GL10.GL_MODELVIEW);
                gl10.glLoadIdentity();
                GLU.gluLookAt(gl10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -10.0f, 0.0f, 
1.0f,
0.0f);
                sphere.draw(gl10);
}

public void onSurfaceChanged(GL10 gl, int width_, int height_) {
                gl.glViewport(0, 0, width, height);


        }

public void draw(GL10 gl10) {

                GL11ExtensionPack gl = (GL11ExtensionPack) gl10;
                GL11 gl11 = (GL11) gl10;
                gl.glBindTexture(GL10.GL_TEXTURE_2D, textures_ids.get(0));
                gl10.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, totalVertexCount);
}

public void loadGLTexture(GL10 gl10, Context context) {

                GL11 gl = (GL11) gl10;
                gl.glGenTextures(2, textures_ids);
                gl.glBindTexture(GL10.GL_TEXTURE_2D, textures_ids.get(0));
                gl.glTexParameteri(GL10.GL_TEXTURE_2D, 
GL10.GL_TEXTURE_MIN_FILTER,
GL10.GL_LINEAR);
                gl.glTexParameteri(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 );
                GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, this.image, 0);

                gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
                gl.glVertexPointer(3, GL11.GL_FLOAT, 0, vertexBuffer);
                gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
                gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0,textureBuffer);

        }

The vertexbuffer contains a points for a sphere and the texturebuffer
contains the normals for that, I meet an horrible result and I don't
understand what's wrong...

This is the result img:




I am working with android OpenGL ES but I think error isn't correlated
with my platform but is correlated with my use of OpenGL API, I am a
newbye with this library.

Thanks so much in advance.

pedr0

-- 

3. EditText not able to regain focus.

4. Help needed on streaming aac+ stream on Android

5. gps problem

6. how to select multiple images through intent and get their Uri in my activity to perform some task on thease images

7. how can i set the word space in the textview;