I am currently in the process of creating an MP3 player. In particular, the main mode of user input is in the form of (touchscreen) gestural input. I would like to add the functionality allowing users to continue interacting with the MP3 player when the screen is locked. That is, how can I get the device (A Galaxy S3 in particular if it's worth mentioning) to recognise gestures in the lock screen and "parse" them to the MP3 player?
Note: by "locked" I mean when one can see the lock screen (i.e. not when the screen is turned off).
How would I go about doing this?
Thanks in advance.
The recommended way is to make Lock Screen Widgets. These are widgets that allow you to interact with apps in the lockscreen such as the Google Play Music app.
Check out the official tutorial here:
http://developer.android.com/guide/topics/appwidgets/index.html#lockscreen
Related
I want to disable only screen recording in my flutter app. I used flutter_window_manager package but it disables both screen recording and screenshot.
I don't see any option in flutter_window_manager that would allow to distinguish between screen recording and screenshots. The underlying Android functionality also behaves the same, that is screenshot&recording aren't allowed see Android FLAG_SECURE
Just out of curiosity: How come you allow screen shots but not screen recording?
I want to create an Android application that interacts with the user when the phone is locked
For example the Sony Xperia U (android 4.something) the default mp3 player displays in the lock screen, above the pattern, the name of the song and buttons play, pause, next. In Huawei P8 lite the player displays the aforementioned buttons + the background picture album in an separate screen when you press the power button, and when you slide, it shows the pattern.
I want to do something similar, to display messages from the application to the user, who can press buttons to interact with the application when the phone is locked.
Can this be done without creating new lock screen; (I'm afraid I will do something stupid and lock myself out)
If yes, what activities / permissions / libraries etc should be used;
i have a few questions, to which i haven't found answers till now, despite searching the forum and much of googling.
On thing first, i'm developing for android gingerbread, so newer/not all functions are available.
Is it somehow possible to force the lock screen to redraw/update?
Can i somehow manipulate the built-in media controls on the lock screen, which appear when i'm playing music, through a function/an intent or something? For example that the media controls show the pause state (only the play button is shown) instead of showing the play state (3 buttons are shown). Because i'm developing for gingerbread, i cannot use the RemoteControlClient.
Can i somehow dynamically disable/unregister the appearance of the media controls on the lock screen through code? The media controls on the lock screen shall not be shown despite playing music.
EDIT
Upon the answer of CommonsWare, for the second and third question, i use a cyanogen mod rom, so the media controls are comming from cyanogen.
Is it somehow possible to force the lock screen to redraw/update?
Not really.
Can i somehow manipulate the built-in media controls on the lock screen
Can i somehow dynamically disable/unregister the appearance of the media controls on the lock screen through code?
There are no "built-in media controls on the lock screen" in Android 2.3. Certain devices from certain device manufacturers may have extended their lockscreens support media controls, in which case you would have to ask your questions of those device manufacturers.
I want to play sound in android whenever user touches the screen irrespective of which app they are in. Like making it the UI touch sound. so that my app keeps running in the background and playing sound whenever user interacts with screen. where do i the code? what to write? pls help. This is for android. And i'm using eclipse.
This is not possible.
Android does not allow you to intercept touch events on the screen when outside your own app as this would allow malicious apps to take over all other apps and render the phone useless.
Furthermore, it would very quickly get annoying for the users, particularly if they're playing a game or something that requires a lot of touch events taking place.
I'm afraid it's impossible. You can intercept touch events only in your Activity.
Similar questions had been already asked
https://groups.google.com/forum/?fromgroups=#!topic/android-beginners/H45Xwm43NGQ
Does Android have the software capabilities to, if a phone has video-out, to open or push content solely to the video out.
So for example if the user is in and clicks on a YouTube link, the app, instead of opening the content on the main screen over the app it would push it to the video out so the YouTube video would display on their connect display and they could continue to browse.
I know Motorola's have the WebTop software and this idea is similar to what I am trying to accomplish but on a much more basic level. It's more similar to Apples AirPlay but much less complex again (without a network/external player - just video out).
Or if even that is to complex an even simpler solution of having the video-out still output even when the phone is locked. Currently the video-out mirroring on both my HTC Incredible and Galaxy Nexus will stop when the phone is locked.
EDIT:
I've noticed while using my phone that playing a video through the Google Videos app that on the phone controls will overlay on the screen i.e. play, pause, seek bar, and, the soft buttons, but the video-out display (Television) plays the video continuously/seamlessly without any of the controls over-layed. Now this is very primitive example of what i'm ultimately alluding too but it does show a real world example of an android device (no 3rd party manufacture software) doing video out that isn't exactly mirroring.
Well... I hate to furnish this as an answer, but it really looks like there's simply nothing in the API for it at all...
http://groups.google.com/group/android-developers/browse_thread/thread/9e3bcd1eea2c379
which just redirects to:
https://groups.google.com/forum/#!topic/android-developers/Jxp_9ZtzL60
I'm definitely going to favorite this question, and hope someone chimes in with something more useful than a "doesn't look like it's possible, though that does appear to be the correct answer, at this time.
Much like Dr.Dredel has mentioned, there is nothing current for multiple displays in terms of display 1 showing 'A' and display 2 showing 'B'
There is support for multiple screen sizes per the following:
http://developer.android.com/guide/practices/screens_support.html#support
This will be the case for a little while longer until someone creates the support for it.