Greetings!
I'm trying to determine if I can find a workaround for the Music related issue (with the Equalizer bug) that i've experienced, and documented at length in another thread in this forum, also documented in a different thread with more people impacted. I had a bit of a Eureka moment the other day, in that the resolution (that has very reliably worked), has been to hit Pause and then Play again, to turn the Equalizer back on.
My thought was: Can I set up a Tasker (or similar app) profile to accomplish this automatically? I'm not at all experienced with Tasker so this is very much a 'please hold my hand' kind of post. I want to learn, as I want to resolve this, and maybe this will help others with the same issue. After fumbling around a bit in the app, i'm not sure how to proceed or accomplish this.
Here's what I want Tasker to do:
1. If Google Music is Open
2. If Track change has happened
2a. Then Pause
2b. Then Play
3. Return to 1
If this can be accomplished in an extremely small amount of time, as I imagine Tasker could, then i'd be fine with it doing it at the beginning of every new track. I'm also entirely fine with being a guinea pig to make sure it works, I just need to know if this is even possible, and then thoughts on how best to accomplish it. Any assistance would be greatly appreciated.
Related
I could use some help with an app I'm working on. I need to know how to control the views and work with which things are in focus. I also want it to work even while in the background so using a handler or something else is knowledge I could use help with. I've been sifting through the javadoc and multiple other forums and am pretty much stuck. Anyone with decent knowledge that would be willing to help me out should message me. Thanks in advance.
First I would move this to the Android dev forum
Android uses Intents to display and run processes. Activities are Intents (views)that you can actually see on the screen and Services are Intents that can be run in the background.
Starting on the Android dev site is really the best place to find the answers to the problems.
That and using the Android examples that come with the SDK. Good luck and I hope you were talking about Android! XD
I was talking about android so here's what i'm trying to do. I want to take in trackball movements and pretty much make it so they don't affect my program or others. I'm not sure how to make it so that requestFocus() will take whatever view is currently on the screen, capture it, and pretty much revert right back to it if the trackball is used. I've tried a lot of different things, but I have been stuck on this forever. Anyone know how to accomplish this because for the most part I think that the trackball is not documented all that well. Any suggestions would be great!
I would look at the http://developer.android.com/guide/topics/ui/ui-events.html , onTrackballEvent(MotionEvent) . You should be able to override that in your service, and just process the motion however you want and not call super.onTrackballEvent();
The problem is that although onTrackBall does captures events, it does not capture all of them. In the docs it says that the method will handle all events not already handled by a view. So I guess my question overall is how do you do just that? Take in every trackball movement no matter what view is reading it? Whether it be another app or anything else. How would I capture the remaining movements?
So after a bit more research here's what I've come up with for what I need to do. Either access the event queue or make it so any time the trackball is used, whether on the homescreen or something else, my application will be able to take these events and manipulate then as i need to. So anyone willing to help with this? I figure I need to make a thread, but how do I get it to read in other applications readings? Is this even possible?
I have a Galaxy Tab GT-P1000 running Overcome 3.3.1. On occasion, when all else seems quiet, the device will suddenly decide to play the /system/media/audio/notifications/12_Tweeters.ogg sound file (sounds something like a bird chirp), and I would like to find the application that causes this sound file to be played. I ran the Log Collector app (v1.1.0) and poured through its output, and that is how I determined which file is being played,
In the latest instance, the log shows:
09-06 08:40:24.230 I/MediaPlayer( 306): The actual path is:/system/media/audio/notifications/12_Tweeters.ogg.
Before that, I can see references to (306) like "KeyguardViewMediator in the same second. In fact, there are hundreds of references to 306 within parentheses, mostly around Sensors and PowerManagerService BatteryService But I don't see a way to trace back to the originator. (Frankly, I also don't have any indication that the '306' is important.)
How would I go about finding the reason that MediaPlayer was kicked off in the first place? (My goal is to find the application that suddenly decides to play this sound file, and to understand why it does so. After all, I'm being notified of something, right? Wouldn't it be swell to understand the reason for the notification, instead of just "Hey!" ?)
I've searched for general information on how to figure out what the Log is trying to tell me, but to no avail for something like this. Is there enough information in the typical Log Collector output to determine this information? If so, where can I read up on how to trace this? If not, then what might I do to trap/identify this?
I appreciate any pointers you may have on this.
This is some hobby project i want to accomplish with, i have decent experience in programming java. But after quite a lot searching around and asking professors and anyone with experience in android development i got no clear vision of how this is accomplishable. The thing is, i want to develop an application that runs for a given amount of time(there´s a timer the user sets), during this given time certain applications will be blocked(or rather killed, or intents changed so they won´t even start to run). This selection will be done from a list given of third party applications installed.
As mentioned, ive searched everywhere i can, and the only leads i could ever find was the following:
1. Have continous check which kills the given application if it detects the specific applications running and will kill it. Downfall of this will be cpu-usage, optimalization and battery use. And also the device has to be rooted.
2. Have an alternative launcher, somehow this should help me a bit on the way to accomplish my goal. But here i sit thinking: Will i need to develop my own launcher to be able to succeed?
Nothing pointed me in any direction whether there are some native methods or similar in the android that perform similar tasks and how to implement it at all. Those who are saying there are plenty of applications our there similarly: No, they give you choices like block apps with a password and similar which is not what i´m after. I need some application that blocks it for the given time it´s set to(even though it is possible to go on your own in task manager and kill this application i want to develop, but that is out of the scope for now). This is to increase productivity without reaching for your cellphone all the time(yes, it might sound silly, but i´m quite sure it will help.
Any help is greatly appreciated as i´ve researched for over a month without any success.
Bring up your activity no matter which app starts. Make it a transparent activity and kill it as soon as it starts.
I can not publish any code or any logs, because there is no real problem yet. I am a beginner in Android / Java and the OOP concept.
I need to run two processes at exactly the same time in my program. The processes are sound samples and requires played at exactly the same time to be synchronized with each other.
I call the methods on the lines one after the other, which gives me a delay when the first clip starts a few microseconds before. Depending on the hardware this delay will also vary enormously .. how do i run the commands, or call the methods exactly the same time?
I've been looking at adding a delay of the first method by a handler, but I do not want to do this but it does not guarantee accurate synchronization.
I am on track to use AsyncTask, and somehow run these processes simultaneously but in different threads ... I have no idea if I'm on the right track? Can anyone confirm that this is the right way, or provide information about what else I can do? Grateful for all the help I can get. I hope I have not used the wrong terms and that I have given you enough information so that you can understand my question. Thanks in advance.
Having two functions tied to the same event has worked for me in the past.
For example, if you have a play button and you set up two separate functions to run when that button is clicked, they should go at the exact same time. If your play button is pressed, it will fire both functions simultaneously.
Another more advanced approach would be to return the current time code of "sound a" and pause it until the time code of "sound b" reaches the current time of "sound a".
Im Saint said:
Having two functions tied to the same event has worked for me in the past.
For example, if you have a play button and you set up two separate functions to run when that button is clicked, they should go at the exact same time. If your play button is pressed, it will fire both functions simultaneously.
Another more advanced approach would be to return the current time code of "sound a" and pause it until the time code of "sound b" reaches the current time of "sound a".
Click to expand...
Click to collapse
Well "simultaneously" is a big word but you are right, even if one player lags behind the other one, we are talking about microseconds at most. And i doubt that anybody would even notice that.
And to OP:
In java there is a keyword called "synchronized" where one thread awaits the other. I have never used that and so i dont know how to use this. Maybe if you look it up on google it could prove useful to your project. But i actually dont think that you can technically accomplish this "true" synchronization you are thinking of... It is worth a try at least
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Have you considered buffering? you can buffer samples in some queue and start playing them after a decided delay / samples count, making sure you have samples from all the sources you need to synchronize
Thanks for the replies, any help is much appreciated!
Im Saint said:
Having two functions tied to the same event has worked for me in the past.
For example, if you have a play button and you set up two separate functions to run when that button is clicked, they should go at the exact same time. If your play button is pressed, it will fire both functions simultaneously.
Another more advanced approach would be to return the current time code of "sound a" and pause it until the time code of "sound b" reaches the current time of "sound a".
Click to expand...
Click to collapse
Good to hear, but can it be guaranteed that the function calls are performed exactly the same time? This is very necessary for various reasons.
Masrepus said:
Well "simultaneously" is a big word but you are right, even if one player lags behind the other one, we are talking about microseconds at most. And i doubt that anybody would even notice that.
And to OP:
In java there is a keyword called "synchronized" where one thread awaits the other. I have never used that and so i dont know how to use this. Maybe if you look it up on google it could prove useful to your project. But i actually dont think that you can technically accomplish this "true" synchronization you are thinking of... It is worth a try at least
Click to expand...
Click to collapse
This is what I also want to emphasize. With the greatness of the inner meaning of "simultaneousness", even if that someone would not notice anything, it's a necessity.
I will seriously undermine further the keyword synchronized. This sounds exactly like what I need. I will succeed and reconnect with the results!
pixeltech.dev said:
Have you considered buffering? you can buffer samples in some queue and start playing them after a decided delay / samples count, making sure you have samples from all the sources you need to synchronize
Click to expand...
Click to collapse
I have heard the word buffer before but never truly understood how it works syntactically, nor in Android / Java.
With what kind of content can this be done? All types of media, audio / picture / video? Do you have any keyword to search on or link to an example?
Invisible Algorithm said:
Thanks for the replies, any help is much appreciated!
I have heard the word buffer before but never truly understood how it works syntactically, nor in Android / Java.
With what kind of content can this be done? All types of media, audio / picture / video? Do you have any keyword to search on or link to an example?
Click to expand...
Click to collapse
Buffering is a technique where you first collect enough data (can be represented in any form but is usually done through collections) and once you have enough data you do something with it.
An example can be reading data in bytes form from one source (e.g. network channel), buffering it (storing it in some collection) and writing it to files when buffered data reaches some threshold size
Finding little information on this, i'd like to be able to use tasker to trigger things such as notifications or audio on the watch or send events to my phone, and preferable some mor eadvanced things so i can use the watch with my home automation, has anyone played around with this? i saw someone mention side loading apps somewhere but i lost the post, as i understand it LiteOS is a version of android so being able to load Tasker directly onto the watch would be nice.