I would like to figure out a method to ALWAYS keep Better Terminal Emulator running in the background on my Tab after I have sent it to the background. I would like for Android to never kill this application.
I understand the normal Android framework automatically kills applications in the background when running low on memory, but I want this single application to stay active regardless of system performance. On the tab we have 512 MB of memory, which should be plenty to keep Better Terminal Emulator running in the background at all times. The goal is to run command-line tools/scripts in the background without fear that they will be randomly closed by Android.
Is there such a method? I have root on my Tab.
Thank you.
If you have root, just run them on the command line... Those won't get closed.
Sent from my SCH-I800 using XDA App
how would I be able to run the terminal emulator from the command line when the commamd line app is the one i need to always be active?
the idea is to get it running like Pandora, always in the background.
mail_e60 said:
how would I be able to run the terminal emulator from the command line when the commamd line app is the one i need to always be active?
the idea is to get it running like Pandora, always in the background.
Click to expand...
Click to collapse
I run stunnel in the background all the time...
I launch connectbot, run my stunnel command, exit connectbot... my stunnel stays alive until I reboot.
Maybe it depends on the command you want to run... but if you run the command and end with a "&" it should fork into the background and stay running no matter what the memory situation becomes on android. (short of an actual OOM event)
Related
I want to execute some code (e.g. poll a website for new data) every 15 minutes. What is the best, most power efficient way to do this?
I think these are my options:
A) auto start my app at device boot, run it in the background as hidden window and use a 15 minute timer.
B) create a Windows service that is always running in background and can fire my app
C) Call some API to register my app with the system so it is launched every 15 minutes, even if it has been shut down. (Which API?)
Thanks.
Use mortscript. Use the following script:
Run "filetorun.exe"
RunAt( Timestamp()+900, "this-script.mscr" )
replace the word filetorun.exe with the app you want to run
replace the words this-script.mscr with whatever you call this script.
Hi Axman,
thanks for the suggestion but Im writing a standalone .exe in C++. Not sure what runtime I need for mortscript and I prefer not taking any dependencies.
Hey all, i am starting to find out about creating apps. I have started with creating a simple webview app that shows a website.
What i am having trouble with is after editing the files in eclipse i hit run an in the SDK emulator all i get is a black screen wit android write on it.
Any ideas?
NOTE: i am very new to this
Be patient it takes like 10 mins or more for the emulator to load
Novice here.
Yes, it will take sometime. Here it starts quickly (core i5 notebook). But it may take a long long time.
You can also use your phone to debug and deploy. It's very very quick, takes virtually no time to load, like the emulator. At least here.
Good luck!
Thanks all it did take a while was juts me being inpatient.
Follow-up question: When debugging an app in eclipse, if you change your source during a debug session, it should restart my app/activity/whatsis, right?
Yeah.. not getting that at all, and my current dev box leaves something to be desired in the horsepower department. Those emulator restarts are killing my interest in working on this pet project of mine.
I found a link that should let me use my Evo directly, hopefully that will do the trick.
--Mark
Sent from my PC36100(Evo) using XDA App
Update:
Grr. I installed the HTC Sync 2.blah, so I can actually connect to my Evo now from within Eclipse but I'm still running into problems. Eclipse still isn't automagically updating my app when I change-n-save. Am I just expecting too much here?
Oddly enough, it DID update the changed app when I unplugged my evo from my laptop and plugged it back in. This took several seconds to catch up, but it beats the hell out of waiting for a new emulator to boot. Ouch. We need some way to freeze/save the emulator state so we can relaunch it with it's memory and so forth already in place.
I'd mangled my first hand-rolled "hello world" app (started monkeying with stuff without knowing what did what), so it no longer ran. Note To Self: "Test Only" flag seems to mean "emulator only". That was a snag.
So I whipped up a demo app (the "Skeleton App" for 2.1) project. Installed and ran fine. I changed a couple buttons to Log.d(...) instead of What They Did, and after the unplug-plugin trick, the app updated. The buttons no longer performed their original tasks... instead they now do what looks like NOTHING! LogCat isn't showing my debug messages at all (which wasn't a problem previously when I was just using the emulator).
Am I just missing the boat here or what?
Major Changes to the UI and usage Check the market for the latest version or use the version attached to this post. If you have trouble with the posted version use the market version as it will always have the lastest fixes. The attached version might have an issue I did update the attached version but I won't manage it here.
1. Complete task ui revamp, easier building and management of tasks.
2. Added cron string builder, you can now build time string with rolling pickers and show you the next execution date (great for visualizing your time string). This will build 98% of the schedules most of us use.
3. Clicking on the clock in the Cron tab will now show all the active queued tasks (tasks that were active when cron was started).
4. Added option to run on boot for a task, this makes tasks execute if the option is checked and cron is set to auto restart. This allows a task to run only, at boot, and the task does not have to be active. (Sascha Kerkeling).
5. Added option to import scripts, you can now import the contents of a script file (Sascha Kerkeling).
6. You can now activate/deactivate a task from the tasks view.
7. I have kept the old tasks view in place for this update so that you can trasnfer any existing tasks over... it will be removed next update.
8. Added cron change log... this will automatically show once every update.
9. Added safe guard so that a reboot command cannot be fired with the execute on boot option (just in case).
10. Added better logging of why task commands fail, this will show as a complete stack trace in the execution log.
11. Added 6 new default tasks that might be helpful (Sascha Kerkeling, A. Simmons).
This is cron for your phone a small app I developed to allow me to restart/shutdown my phone on a schedule, but Cron has a billion uses and I wanted to see how others will use it I also use it to backup my market apps on a schedule.
**WARNING YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP**
This app can be dangerous if used wrong, if you use this app incorrectly and mess your phone up its your fault not mine. You wouldn't blame snap-on if the wrench you used breaks a bolt on your car, so don't try and blame me for what you do wrong with this tool. If you do I will only point at you and laugh.
**WARNING YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP**
Features:
Uses the standard Cron4Phone time string schedule.
Run all type of shell commands on any schedule you can think of.
Run tasks to shut your phone off on a schedule.
Auto restart so Cron4Phone continues to run even after a restart.
Small apk foot print.
unlimited concurrent tasks available.
Set a task as inactive/active.
Test execution setting to log commands only.
I'm really looking forward to seeing how others will use this tool. Please feel free to point out errors or suggestions. If you want help setting schedule I can give pointers.
Android market download
ooooh
as soon as I can liberate a copy from a market enabled phone I will begin tinkering... that might take a while
would you consider releasing it to f-droid.org if your license allows?
Here you go
Here's a copy... I haven't opened the source up although I probably will in the future, when I have more time to spend on it (working on a video game). This copy is signed with the same key as the market version and its ad supported I will slowing be updating the task management part of the ui.
this is the market description
*****YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP*****
This app can be dangerous if used wrong, if you use this app incorrectly and mess your phone up its your fault not mine. You wouldn't blame snap-on if the wrench you used breaks a bolt on your car, so don't try and blame me for what you do wrong with this tool. If you do I will only point at you and laugh.
*****YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP*****
-----------NEW INFO READ------------
After another full audit and help from Sascha Kerkeling and M. Porter, I redesigned Cron to no longer use long running service and instead now (correctly) uses AlarmManager to precisely execute tasks in a WakefullIntentService. This will will insure that all task are executed even when the phone is in deep sleep (even when the phoen doesn't hold any other wake locks) and barely uses any resources to accomplish this. I will now be able to focus on the UI... Dynamic task here we come!
-----------NEW INFO READ------------
Cron4Phone is a time-based job scheduler in Unix-like computer operating systems. Cron4Phone enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the restart your phone and backing up apps. This is a foreground service so that it is guaranteed to stay running, use the home key to back out of the app or double tap the back arrow to kill the app. Killing the app kills the service.
Features:
Uses the standard Cron4Phone time string schedule.
Run all type of shell commands on any schedule you can think of.
Run tasks to shut your phone off on a schedule.
Auto restart so Cron4Phone continues to run even after a restart.
Small apk foot print.
5 concurrent tasks available.
Set a task as inactive/active.
Test execution setting to log commands only.
This tool can be used to do endless amount of things, I'm really looking forward to see what you guys can use it for so please share your ideas, command and schedules.
I have provided 3 tasks that I thought would be the most useful to most users shutdown, restart, and backup apps.
Interesting
Sent from my SCH-I500 using XDA App
testing your application, it's really simple.., i'm hoping custom task can be added more
New version
EDIT: removed refer to the OP...
I attaching a new version to this post, it fixes a bug with the restart on reboot not registering your tasks. Basically if your phone reboots and you have active tasks and cron is started it will keep on running.
As for the ui I will slowly work on updating the task tab so that task can be managed dynamically, other than that the rest of the ui will basically stay the same, I want it to stay simple and small.
The market version has also been updated.
ttt for updates!
Very nice app, I would like to see more Linux tools working with Android.
Sent from my Zio using xda premium
Yes and this was one that I thought was needed, and while you can run cron on your phone through busy box, this app doesn't need that module and uses standard java to mimic cron all while putting a clean ui on top of it.
Thank you.
[EDIT]
ACK! Okay, I just stopped and started the cron and it is now working. Sorry about this post. :-/
[/EDIT]
I am going to resurrect this thread because I can't figure this out and I'm a Unix admin. I have tried to set a schedule for a job to run every 5 minutes (this was to test, the actual job will run every 30 minutes). I have tried to set */5 * * * *, /5 * * * *, and 0,5 * * * * and none of them work for every 5 minutes. Can you look into this or give an example in here? Thanks!
fstrim
If anyone is still out there -- I use Cron4Phone to schedule daily reboots and would like to add an fstrim command to run daily, maybe weekly. Can anyone help me with setting this up (command syntax, etc)?
Is there any chance to get the apk from somewhere? Thanks in advance!
I hate it when an app runs in the startup specially if the app is not that important. Is there any way of disabling those apps that run in the startup? As well as those apps that runs in the background even if you don't need em to? They eat up RAM and make the NC slow! I wish I can manage them.
Let them be android takes care of itself.
Read this: http://forums.androidcentral.com/general-help-how/102171-apps-always-running.html#post1088042
---
- Sent from my LG Optimus V using Tapatalk
les02jen17 said:
I hate it when an app runs in the startup specially if the app is not that important. Is there any way of disabling those apps that run in the startup? As well as those apps that runs in the background even if you don't need em to? They eat up RAM and make the NC slow! I wish I can manage them.
Click to expand...
Click to collapse
Yes...get an app in the market called Android Optimizer, it is free. In the menu hit the startup manager icon. Disable the app (s) you don't want to run at start up or background.
StarlahRain said:
Yes...get an app in the market called Android Optimizer, it is free. In the menu hit the startup manager icon. Disable the app (s) you don't want to run at start up or background.
Click to expand...
Click to collapse
You sure of that name? I did a search in the market and do not see it.
StarlahRain said:
Yes...get an app in the market called Android Optimizer, it is free. In the menu hit the startup manager icon. Disable the app (s) you don't want to run at start up or background.
Click to expand...
Click to collapse
You do not need an app like this. People use task killers and startup blockers and then complain about how crappy and slow stuff is because THEY ARE NOT ACTUALLY RUNNING IN THE BACKGROUND. They are cached for faster start up next time. They do not take up any battery or CPU power. Android is linex not windows.
--------------------------------------------------
Here is the post i linked to earlier:
I develop Android apps so I though I'd explain why a task killer isn't needed on an Android system.
Activities
Android apps use activites to preform tasks. For example, if you use a file manager to send a picture via email, the file manager calls the send activity within an email app, passes the file name to it and the email app sends the picture.. not the file manager. This will result in seeing the email app as "running" even though the user didn't actually launch that email app.
Smaller apps
Using activites helps developers design smaller apps. A file manager app that contains every bit of code needed to do everything a file manager does would likely be so large that no one would want to install it. Developers know that an android phone more than likely has an email app so there is no need for the developer to include email code in his/her file manager to send a picture when he/she can call an activity in an existing email app to do the job. This results in a smaller file manager app since there is no need to include email code or any other code for an activity that can be done via an app that is already present on the phone. This also alleviates redundant code. When you install an app outside of the android market, also known as sideloading, the file manager app calls the package installer (already present in Android) to install the requested app.
Running apps vs. cached apps
The "Manage Applications" list included in many android devices lists running apps as well as cached apps. Cached apps don't use any CPU or battery, they're cached so they will load faster the next time you need them. Killing cached apps results in those apps requiring more time to load the next time they are launched.
System management
By default, every android application runs in its own Linux process. Android starts the process when any of the application’s code (activities) needs to be executed, and shuts down the process when it’s no longer needed and system resources are required by other applications.
* Android is hard coded to automatically kill a task when more memory is needed.
* Android is hard coded to automatically kill a task when it’s done doing what it needs to do.
* Android is hard coded to automatically kill a task when you haven’t returned to it in a long time.
* Most services (while possibly running in the background) use very little memory when not actively doing something.
* A content provider is only doing something when there is a notification for it to give. Otherwise it uses very little memory.
* Killing a process when it isn’t ready only causes it to have to reload itself and start from scratch when it’s needed again.
* Because a task is likely running in the background for a reason, killing it will only cause it to re-spawn as soon as the activity that was using it looks for it again. And it will just have to start over again.
* Killing certain processes can have undesirable side effects. Not receiving text messages, alarms not going off, and force closes just to name a few.
* The only true way to prevent something from running at all on your phone would be to uninstall the .apk.
* Most applications will exit themselves if you get out of it by hitting “back” until it closes rather than hitting the “home” button. But even with hitting home, Android will eventually kill it once it’s been in the background for a while.
If you see an app running that you didn't launch, it's most likely because an activity within that app was called by another app to perform a task. If you kill the app you didn't launch, the system has to relaunch that app in order to complete its task. This is why some people kill a task and then see it immediately running again. Constantly killing that app creates a situation where the user is battling the system resulting in wasted system resources.
Android is Linux
Android is not a Windows-based OS, it is based on Linux. Many of the apps you think are running aren't actually running, they're cached, this is typical with a Linux operating system and is much more efficient than other systems. Cached apps don't use any CPU or battery, they're cached and will load faster the next time they're needed.
Let the system manage resources.
---
- Sent from my LG Optimus V using Tapatalk
patruns said:
You sure of that name? I did a search in the market and do not see it.
Click to expand...
Click to collapse
I apologize ..it is called Optimize Tool Box...lite version(free)...
koopakid08 said:
You do not need an app like this. People use task killers and startup blockers and then complain about how crappy and slow stuff is because THEY ARE NOT ACTUALLY RUNNING IN THE BACKGROUND. They are cached for faster start up next time. They do not take up any battery or CPU power. Android is linex not windows.
--------------------------------------------------
Here is the post i linked to earlier:
I develop Android apps so I though I'd explain why a task killer isn't needed on an Android system.
Activities
Android apps use activites to preform tasks. For example, if you use a file manager to send a picture via email, the file manager calls the send activity within an email app, passes the file name to it and the email app sends the picture.. not the file manager. This will result in seeing the email app as "running" even though the user didn't actually launch that email app.
Smaller apps
Using activites helps developers design smaller apps. A file manager app that contains every bit of code needed to do everything a file manager does would likely be so large that no one would want to install it. Developers know that an android phone more than likely has an email app so there is no need for the developer to include email code in his/her file manager to send a picture when he/she can call an activity in an existing email app to do the job. This results in a smaller file manager app since there is no need to include email code or any other code for an activity that can be done via an app that is already present on the phone. This also alleviates redundant code. When you install an app outside of the android market, also known as sideloading, the file manager app calls the package installer (already present in Android) to install the requested app.
Running apps vs. cached apps
The "Manage Applications" list included in many android devices lists running apps as well as cached apps. Cached apps don't use any CPU or battery, they're cached so they will load faster the next time you need them. Killing cached apps results in those apps requiring more time to load the next time they are launched.
System management
By default, every android application runs in its own Linux process. Android starts the process when any of the application’s code (activities) needs to be executed, and shuts down the process when it’s no longer needed and system resources are required by other applications.
* Android is hard coded to automatically kill a task when more memory is needed.
* Android is hard coded to automatically kill a task when it’s done doing what it needs to do.
* Android is hard coded to automatically kill a task when you haven’t returned to it in a long time.
* Most services (while possibly running in the background) use very little memory when not actively doing something.
* A content provider is only doing something when there is a notification for it to give. Otherwise it uses very little memory.
* Killing a process when it isn’t ready only causes it to have to reload itself and start from scratch when it’s needed again.
* Because a task is likely running in the background for a reason, killing it will only cause it to re-spawn as soon as the activity that was using it looks for it again. And it will just have to start over again.
* Killing certain processes can have undesirable side effects. Not receiving text messages, alarms not going off, and force closes just to name a few.
* The only true way to prevent something from running at all on your phone would be to uninstall the .apk.
* Most applications will exit themselves if you get out of it by hitting “back” until it closes rather than hitting the “home” button. But even with hitting home, Android will eventually kill it once it’s been in the background for a while.
If you see an app running that you didn't launch, it's most likely because an activity within that app was called by another app to perform a task. If you kill the app you didn't launch, the system has to relaunch that app in order to complete its task. This is why some people kill a task and then see it immediately running again. Constantly killing that app creates a situation where the user is battling the system resulting in wasted system resources.
Android is Linux
Android is not a Windows-based OS, it is based on Linux. Many of the apps you think are running aren't actually running, they're cached, this is typical with a Linux operating system and is much more efficient than other systems. Cached apps don't use any CPU or battery, they're cached and will load faster the next time they're needed.
Let the system manage resources.
---
- Sent from my LG Optimus V using Tapatalk
Click to expand...
Click to collapse
Yes..I have noticed some side effects.alarms and what not. I guess ur right the only real way is to completely uninstall the apk ..would u happen to know why my adw launcher keeps forceclosing each time boot my nook? I am not running any icon packages..so what other source (or app) could be calling on it to run at startup?
StarlahRain said:
Yes..I have noticed some side effects.alarms and what not. I guess ur right the only real way is to completely uninstall the apk ..would u happen to know why my adw launcher keeps forceclosing each time boot my nook? I am not running any icon packages..so what other source (or app) could be calling on it to run at startup?
Click to expand...
Click to collapse
I am not familiar with adw. Is there an option to save it in memory I know that many replacement launchers do so you might want to make sure that is checked.
Also if you are using a task killer, it is probably trying to kill it and that could cause it to force close.
---
- Sent from my LG Optimus V using Tapatalk
StarlahRain said:
Yes..I have noticed some side effects.alarms and what not. I guess ur right the only real way is to completely uninstall the apk ..would u happen to know why my adw launcher keeps forceclosing each time boot my nook? I am not running any icon packages..so what other source (or app) could be calling on it to run at startup?
Click to expand...
Click to collapse
Do you have Titanium Backup installed? You can clear data and uninstall apps with that as well.
auto starts kills those apps... i run it on my NC>.......i dont need dialer /voicemail...etc.....
Just a thought but if you continue to have force close issues with apps, try running fix permissions. This usually ends the issues. I run adw ex and have no problems. Those few times I have had issues, fix permissions has solved the problem. Just sayin.....
Sent from my NookColor using Tapatalk
I know Windows 8's metro UI isn't the most popular thing regarding windows, but bear with me.
I really like the start screen and metro UI, especially after finding out it works wonderfully on a TV. In my particular case, I am in search of a way to exit a fullscreen desktop app to the start screen. I've searched around, however, since nobody really likes metro i cannot find any information regarding this (in fact, i get the opposite tips). The moment i mention metro or start screen in any searching, i get results regarding how to avoid said UI.
Is there any way to accomplish this? A prime example would things like emulators (dolphin, ppsspp, project64, etc) or regular PC games (Titanfall, Skyrim, any other windows game). I'm essentially trying to kill off the desktop (could also be interpreted as trying to do a Xbox One imitation), as this PC will be in the living room. I know there's things like Steam Big Picture, but i would like to avoid another UI on top of metro and to keep things consistent.
Any information would be highly appreciated. You guys on XDA have always helped whenever i needed it!
saviornova1203 said:
I know Windows 8's metro UI isn't the most popular thing regarding windows, but bear with me.
I really like the start screen and metro UI, especially after finding out it works wonderfully on a TV. In my particular case, I am in search of a way to exit a fullscreen desktop app to the start screen. I've searched around, however, since nobody really likes metro i cannot find any information regarding this (in fact, i get the opposite tips). The moment i mention metro or start screen in any searching, i get results regarding how to avoid said UI.
Is there any way to accomplish this? A prime example would things like emulators (dolphin, ppsspp, project64, etc) or regular PC games (Titanfall, Skyrim, any other windows game). I'm essentially trying to kill off the desktop (could also be interpreted as trying to do a Xbox One imitation), as this PC will be in the living room. I know there's things like Steam Big Picture, but i would like to avoid another UI on top of metro and to keep things consistent.
Any information would be highly appreciated. You guys on XDA have always helped whenever i needed it!
Click to expand...
Click to collapse
dont think you can other than what you mentioned with Steam big screen or little more extreme with SteamOS.
obviously pushing the windows button should take you straight to the start screen but that wont close any running apps or games. maybe map a keyboard button to act as a startscreen button and close any current running programs or apps. not sure how though
Create a little DOS batch program like this
Code:
@echo off
:: stop explorer
taskkill /IM explorer.exe /F > NUL 2>&1
:: start legacy application and wait until it has finished
start "" /wait "<fullpathname_of_your_program_goes_here>" "<program_arguments_goes_here>"
:: re-start explorer
explorer
:: done
exit /b
for each legacy app you want to be run
jwoegerbauer said:
Create a little DOS batch program like this
Code:
@echo off
:: stop explorer
taskkill /IM explorer.exe /F > NUL 2>&1
:: start legacy application and wait until it has finished
start "" /wait "<fullpathname_of_your_program_goes_here>" "<program_arguments_goes_here>"
:: re-start explorer
explorer
:: done
exit /b
for each legacy app you want to be run
Click to expand...
Click to collapse
Hmm, not sure why i would need to kill explorer, but i'll try it out (haven't tested a killed explorer from the start screen, only killed it from desktop). I'm not up to date on my CMD commands, but i don't see a way to bring the start screen back up after the command is finished in your script. I'll test out and see if i can improve it at all.
I should also note that some games that i am trying to launch are just shortcuts to the file (in PPSSPP's case, these would be CSO files, told windows to just launch PPSSPP when opening CSO's). Like i said i'll test and report back.
saviornova1203 said:
Hmm, not sure why i would need to kill explorer
Click to expand...
Click to collapse
The Metro interface (START screen) can only be accessed by manually starting explorer.exe.
And that's what I suggested you to do. Nothing else.
If you're using and AirMouse you can miss click on the top and bring up the bar with the x to close. You can take your air mouse cursor to the top of the screen mouseclick hold and drag all the way down and that'll take you back to the start screen but it only minimizes the app that you're using.
Edit: looks like you can just point mouse to the top so the clicking. Also if you take your cursor to the top right and pull down the side without a mouse click the charms bar come out
You want to open the Metro -Start Screen anytime any type of program completely closes? This is possible with a hook...let me know if I'm on the right track...maybe I can code a quick application for you.
Threw together a small C# program that will return to the Metro StartScreen on any application close event. Sits in tray - DoubleClick to exit.
https://app.box.com/metromombo
Let me know if you need any changes - it could be changed for just fullscreen applications.