Listening to camera image capture

All your problems with Audio, Video and Images.

Listening to camera image capture

Postby tsouza » Sat Jul 24, 2010 5:27 pm

Hi all,

I'm quite new to android development and I'm doing some experiments to try it out. Currently what I am trying to do is every time a picture is taken get it's file path. I understand that Broadcast Receiver is one way of implementing listeners in android.
I successfully implemented one (which listens to AIRPLANE_MODE and outputs log messages), but for camera pictures I can't find an appropriate intent. I already tried MEDIA_SCANNER_SCAN_FILE with no success. Here is my current android manifest:

Code: Select all
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="test.app" android:versionCode="1"
   android:versionName="1.0">
   
   
   <application android:icon="@drawable/icon" android:label="@string/app_name">
   
      
      <receiver android:name="TestBroadcastReceiver">            
         <intent-filter>
            <action android:name="android.intent.action.MEDIA_SCANNER_SCAN_FILE" />
            <data android:scheme="file" />
         </intent-filter>         
      </receiver>
      
   </application>
   
   <uses-sdk android:minSdkVersion="8" />

</manifest>


Is this possible to achieve? Any clue anyone?

Thanks in advance,
Thiago Souza
tsouza
Freshman
Freshman
 
Posts: 2
Joined: Sat Jul 24, 2010 5:52 am

Top

Re: Listening to camera image capture

Postby techkanika » Sat Sep 11, 2010 7:04 am

hi...tsouza

you can implement this using ContentObserver instead of using BroadcastReceiver.
Whenever image is clicked, onChange method is called, in which using cursor query
you can find which image is clicked.

Kanika
Thanks
Kanika Rakheja
User avatar
techkanika
Experienced Developer
Experienced Developer
 
Posts: 83
Joined: Fri May 28, 2010 7:49 am

Re: Listening to camera image capture

Postby vvxifeng16 » Mon Sep 13, 2010 9:05 am

The original .. so thank you for the information .. really good .. I will tell other people
vvxifeng16
Freshman
Freshman
 
Posts: 8
Joined: Wed Jul 07, 2010 3:56 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Exabot [Bot] and 11 guests