android hidden app strategy - android

I'm trying to create an app "hidden" from applications list.
The way i though the user will start the app is through a Receiver listening for NEW_OUTGOING_CALL and intercept a particular number dialed.
The problem is that on new Android versions, this receiver will never be activated if the app never start once. (Starting the application from a BroadCastReceiver (NEW_OUTGOING_CALL doesn't always work)).
I can't figure out a workaround for this problem: the app launcher is totally hidden so the user cannot never launch the app, and the receiver would never be activated if the app will never start.
Is there any other strategy or workaround for hide and launch the app with some kind of secret action?

Create a activity with manifest file pointing it as the the Launcher activity and make it transparent and call its finish method in onCreate. User clicking on that icon will have no idea that the activity is opened. But why don't you show the About application kind of screen in the launcher activity?

Related

Start Android application without launcher

How to start an application that has no launcher activity?
Story behind the problem:
I have an application that is basically a BroadcastReceiver that waits for a couple system intents like BOOT_COMPLETED. The problem is that as my application has no Activity, it doesn't get started and so it receives no intent.
Android 3.1 release notes mention that intent options can be overridden to start up applications but I assume it requires another active application to do so.
P.S. Write all the ways you know. ADB commands as well.
First piece of advice would be to make a very simple "Welcome to my App" Activity that could be run. Use it to show a splash screen, some advertising, or be a settings screen. That gets you around the "no Activity" problem.
As far as I know, you cannot have anything hooking into BOOT_COMPLETED until and Activity in your application has been run. So you need to have an Activity of some sort.

Launch one activity from another

i just want to know how can i detect if the user opens an app so an activity of mine launches as well.
For example, the user opens the sms app and right after a kind of lockscreen appears.
You can create a service which will run int the background and you can use this API to determine which activity is visible. That's how many app lock works.
As far as I understand the Android system, it is not possible unless you are making a custom firmware.

It is possible to make a HoneyComb activity unclosable?

I'm developing a presentation style application for HoneyComb Tablets. At one stage the tablet may be passed around a room for people to interact with. If possible I would like to prevent malicious users from navigating away from the current activity.
So far I have overwritten the onBackPressed() to prevent finishing the activity but users can still press the other buttons on the status bar and also leave the app via notifications that pop up.
Any suggestions or possible solutions?
Thanks
1. Make your activity full screen.
2 Use an alarmManager to trigger your activity from a service on a regular interval say 2or3 second (only if your activity is not foreground). For this use a boolean variable and store it using sharedPreference. this value will be true in onReume and false in onPause or in onStop or in onDestroy. And then only start your activity from your service if the boolean variable is false. Now if your user will press the Home button then AlaramManager kick start your activiy again.
3 Make a special button for finishing your service and activity and for cancel the alarmManager.
As far as I know there is no way to capture the home button press, so this is not possible. Not to mention, it would be a bad ui design decision by the dev team. The home button is there so every Android user has a standard way to exit apps. There would be some extremely malicious apps if there was a way to make the user unable to exit an app.
I'm developing a similar application that runs in a "kiosk" fashion for retail stores. When the application launches, it programmatically hides the system bar so you cannot exit. The system bar is restored when the tablet is rebooted. It requires root/su however.

Start my android application *in the background* on boot

I am successfully able to start my Android app automatically on boot using BroadcastReceiver with an intent-filter BOOT_COMPLETED. In my onReceive method, I start the launcher activity for my application.
However, I don't want this application to be in the foreground on boot, but I do want it to be on the activity stack. Is there a way to still have the home screen show up on boot, but also have my application starts up. (I don't think I want to use a Service, because my application has UI.)
Decision on weather you should or should not use Service in appliction is independent on weather it has UI or not. All "third party" apps have UI, there is little use of application without at least 1 activity.
So in your case, just use Service.

How to close an application when the Home button is pressed

Hi I have application with more than 20 activities.I want to close my app when Home button is pressed.
There is no notion of "close my app" in Android. Android will get rid of your activities, followed by your process, after some period of inactivity by the user.
You could use the launchMode and clearTaskOnLaunch flags on your root activity from your AndroidManifest.xml:
android:launchMode="singleTask"
android:clearTaskOnLaunch="true"
When you again start your app, all activities will be killed.
You don't want to do System.exit() -- that's not how the Android Activity Lifecycle normally works (read this also).
What you should do is move the App to the background with moveTaskToBack(). Android will then keep your app running in the background, and kill it if it's unused and something needs its resources later.
If you want it to close all of the open Activities when your App is no longer visible, you can set noHist = "True" for all of the child activities (leave the main activity with noHist = "False", though). This will make it where instead of reopening your application on the last Activity they were on, it will open it on the "main" activity (i.e. it will be as if they just restarted the app).
Anyhow, read through the following answers for more information: Close application and launch home screen on Android
I have the same problem. Im writing a banking app and am required, by contract, to log off the user (or exit) when the app is put into background. There are obvious security concerns there.
There are a couple of ways Im looking to do this:
1. Intercept home button (and back button for the root activity) key press events to call logoff and/or finish()
2. In the onStop() method, for every activity, detect whether the activity is being stopped due to a new activity being show - if not, assume app is being put to background so logoff and/or finish()
The first may not work if a notification is brought to the front then the user clicks home (I havent investigated yet). Or maybe there are other ways for an app to be put into the background without pressing these buttons
The second way sounds messy & difficult to maintain
Id welcome any other ideas
Drapes
I know android has been designed this way, but it seems naive to think that apps wouldnt want an applicationOnStop event
Hi guys what I understood is that u need to know when app goes in background and how to detect it and if I am wrong plz correct me----
The user can go in background if ur app does not provide any way by pressing Back key or Home Key.
You need to use methods "dispatchKeyEvent(KeyEvent event)" to get home key event or back key event and after getting the event you can execute your task.
you can even restrict user from pressing any key but u can not control the home key.

Categories

Resources