I'm just looking a way to launch/open an application automatically every time the camera app starts! I know it will something to do with intent. Does someone has some examples to forward to me? I'd also like to add a toggle withing my application settings to enable/disable automatic launch on camera app opening.
Thanks allot, Diego
If you give an example of an app that does something similar to what you described, then maybe we could understand what you mean if we misunderstood.
The fact is, if I understand your question correctly, you want your app to start whenever a user hits starts the camera app on android.
As CommonsWare noted, this is not supported. It would require you to have control over the code behind the Camera app, and even then I'm not sure if you can start other apps from a given app (I believe you can, as I've seen this behavior before)
Short answer is: you can't. You might be able to start the camera app from your app however, but that is a different question.
Related
I'd like to offer an app to modify images. In order to have the user give an easy access to the that feature, it would be the easiest solution to just let him directly take a screenshot to have the source picture taken or respond to a screenshot event and access the latest screenshot.
Unfortunately it seems to be a problem, since an app or even a service from the app runs in background cannot easily react to events and I haven't found any solution that would go only little close to that kind of thing.
So my questions are (lets assume all necessary permissions are given from the user):
Is there a possibility to register my app as kind of standard screenshot app (or additional screenshot app triggered by another key combination of the device) and how ;-)
Can an app stay in a state to notice if a screenshot is taken and
can access it?
If not: Any ideas for an workaround other than let the user select a taken picture, which is rather kind of roundabout and annoying?
Any hints are very welcome! Thank you in advance!
(Since I had a misleading headline, I reposted this question - sorry!)
When I go to the descitption of a certain app that have android.permission.CAMERA in application inspector it says : "...to take photos and videos at anytime"
I find it confusing and would like to know if anytime refers to anytime when the app is active i.e. open, or any time like it can activate it self in a background process and access the mentioned device.
The only doc i could find is https://developer.android.com/training/permissions/usage-notes but it does not answer my question.
It is possible to take pictures/videos without showing the preview. But it is complicated depending on the android version. There is even a libary which handles it:
android-hidden-camera
I would like to know if it is possible to have a process that would constantly run on the phone and would track the number of times a user taps on the screen.
For example, the user downloads a game, plays and then quits the app and although he quit the app, this process that got installed together with the app will still run and all that it would do, is that it will increment a value every time the user taps on the screen and then remember the said value, in order to be used the next time the user starts the app.
I don't know if this is a simple question or not but please keep in mind that I am new to Android development and I did not find any related topics on this.
Thank you in advance.
Yes, it is possible. Using certain flags on your service, you can create a system-wide overlay that should allow you to catch all click events systemwide. However, keep in mind that it seems that Google have tightened up security in Android 4.x, so you may have trouble getting this to work on more up-to-date versions of Android.
For specifics about implementing this, see this question: Creating a system overlay window (always on top)
Basically I want to prevent a particular application from starting. A further question may be related to the Android internal behaviors from clicking application button to application running. Help clarifying each internal step will be highly appreciated.
Put it in detail: When the user clicks 'YouTube' button on the screen (assuming YouTube has not been started by far), who gets to know first this particular click is YouTube? Also, I think finally Zygote will spawn a new process representing YouTube, and this process will be written in process table in kernel. Should I let Zygote know this is an application that the user should not start?
If the user starts an app by clicking on an app icon per default you won't be able to intercept it.
You might be able to do something if you made your own launcher application which had it's own shortcuts to all apps that reside on the phone. That would be my best suggestion to a possible work around.
Is there any way to programmatically pause an Android app in Phonegap? I would like to mimic the behavior that occurs when you hit the HOME button. I've already had to overwrite the back button handler using this, and while in most cases I want it to do my action, when in a particular state the user would expect the app to minimize, and I want to replicate this behavior.
Keep in mind, on Android this is not the same as closing the app. That is quite easy to do with device.exitApp(); but I would like it to remember its state and keep running in the background. Especially if there's still an asynchronous job being done in the background.
Is there a feature in Phonegap to achieve this?
Possible duplicate of Manually pause an application in Android Phonegap, but I couldn't find some of the tools the OP mentioned there such as navigator, so I was nervious to totally edit and rewrite their post
The simple answer appears to be: no.
However, for anyone else that comes down this path, its not impossible. It's just that there isn't a feature of Phonegap to do it for you.
The Android equivalent of "sleeping an app" is actually just opening another intent. Specifically, opening the "Home" intent would sleep the running app and bring you back to the home screen. But as far as I can tell from asking around and scoping the docs, Phonegap doesn't have a direct way of opening intents.
What you (supposedly) can do is one of two things:
This plugin is supposed to be promising
Call the Java code that does it yourself using the means described here
Mind you, as of right now I've decided to not go any further with this, so I make no promises about either of those means, having not attempted them myself.
I invite anyone else who decides to pursue this further to update their experience here.