Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8404509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:37:04+00:00 2026-06-09T22:37:04+00:00

My code listens to the DCIM folder, using a FileObserver . All Android versions

  • 0

My code listens to the DCIM folder, using a FileObserver.

All Android versions I used, except 4.1.1, sent only 1 event – when the video was finished taken.
I think it’s the correct behavior – write continually and close when finished.

In 4.1.1 (Galaxy Nexus and Nexus S) though, the event FileObserver.CLOSE_WRITE is sent
twice – when the video starts and when it ends.

Also the same for photos – the event is sent twice – though it’s not that critical.

The problem is that I can’t distinguish between the start event and end event of a video.

I could try and check the size of the file, but because the event may have been delayed (slow/busy device), the size may be quite big.

Any idea why was the behavior changed? Do you know where is the camera’s app source code? I can try and look at the history to understand that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:37:05+00:00Added an answer on June 9, 2026 at 10:37 pm

    As I wrote in one of my comments, the difference between 4.1 and previous Android versions is that in 4.1.1, the file is written and closed twice. Once when an empty video file is created. Then the video is written into a tmp file. Then the rename/copy of the tmp file is the second write_close event.

    In previous versions there’s not tmp file – only the original – thus only one close_write event.

    Please comment if you think it’s a bug. I’m not sure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have JavaScript code that listens to the return key pressed, works on all
I have written an android app which listens to the phone signal strength using
Following is the code which listens on a port for HTTP requests and sends
Code to create new form instance of a closed form using form name I
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
I have some code that listens for announcements via UDP multicast. I can get
Does anyone know of WPF code examples using Prism in which modules each register
I wrote some code to periodically post data to a NodeJs program that listens
I am creating a server (desktop based) which listens on a port 4504 using
I have this code http://pastebin.com/hCFk0FJg Server starts and listens normally, but then when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.