Detecting photo action in android - android

Hey I'm stuck with this problem for quite a while
I need to have a backround activity in android which will be running to detect any photo/video activity, the minute a photo or video is taken it should make an entry into a text file:
The entry should look like this : [uri_of_new_photo, time, gps-location]
What are the possible ways in which i can achieve this, I was looking at the BroadcastReciever, but was not sure if that would work.
Are there any tutorials/links which can give me a solution. A direct solution to this problem would be great!! (rather than alternatives, as this is a small part of a bigger project)

What are the possible ways in which i can achieve this
Technically, it's not possible. Anyone is welcome to write a camera application that takes photos or videos and does not tell you about them.
I was looking at the BroadcastReciever, but was not sure if that would work.
I am not sure what "the BroadcastReceiver" is that you are referring to.
You are welcome to use FileObserver to try to monitor likely places for photos and recorded videos. However, there is no guarantee that apps will write their photos or recorded videos in the places that you are looking. And, just because there is a new file in one of those directories does not mean that the user took a photo or recorded a video -- they could have simply copied a file into that directory, or obtained the file from the Internet (e.g., Flickr sync). And, this will only work while your app is running.
You are welcome to use a ContentObserver on MediaStore. It will suffer from the same basic problems as would the FileObserver approach that I mentioned.
If you want to reliably log information about the time and location of photos and videos, write your own camera app.

Related

Understand hiding process in android

There is someting i'm not guessing. How does photo lock apps work. In which directory do they move the photos so that they are no longer available in the gallery?
There are a lot of ways to do that. I think the simplest solution is to make the image not recognizable for the system, in that way the gallery app won't be able to find it. Simple encryption algorithm should do it.

IceMobile - Can I specify a file location to save pictures taken with the camera

I've been looking over the API for the camera in IceMobile and it seems the only thing you can do with the picture after taking one is to upload it?
I need to be able to save the pictures to a specific location on the device(It's not just a phone) with certain names and was hoping I could integrate my current JSF application and add the camera component to the page and start taking pictures.
If this does not work I already have an idea of what I'll do to make it work as a native app, but am really hoping to use IceMobile as the rest of the website could have potential for other ideas in the business mobile app and would like to keep it a single app. Thank you.
This is not currently possible with the ICEmobile API, and the ability for the web application to save a file to an arbitrary location on the device is potentially a security issue. So, it would be necessary to define a restricted, secure version of this feature for it to be added to ICEmobile open source (such as either allowing the user to browse to the location, or specifying the save location to be a well-known location for photos).
Since this is a feature request and does not have an "answer", please contact product.support#icesoft.com or post on the ICEmobile forums to discuss further. Once that discussion is complete, the final result can be posted here as an answer.

Opening files within an application instead of default file viewer

I'd like to open files such as photos, documents, music and video in my application. I've seen a lot of applications that open up the files in the device's default program for that filetype.
Is there a way to somehow view the files in my application without opening another application?
Reading files in Android is just as simple as any other Java application. Depending on what type of file you want to read and display, you will do different things, this question tells you how to read a text file. The principle for other types is about the same. For images, you can simply use BitmapFactory.decodeFile(). I don't have experience with video or audio, but MediaPlayer looks like a promising first step.
You can do it, but only by writing your own Activity that can handle that type of media. So it can be a lot of work, depending on what you want to do. HTML, images, video, and audio are relatively easy, but if you want to do something like view PDF or office documents, you're setting yourself up for a tremendous amount of coding. Probably better just to launch someone else's viewer to view the relevant content; that's how almost everyone does it on Android.

Tracking the number of times a video was played

Folks,
The project that I am working on requires that a certain video can be played on an android device for x number of times. After that, it must stop playing. When a client gets the video file, he or she also gets another file that contains the Android device ID and the number of times the video can be played. The original file and the metadata file are both encrypted.
My first thought is just to write a video decoder for the video file. Each time the file is played, the decoder first checks if Android device and the count are valid, decrements the count, starts decrypting the data and streaming it to the mpeg-4 decoder shipped with the OS.
I would appreciate your feedback on this idea. Please share your thoughts if you feel there is a better way to do it.
One problem I see is where to store the actual count. Storing it in the file itself won't work as the user can simply backup the original file and replace it after the count exceeds. It has to be stored in some other part of the system that cannot be tampered by the end-user.
Thank you in advance for your help.
Regards,
Peter
Useless to store it anywhere on the actual device, because anywhere an app can touch a user can as well. Best bet is to use a remote server for authorization, but then you get spoofing problems. But your real goal is to make it a nuisance, not worth going around, instead of making it impossible to crack, because you can't.
Okay, the simplest way would be similar to something you first suggested, and needs no further infrastructure: store the information in a file. This is defeated by reloading the file, as you suggested, but even that is a high enough barrier for some.
Defeat reloading the file via obsfucating where you're storing the information. Possibilities include text files (easy to spot), or perhaps image files (like images that are supposedly button images).
Remember, it only takes 1 guy 1 time to point the playback into a recorder, and you have a perfect, DRM-free copy running around in the wild. Remember that you're simply trying to make it easy enough to view legitimately and difficult enough to crack (take the difference of those) that people won't bother cracking it.

Video 'Snipping' Android - Possible?

Hey guys, I'm looking into creating an application that requires a video file taken on the mobile phone, open it and allow the user to cut the video using two sliders, one for IN(the beginning) and the other for out(end of the clip you want), this will then create a new file and my app will use it then.
Does this sound feasible? Where should I start looking in order to do this quite simple concept? Does anyone have any ideas?
Thanks
Android SDK has no video-editing (not even cropping) capabilities. So you'd need to write your own.
To do this you'd need to know 3gpp video/audio file format and also a way to decode the file (for showing in the UI).
This is by no means a trivial task.

Categories

Resources