android stopping another application - android

I have been trying to do some research for this but I did not find the one I was looking for.
So, what I would like my application to do, is simply stop another application.
If I would use .bat and .exe examples like I do with my computer, I would like stop .bat tho stop notepad.exe.
It do not care will it stay as a background app or no.

You can only kill your own applications, as each app runs sandboxed as a separate Linux user.
If this is no problem for your use case, killBackgroundProcesses should do what you're looking for. An additional requirement for this is the KILL_BACKGROUND_PROCESSES permission.

Related

Android: Interact with another app?

I'm looking to build an app that will restart my device at a specified time, then open up a couple 3rd party apps in sequence and run their feature/s.
For example: I would like to automatically restart my phone at 5am. Then have it open an antivirus app of my choice and run the scan. Then close that app and open up another app and run it's cleaner function.
I have experience coding, but I'm just starting to take a peak into android app development. So, I was wondering if this is something feasible to do.
Any advice would be appreciated!
I am not sure about the starting phone at the desired time, but I am sure you can start applications on boot using "init". Linux systems support that, and android does as well. But it completely depends on your kernel.
Read here about init.d.
Check if your phone's kernel supports init.d. Check here if your phone doesn't have init.d support.
Check Here for running a script at boot. It is quite useful for custom scripts.
Check Here for running scripts/application the application at boot
Create a script according to your needs and I think you would be able to achieve what you are looking for. <- Custom Rules
I would have commented but apparently I can not since I am new here.
I hope I was of some help. Will look into the android starting part and get back to you.
Cheers.

is there anyway to find out which apps were launched on my android device?

Sometimes I really need to know if anybody has used my phone while I wasn't home? Is there any app to reveal such a thing? something like "launched apps history".
I don't believe that there is a built in provision for achieving this, but there are a number of available applications that allow you to monitor this, such as KidLogger. KidLogger is somewhat outdated, but I think there are other apps available too.
The other option is to download a log viewing program (or export the logs to your computer) like CatLog so that you can view the system logs. Application calls should be visible in the logs. I do believe that this requires root access though.

android taking screenshots programmaticaly Android Screenshot Library issue

What I want to achieve is to capture a current foreground activity and save to bitmap file. I need to handle taking that screenshot in a background service. I have run through many ideas, tutorials that mainly uses invoking getWindow() method and enabling cache. However that approach is useless for me - it is impossible to get reference to the foreground running activity (isn't it?) - using ActivityManager I can get only the name & package of it.
I came across the ASL (https://code.google.com/p/android-screenshot-library/downloads/detail?name=asl-1.2.zip&can=2&q=) which uses "native service" which is available in compiled binary file. Library's wiki note states that you have to start the native "screenshot service" by ADB using pc.
My question is: could it be possible to start that service programmaticaly through java code, something like JNI (using NDK) does?
On a rooted device, you can start the service from Java with
Runtime.getRuntime().exec("su")
On custom system, you can start the service from /init.rc.
NDK will not help, anyway. Going C does not compromise the system permissions.

modify manifest files of other android applications

im trying to develop a android application locker.is they anyway i can open and modify other applications manifest files and make it launch my activity first before the actual application activity.
Ive developed my locking system.i only need to actually lock and application.
That is not possible. And you shouldn't be trying to do that, it'd be a huge breach in security. On a real note, you should create a service which runs constantly and listens for when a specific application would be launched. And when it is launched, your application would be shown first. Also your "locking system" should be what I described above, if it's not,I'm not sure what you're trying to accomplish.
Please go through the Google Play Terms of service before trying to modify manifest files of other Apps :
http://play.google.com/intl/en_in/about/android-developer-policies.html

Android: Can a 3rd party application use AT commands to auto answer phone call...?

I need to develop an auto answering (GSM call) Android application.
I searched internet and learned that 3rd party applications do not have permission "android.permission.MODIFY_PHONE_STATE", because of which my application can not auto answer a call.
Then, I read about these AT commands. After reading different links I am still unsure about two things which I want to ask:
Can a 3rd party application use these AT commands to auto answer phone call...?
Does it require root access?
I think it needs root access (but I need to confirm), because on my unrooted phone I used command
"busybox microcom -t 5000 /dev/ttyGS0"
but I got
"busybox: permission denied"
( I tried to root the phone but because of some problem I am unable to root it.)
Since, I don't have any background of working with AT commands,So, before starting to write complete code for AT command, I need to confirm those above two points, to make sure that I 'm going in the right direction.
(I'm confused because, I wrote simple code to get the names of ports but program did not show any output (for my unrooted phone)...)

Categories

Resources