[Q] How to permanently change the oom priority of apps? - General Questions and Answers

Is there developer or anybody out there that knows a developer who can create a script or app that allows users to permanently change the oom priority of applications. I have an app that I need to continue running because I use it all the time with my bluetooth headset, but when android kills them, then don't have the ability to detect that the bluetooth headset is still connected unless I disconnect and then connect the headset.

larry_thagr81 said:
Is there developer or anybody out there that knows a developer who can create a script or app that allows users to permanently change the oom priority of applications. I have an app that I need to continue running because I use it all the time with my bluetooth headset, but when android kills them, then don't have the ability to detect that the bluetooth headset is still connected unless I disconnect and then connect the headset.
Click to expand...
Click to collapse
Got this recommendation from Tonyp over at his ROM's thread for LG O2x
https://play.google.com/store/apps/details?id=com.lim.android.automemman&hl=en

The best choice for me is using Xposed Installer and App Settings module for it. In there you can find Resident option to keep app resident in memory.

Related

Automating bluetooth

Is there any way to automate the steps to go into the Bluetooth control panel and activating one of my Bluetooth devices to use for wireless stereo?
I have a Scosche BT box in my car so I can play audio through the car stereo. But every time I want to use it I have to switch to the BT panel, use the stylus to press and hold on the Scosche BT icon until the menu pops up then select Set as wireless stereo.
I believe the reason this does not work automatically is that I have multiple BT devices and only one of them will ever work automatically otherwise all your devices would be trying to get hold of the phones output.
Anyone have ideas on how to make this an easier process? Preferably one that would allow me to use Voice Command to activate it? An app specifically for this purpose or perhaps a macro recording app that hopefully would allow an icon for a specific set of commands to run rather than having to open the app then execute the macro?
TIA.
You can start with AutoA2DP, A2DP Toggle, several custom scripts on the MortScripts thread, but Auto ActiveSync will do this as well...
Friendly reminder... please use the Q&A forum for questions.

[Q] Use bluetooth headset mic instead of phone mic

I've searched around on the forums for an answer to this but could never find anything that seems to match up to my issue.
I have a A2DP enabled headset and want to use it with apps such as Team Speak 3 beta, Vent, and other apps. But for some reason although phone media happily plays over onto my headset. My phone continues to only use the mic built into the phone instead of the bluetooth headset mic.
Any apps designed to use the headset specifically work (ie. normal phone calls, skype, vlingo) but otherwise apps ignore the headset mic.
I already tried using apps like BT Mono and Super BT Mono Froyo but they seem to only pipe audio to the headset, but don't do anything at all with the headset mic.
Does anybody know how to get the headset mic to be selected by apps instead of just the built-in mic?
My device is a Sumsung Galaxy S II ( I9100 ). Both Stock and CyanogenMod Gingerbread
good good good
Still hoping someone may know how to get the Galaxy S II phone to use a bluetooth headset mic instead of the built-in mic on the phone.
I'm really stumped on how to do this.
I still haven't seemed to have any luck finding a way to forcefully map apps to use the headset mic. I'm beginning to wounder if it's possible with the Android OS.
I have the galaxy s2 as well and I've retired several different things and have been unsuccessful with anything I've tried so far... Really difficult to drive and use vent without a headset.
Yeah I'm wanting to do the same thing.. I don't spose you've found a way in the last couple of months? Surely it can be done - may need to get a dev to write something for it though..
Sorry Lilfellabob, still no luck. I find it odd it's so difficulty to remap audio settings.
Even in Ice Cream Sandwich I can't find a way.
The app would need to be written to accept it. Its not a matter of your phone. Its the apps. Think about it for a min. If it works on apps made to use it but another app doesn't work then where does the problem lay?
The thing is, typically other apps should be able to re-route the app to use the headset mic. Alike how there are apps that can force other apps to use bluetooth audio instead of the phone speaker, even if the phone/headset can't use a2dp.
Dav_Edward said:
The thing is, typically other apps should be able to re-route the app to use the headset mic. Alike how there are apps that can force other apps to use bluetooth audio instead of the phone speaker, even if the phone/headset can't use a2dp.
Click to expand...
Click to collapse
Only if the code is there for it to do it. If they don't code it in then it doesn't work.
I'm having a similar problem but slightly the opposite.
I pair my phone to a Bluetooth device that lets me hear phone output on my car's speakers. However, the phone tries to use Bluetooth for the microphone when none exists. I want to force it to use the on-phone microphone. I can talk and talk but no one can hear me, unless I set the phone output to speaker or handset, which implies setting the phone input to amplified built-in mic, or just built-in mic, respectively.
In the Bluetooth settings I can set to use the Bluetooth device for music or phone, but ideally I would want "Phone" to be separated into "Phone output" and "Phone input" so I could uncheck input (and thus use the built-in mic.) This should be implemented at the Android level so that the setting can apply to all apps.
The same problem occured when I wired (2-stripe phone-to-car audio only, no mic) my Palm Pre directly to my car. I just tried with my GNex and it was smart enough to use the built-in mic when a microphone-less plug was connected.
zelendel said:
Only if the code is there for it to do it. If they don't code it in then it doesn't work.
Click to expand...
Click to collapse
wrong. its in the kernel. the new firmware on the android is is capable to transmit Audio Steam to Headset device as Audio only. i wont go 100% against coding to force it to but if they wanted to theres have to be some kind of exploit to do so. lets say if skype were to find that exploit or code it, it would be probably violate android policy.
HtcEvo4gLTE said:
wrong. its in the kernel. the new firmware on the android is is capable to transmit Audio Steam to Headset device as Audio only. i wont go 100% against coding to force it to but if they wanted to theres have to be some kind of exploit to do so. lets say if skype were to find that exploit or code it, it would be probably violate android policy.
Click to expand...
Click to collapse
Actually, what's going on is Skype is using the 'bluetooth device' hook of some sort, just like other apps that support piping audio to the bluetooth headset. However most apps don't use the bluetooth device API/hook and just dumbly send their audio to 'default output device' and 'default input device' blindly and let the OS or Kernel decide where to send it.
The OS or Kernel when it senses a bluetooth device with the 'media' profile on it is present, it changes the default output device to the headset, but it doesn't seem to bother doing the same for the bluetooth mic for the default input device.
Because apps like Teamspeak 3 just blindly use default audio device because it doesn't use bluetooth APIs in the app itself, I have no way to make it use the headset mic.
I wish someone could make a mod or app that will allow mapping the default input to a bluetooth mic when present.
As far as I know, Skype has problems using the BT mike as well. In fact, they took a user survey regarding the issue for android and iOS users. However, I cannot find the results of that survey / study, and Skype recommendations thereof.
User choice to use BT mike seems so BASIC to me, I wonder how it was overlooked...!
Rooting will crack open the full power of your Android device!
Dav_Edward said:
Sorry Lilfellabob, still no luck. I find it odd it's so difficulty to remap audio settings.
Even in Ice Cream Sandwich I can't find a way.
Click to expand...
Click to collapse
zelendel said:
The app would need to be written to accept it. Its not a matter of your phone. Its the apps. Think about it for a min. If it works on apps made to use it but another app doesn't work then where does the problem lay?
Click to expand...
Click to collapse
Rooting the device would give apps or the user permissions to modify system audio controller's (idk if it is anything like ALSA or anything..) settings to make app use the audio channel for the bluetooth headset... an example for the Galaxy s2 i9100 i have is the radio app "Sprit FM" has a "volume control stream" setting which allows the user to select what volume "control" will control the volume of the app's audio output
anywho... i hope it helps a little
rwong48, I have now the same problem that you have described. Have you solved it with any app for Andorid?
Thanks!
Solution
I found an app that solves this problem on android devices, it's called btmono and you can find it in the Google store. I tried to post the link but I don't have enough posts under my belt...
Anyways, pair your device, open the program (such as ts3), connect to your server and then turn on btmono. Voila!
Well, I tried to delete this after I saw that you had already tried btmono, but I couldn't figure out how so just disregard this message.
I already tried btmono, sadly although it works for the output audio, it does *not* work with the headset mic. Programs like TS3 will still keep using the phone's built-in mic, not the headset mine despite using btmono. The only thing btmono does is pipe the output audio to the headset only.
Thanks for the suggestion though
I can't believe they haven't fixed that yet. It is so basic...
Hey guys I'm going through the same issues with my note 2. Svoice was the only one that works but its painfully slow and inaccurate.
Anyways I've tried utter! robin and aivc. Aivc works pretty good but at least it uses the mic.
Utter is really promising but no Bluetooth mic. The devs have acknowledged it though. So hopefully soon.
Update: AIVC has one downfall. The app can't open if the screen is locked like utter and svoice can when prompted from bluetooth. Also, it only listens automatically the first time. If you close it without killing the app, you'll have to press the mic icon manually every time (which takes away from the purpose of handsfree).

One click - Connect 2 Specific Bluetooth device for A2DP and Phone app

An amazing One click - Connect 2 Specific Bluetooth device for A2DP and Phone app:
Bluetooth Pair
https://play.google.com/store/apps/details?id=com.gnssoftworks.bluetoothpair
found it very useful for swapping bluetooth headphones between devices WITHOUT turning off Bluetooth entirely or going into the settings menu.
Example Use Case:
I have one Stereo Bluetooth headset with mic (two profiles - phone and A2DP audio)
I have one Android Phone and one Android Tablet.
Phone Profile is always connected to the Android Phone, but the A2DP audio changes depending on which device you want to listen to music from.
Normally, if you want to listen to audio from the Tablet when your headset's A2DP profile is connected to the phone, you'd have to first go to the settings menu of the phone, and disconnect the A2DP, leaving Phone Profile connected. Then go to the settings menu on your tablet and connect the A2DP only.
Then you'd have to do the opposite if you want to listen to audio from the Phone again.
Takes a long time.
With Bluetooth Pair, you can specifically connect or disconnect to a specific device and specific profile (phone / a2dp) by widgets.
So you won't have to turn off the bluetooth completely on one device just to allow your headset to connect another device. Nor do you need to go into settings anymore.
1.) Just tap on the A2DP device specific widget on the phone to disconnect, the A2DP Profile from the phone
2.) go to the Tablet, and tap on the A2DP device specific widget to connect the A2DP profile of the headset to the Tablet
Two taps!
Would you mind sharing a code snippet on how you achieve this? I've been working on a little program that I intend to use around the house and this is the missing piece that I can't figure out. Basically, I have some NFC tags spread around the house and a receiver app that triggers various actions. One of them enables bluetooth on my device (if off), turns on my home audio receiver (over telnet), connects to the receiver's A2DP device (this is the missing piece), and launches a music app.
I've seen examples where this works using an AIDL method, but from what I've gathered this no longer works under Android 4.2. Does your app work on 4.2? Any hints you can provide?
Thanks!
Brian
I'm not the writer of this app.
You could try contacting them via the email listed on Google Play.
BTW, while you're making your app, please dedicate a thread to it on XDA so we can all beta test and buy it later!
klau1 said:
I'm not the writer of this app.
You could try contacting them via the email listed on Google Play.
BTW, while you're making your app, please dedicate a thread to it on XDA so we can all beta test and buy it later!
Click to expand...
Click to collapse
Oh, OK. I just assumed this was your app.
After reading the Play Store description more carefully, I don't think this app actually does what I'm trying to do (programmatically establish an A2DP connection). It appears this app enables / disables certain profiles but the actual connection is still handled by the OS.
As far as the app I'm making, I was intending it to just be something for personal use. I'm planning on keeping it very lightweight and tailored specifically to my needs. For it to be used by anyone else they would have to have the same brand of A/V receiver as me (Pioneer) that supports the same telnet commands. Most of the rest of the functionality of the app can be duplicated by using some of the existing NFC apps like NFC Task Launcher. If I ever develop it into something interesting that could be used by a wider audience I probably will post it on XDA for feedback though.

[TUTORIAL] How to use Gear 2 (Neo) in harmony with other Bluetooth devices

When I bought Gear 2 Neo a week and a half ago, I immediately faced the following issue: how the hell I keep using my Bluetooth earpiece for conducting phone calls? As cool as it looks talking to the Gear, it's not as convenient as wearing an earpiece, and I've been using those for the last 12 years. This new annoyance combined with an old one: when I'm in the car, I want my phone to automatically switch to the car in-built Bluetooth audio, both for phone calls and for media. I don't want to do this manually! And now, with the Gear, just think of the possibility of talking to the watch while driving the car!
Now, the Samsung phone owners have the luxury of being able to switch to the earpiece after picking up the call on the Gear. Not ideal, but workable. Still puzzles me though if you're able to choose a specific Bluetooth phone audio device if you have more than one (e.g. as with the earpiece and the car example). But we, the non-Samsung owners, don't even have this option. So finding a solution was due!
So, here are my use cases:
When I'm not in the car, I'd like the phone to be connected to the Gear all the time while not in the call. This makes sure I get all the notifications etc.
When not in the car and I'm engaged in a call, I'd like Bluetooth phone audio to switch to my earpiece as soon as possible. This automatically disconnects the Gear, meaning I'm no longer able to receive notifications on it. But this is not an issue, as, when I'm on the phone, I prefer not to be distracted anyway. At the end of the call I want Bluetooth audio to reconnect back to the Gear.
When I'm in the car, I'd like my phone to connect to the built-in Bluetooth phone and audio. I would like to stay it like this for as long as my car audio system is on. This means I won't receive any notifications on the Gear, but I reckon this is rather good while driving. When my car audio is off, I'd like the phone to automatically reconnect back to the Gear.
There are two pieces of software that helped me with achieving this:
Tasker. It's not free, but is worth every cent you spend on it. What's more, you can download a 7-day free trial to play with this guide before you commit to buying it.
Secure settings. All the functionality you need for this guide is included in the free version.
My triggers are:
Phone ringing or off hook and not in the car: connect to the earpiece
Phone idle and not in the car: connect to the Gear
Car application is launched (happens automatically when I plug my HTC One M8 into its car holder): toggle car mode on, which, in turn, connects to the car Bluetooth
Power disconnected (which is what happens when I turn car engine off or pull the phone from the car holder) and the car mode was on: toggle car mode off
Car mode switched off: connect to the Gear
Device boot: connect to the Gear
Now, you can import the attached file into Tasker on your phone and give it a go. You will need to go and replace the device MAC addresses and names with YOUR devices first (in Secure Settings configuration for each and every relevant task).
If you don't have in-car Bluetooth, just disable the corresponding profiles.
Now, there are some things that need improvement:
Right now I can't answer the calls on the Gear even if I want (e.g. if I forgot my earpiece at home or if it's out of battery). The reason for this is the way Secure Settings plugin performs BT Connect action: it disconnects the currently connected device first and only then tries connecting the other device. Also, there is no way to figure out if this connection was successful or not. I'm thinking of implementing a special toggle that will disable automatic earpiece connection on user request.
One scenario that is not properly implemented yet is switching from in-car BT to the earpiece while in the call (e.g. when you arrive at your destination while talking on the phone and want to live the car without disconnecting the call). Right now this requires manual intervention.
Unfortunately, Bluetooth connectivity of many devices is still quite buggy. I often find that, despite the fact the phone shows it's connected to the device, the audio is not going through. Or the device doesn't think it's connected (both happen quite often with my in-car BT). Usually, what helps in this situations is resetting Bluetooth on the phone or on the device or on both. I'm thinking of adding BT off/on action before any device switch just to improve reliability. However, sometimes the device needs to be reset, which may be easy (e.g. turning the earpiece off and on) or not (you can't turn the in-car BT off without stopping the engine).
That's all for now. Feedback is appreciated!
Great add thank you!
Y
Sent from my SAMSUNG-SM-N900A using XDA-FORUM, powered by appyet.com
I'm having difficulty opening your file below. Do you open it using tasked, open via file explorer and edit or open via service manager. I also have the m8 and appreciate all the work you've done. I'm fairly new to tasked so figured it would be easier to change your file and then load it.
kartch said:
I'm having difficulty opening your file below. Do you open it using tasked, open via file explorer and edit or open via service manager. I also have the m8 and appreciate all the work you've done. I'm fairly new to tasked so figured it would be easier to change your file and then load it.
Click to expand...
Click to collapse
I have appradio 2. Is there a way to modify this to always disconnect the gear and connect the car radio when I plug in USB from the radio?
You can also accomplish all this with LLama profiles which is a free application
I ended up making my own. Was better as now I have some working knowledge of tasker and secure settings. I dont have Bluetooth in my car so was a little easier.
One thing I did add was a 5 second wait/delay so I can still look at who is calling on the watch, decide if i want to answer or reject from the watch and then if I do answer it automatically disconnects the Gear and allows you to talk through the phone or earpiece.
Thats my only addition as it maintains some function of the watch to allow screening of calls without pulling phone from pocket.
There is a bluetooth setting if you'll only use it for media or phone calls or both )
Just sayin
Proud to Be PINOY
Follow us on twitter @BuhayKolehiyo and @pinoulyKaKung
Sent from my Galaxy Note 3
mjpineda94 said:
There is a bluetooth setting if you'll only use it for media or phone calls or both )
Just sayin
Proud to Be PINOY
Follow us on twitter @BuhayKolehiyo and @pinoulyKaKung
Sent from my Galaxy Note 3
Click to expand...
Click to collapse
How exactly this helps (or is even related to) the issue at hand?
mpogr said:
How exactly this helps (or is even related to) the issue at hand?
Click to expand...
Click to collapse
because instead of disconnecting and reconnecting your watch you can leave it on and choose another device for voice calls and or notifications
mjpineda94 said:
because instead of disconnecting and reconnecting your watch you can leave it on and choose another device for voice calls and or notifications
Click to expand...
Click to collapse
The problem is the phone can have only one device connected to it using phone headset profile and it won't use any other profile (e.g. multimedia) for making calls.
Sent from my GT-I9505 using Tapatalk
Thanks ! Help me alot!
Nc
I need some resolve to me after the call is automatically disconnected BT Handset Gear2 but have remained constantly connected. Do with Timo anyone have experience? Thank you.
I solved this by using an nfc tag as a switcher! I bought an Nfc tag for just 25cents and I wrote on it with the free app Trigger... When I get in the car I swipe the phone on the nfc tag and it connects to the car BT and when I swipe the phone again it switches back to the gear!
Inviato dal mio GT-I9300
mjpineda94 said:
There is a bluetooth setting if you'll only use it for media or phone calls or both )
Just sayin
Proud to Be PINOY
Follow us on twitter @BuhayKolehiyo and @pinoulyKaKung
Sent from my Galaxy Note 3
Click to expand...
Click to collapse
How do you get to that setting? The only option (I have it connected to an M8) is phone audio
longshot201 said:
How do you get to that setting? The only option (I have it connected to an M8) is phone audio
Click to expand...
Click to collapse
It doesnt work
you need NFC , Task or Llama
NRGZ28 said:
You can also accomplish all this with LLama profiles which is a free application
Click to expand...
Click to collapse
[EDIT]
Hi,
I'm trying with Llama, can you give me some help?
I add a new condition "ringing", but I don't understand the related action. Per my understanding I need to disconnect the GEAR, but I cannot find the specific action.
Ok, I understand that is needed Secure Setttings, but I still not able to do what I need: when the action is executed, I need to disconnect gear...
Ok, now everything is OK.
Just to clarify for who is not able to import che xml for Tasker or just want to use Llama that is free.
It is necessary to install "Secure Settings" and to create a Local Plugin Action, involving Secure Settings.
In Secure Settings, selecting the BT connect/disconnect action, it is possible to select from a list of paired device on which of them perform the "connect/disconnect" action
Thanks a lot.

how do you stop music player from launching on every bluetooth connect?

Every time I connect A2DP in my car it launches the music app. Can't find anywhere to disable this annoying behavior.
It might be under the app Smart Connect.
no, those are things you set up. I have no actions set for such behavior.
I don't think it's the phone that take this decision. I think it's rather the bluetooth device that send the "play music" command that open the music app on the phone.
its not Sony, i dont have such issue with my BT devices, including one that is a BT speaker. If you claim its not smart connect, you might want to check other apps similar to smart connect or the BT device/'s app. If possible, also clear the BT device's app data or at least reinstall it.
if you cannot identify the root of the problem i would advise you to do a fresh start for the phone. do a comparison with the BT device's app and without the app.

Categories

Resources