How does the Android Lock Screen Camera work - android

In Android 4.2 new lock screen widget have been introduced. They can be accessed by sliding left or right on the lock screen.
One of those widgets is a camera widget — only this camera widget is behaving differently from any other widget – lock screen or otherwise.
Once you slide to it the widget zoom to full screen and from that onwards behalves like an App. The lock screen camera has rich controls which would be close to impossible to implement using the confines of android.widget.RemoteViews.
Here my two questions:
How does this actually work?
Can it be replicated by normal applications (or is it a feature only available to system applications)?

Related

How to lock the orientation of the content of activity or surface in Camera app without locking the system orientation change?

I'm trying to implement orientation change in an app with a camera.
Currently most of the Camera apps do not support device orientation. Most of them lock screen orientation in portrait mode and rotate some UI elements inside by implementing OrientationListener. But with this approach, there are problems with the system behavior: keyboard and navigation gestures remain in portrait mode, which confuses users.
However, I see completely different behavior in the latest version of the default Camera app on Samsung devices. Device orientation is no longer blocked. But the camera surface does not show any signs of orientation change.
In every camera implementation I've tried, even at best you can see some flickering on orientation changes.
My guess is that for the Samsung camera app they managed to lock the orientation of the activity content or surface without locking the system orientation change.
My question is how to achieve this behaviour?

Android AR Sceneform device orientation change

I'm working on an app that has a Single Activity and a fullscreen Fragment in that activity that uses AR Core and inherits from Sceneform. What is a good strategy for handling orientation with AR elements? It seems that most Google produced applications that user AR (Camera Playground, Maps, Arts and Culture) lock the view to portrait when in an AR session. However, we want users to be able to interact with the view when tilted to landscape as well. That would be fine to still have it locked to portrait and the user could just tilt their phone except for the issue with Android 10 gesture navigations. If a user orients their phone in landscape (while the activity is locked to portrait), a swipe from the top of the screen (which would appear to bring up the status bar) would send an onBackPressed() which would be a big UX issue.
Have others faced this issue before? Is it possible to programmatically remove the gesture navigations? Or move them without a full config change?

Can a mobile app blur the screen?

Is it possible a mobile app working like a background process to blur or fade the screen of the smartphone, no matter what active app is being displayed? Does the android and ios APIs expose such features?
Definitely not on Android. There are accessibility services which do modify the screen regardless of which app is visible but those are mostly first party applications. It would be a pretty big security risk issue if apps could block/blur the screen of other apps.
That being said you can create an overlay which lets touches through. I'm not sure if you can get the actual pixels of the UI behind the overlay and run a blur yourself but you can draw over top of elements on the screen (using accessibility APIs you can get the positions of UI elements) which may suit your needs depending on what exactly you're trying to achieve.

Preventing Unity on Android Detecting User Input on Splash Screen?

When my Unity app starts up in Android on an older device I get a momentary black screen, then the splash screen and then another momentary black screen.
The problem is that the app is receiving user input during the second momentary black screen (before the user can actual see anything). I think Unity thinks that the initial Scene is displayed (but it hasn't been).
Is there a good way to prevent this initial input from registering?
You can try adding one more splash screen which can act as Loading screen and load the next level from it using
LoadLevelAsync
this way u will not have the issue of that black screen taking the input.

Altering the global/master UI from a background app in android

Is it possible for an android app to run in the background, listen to specific triggers and modify the visible application content in the screen (in both system and third party apps)?
For an example, A 2 finger tap should lead to a ripple effect on the screen. If the temperature is high, The screen turns more reddish. If I say "do a barrel roll", The entire UI does a "barrel-roll" like the google Easter egg. And this should happen whether the user is in the homescreen, settings or his Instagram.
The best working example I can give is the built-in "Magnification Gesture" provided by Android. Three taps anywhere will zoom everything up except for the keyboard and the navigation bar. And it doesn't zoom as an image, the touch points are preserved.
Is this possible to do without or with root? Do I need a framework like Xposed?
Thanks.

Categories

Resources