-1


Im developing a android application.
The following are the configuration details Mimimum SDK=10

In my application i want to play a video (which is already captured) and show the timer to run for every seconds when video is running.
For example:The video is captured via application.The date & time of video capturing event is stored in shared preferences
When the user want to run video via application.I need to show the date (at what vidoe captured).I was show correctly the date
Here the problem the timer need to start from the video capturing time.
If i capture the video at 11.23 via my application then again i play the video on 12.44 means then the timer starts from the time 11.23 & goes on.
I does not know how to do this


.For instance the video is captured at any time 10.23.But it is played at now (assuming now time is 20.13).When playing video .I need to show a timer on top of video which starts the time 10.23 (At when video captured) and after every minutes when vidoe running the timer increases to 10.24,10.25,etc like that i want

All are welcome to give their ideas

SIVAKUMAR.J
  • 4,258
  • 9
  • 45
  • 80

1 Answers1

0

When you first record the video, get the current time using System.currentTimeMillis() and store that to a file, or to shared preferences. Then you can retrieve that time whenever you need. You can store it as a formatted string (HH:mm) via SimpleDateFormat or as a long.

Get the length of the video, and add this length to the time from shared preferences you calculated, and format that using SimpleDateFormat

Viola!

Jason John
  • 934
  • 2
  • 12
  • 23
  • jayti95:I think you dont understand my question.For instance the video is captured at any time 10.23.But it is played at now (assuming now time is 20.13).When playing video .I need to show a timer on top of video which starts the time 10.23 (At when video captured) and after every minutes when vidoe running the timer increases to 10.24,10.25,etc like that i want – SIVAKUMAR.J Jul 23 '14 at 13:56
  • Oh. I definitely did not understand the question the first time. Try this: When you first record the video, get the current time using `System.currentTimeMillis()` and store that to a file, or to shared preferences. Then you can retrieve that time whenever you need. Then follow the rest of the steps I had outlined. – Jason John Jul 23 '14 at 14:27