I want to upload image, audio and video files from my app.
I would like to get camera photo real path, without taking photo.
What I'm using for now is:
String path=""; //The real path I want...
String[] projection=new String[]{MediaStore.Images.ImageColumns._ID, MediaStore.Images.ImageColumns.DATA, MediaStore.Images.ImageColumns.DATE_TAKEN};
final Cursor c=context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection,
I am able to select one contact and get its respective phone number.
code:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (requestCode == PICK_CONTACT_REQUEST) {
if (resultCode == RESULT_OK) {
Uri contactUri = data.getData();
String[] projection = { Phone.NUMBER };
Cursor cursor = getContentResolver()
in my application I import the images from mobile database and display this into my application's gridview.I wrote the following code in my activitiy's onCreate() for same..
String[] projection = { MediaStore.Images.Media._ID,};
Cursor mImageCursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, projection, null, null, null );
if (mImageCursor != null)
Basically I have a method that populates a listview from my database.
I am receiving both null pointers on a cursor and 'unable to stop activity' errors.
This is how I am returning my cursor:
public Cursor getAppointmentsData() {
String[] columns = new String[] { KEY_ROWAPPID, KEY_NAMEAPP,
KEY_TYPEAPP, KEY_TIMEAPP, KEY_DATEAPP, KEY_COMMENTAPP };
Cursor c = ourDatabase.query(
At the moment I’m using getContentResolver().query()/managedQuery() to get a cursor to retrieve images from the gallery app.
I am doing alarm Project,
I want to set one time alarm..
I want to choose a random data from database and display in textview.
Following is my code to fetch all the songs from android device:
String[] proj = { MediaStore.Audio.Media._ID,
MediaStore.Audio.Media.DATA,
MediaStore.Audio.Media.DISPLAY_NAME,
MediaStore.Audio.Media.SIZE };
musiccursor = managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,proj, null, null, null);
music_column_index=musiccursor.getColu