How to run my app in background and listen to a hyperlink click event in from other apps or browsers - android

User installs my app. Once installed, it runs in the background forever unless user disables the run forever button in my app or uninstalls my app. Now, my app need to show a popup message once a hyperlink click event is triggered from anywhere in the android device. The click event might have been triggered from default messaging apps (like user click a link provided in a message he/she has received) or from some other apps in the device like twitter and facebook.
I want to know if there is any way I could achieve this? If yes, then please suggest me how to do it.
Any kind of help will be greatly appreciated.
Thanks!

The correct way to do this is with Intent Filter, not by having your app run constantly in the background.
Android Respond To URL in Intent
Then, you can program whatever behavior you would like to happen

Related

I want my Flutter app to automatically open when user hangs up a call

When a user receives a call and ends it. I want a small pop up from flutter app, which asks if the recent call was an enquiry or not. Once the user presses yes, it has to take him to the flutter app where he can enter rest of the details.
I can manage the rest of the app, but can someone give some pointers as to how I can do this. IOS is not a necessity. As long as it works with Android its fine.

how to Launch Cordova app when phone locked

I am working on an android app built on apache cordova. The app used to send your location via SMS, Email & in app notification to your predefined contacts. I want this sharing event to be triggered on double tapping on screen (when locked) or 3-4 times pressing the power button/ volume button.
Its for emergency situation, when user may not be able to unlock phone & open app to share any info.
I've searched a lot but could not find any relevant info. is there any available plugin to do that? I know very little of JAVA. Expecting any plugin that would allow me to launch the app(any activity) when phone is locked.
Any helpful information or suggestions are appreciated.
To accomplish this kind of task, you need to run a service in background, it is not possible to use any cordova webview, so you won't be able to run any javascript.
I don't think there is any plugin doing such a thing as it is very specialized.
I needed to create an app that needed to send notification to the user depending on his location. It ended up in writing a native plugin...
So the best advice I can give you is "It's never too late to learn Java" ;-)
maybe some other JS framework (maybe NativeScript) allows such things but I never used it yet so it might be impossible too.

detect button click globally

In android, is there anyway to detect that a foreground app's button is clicked? I am not talking about my own app, I mean detect globally a button press event.
For exapmle, skype is running in foreground, I'd like to detect when user clicked a button in skype.
=====UPDATE=====
If the answer of above question is no, is there a way to detect window focus change OR dialog popup globally?
the answer is no and no.
That is by design and it's a "security feature". Android is sandboxed, apps operate on separate Windows and separate processes and are not supposed to know about each other. Unless the specific app is broadcasting something, there's no way to external apps to access it.
Try to imagine what a HUGE security flaw that would be to have that type of access.
malicious code is installed with permission to receive "global clicks" and "draw on top of other apps".
user installs banking app
user click on login on banking app
malicious code receive the click and draw on top of the app something that looks exactly like the banking app
user type his/her login details
malicious code transmit user details to remote server
developer of malicious code withdraw users money.
to conclude: I'm very happy that Android does not provide such functionality.

Android - app list

I am trying to make an app where the user is shown a list of installed applications, each one in a separate check box. If an app is checked, and then later opened, how can I trigger an event when the app that the user selected is opened. I am a complete novice in this area, therefore code or tutorials would be appreciated, as I don't know where to start.
You want to use PackageManager getInstalledApplications() or getInstalledPackages() to get a list of installed apps.
I don't understand the following part of your question:
If an app is checked, and then later opened, how can I trigger an event when the app that the user selected is opened.
It sounds like you want to open the exact app which the user opens but that's probably not what you mean.

How to force my app to the front

I have developed an android app that uses a timer with a call back. When a specific criteria has been satisfied, the app either rings or vibrates the phone depending on user settings. It will continue to ring until the user acknowledges an alert box. This all works fine. However, if the user has brought another app to the front then he may not realize it is my app causing the phone to ring and re-open it. Is there a way I can force my App to the front or at least the Alert Message to be on top of anything else?
Notifications are your friend. They wont interrupt a users workflow and with the new JellyBean apis you can put actions and other dynamic components in them.
Instead of doing that, you could just use a notification with a specific ringtone once it has been sent instead of annoying the user this way.

Categories

Resources