How do I control the SmartLocks blue banner? - android

When the user starts the app, I'm able to retrieve a previously stored credential. When this happens, the blue SmartLock banner shows up. On the app I work on, this is covering a FAB making it unusable until the blue banner goes away. Is there a way to control the length of time the banner is shown? Additionally, is there a way to let the FAB move up like it would with a snackbar showing?
Lastly, if the user exits the app as the banner is showing, it will continue to show on the phone home screen, blocking any use of the bottom app bar. Is there a way to prevent this?

The auto sign-in banner is shown by Play Services and drawn over the app. The intent is to notify the user that their saved credentials have been retrieved and avoid app inadvertently not displaying or displaying the notification at an incongruous time or place.
Right now, there is not much flexibility about it, the banner won't be in the app view hierarchy and might cover other elements, such as floating action buttons, for a few seconds. In practice, we haven't found this to be much of an issue ... many apps have put the auto sign-in at start and it shows over a splash screen and only once per device install since most apps don't need to sign users out.
But fair concerns that if credentials might be retrieved frequently or user may interact or switch apps immediately after signing in. Do comment with any feedback/requests, examples of problematic scenarios, or suggestions of alternative UX or implementation we'll see if we can accommodate them.

Related

How to disable "Screen is Pinned" dialog android from kiosk mode

iam developing screenlock app for android using a React Native and a little annoyed with the screen pinned dialog that always appears, is there a way to just get rid of it? so what I really want is no dialogue interaction at all with the user
enter image description here
If you're calling startLockTask() and your device isn't set up as a dedicated device with your app whitelisted, then no you can't prevent it:
Otherwise, the current task will be launched into screen pinning mode. In this case, the system will prompt the user with a dialog requesting permission to use this mode. The user can exit at any time through instructions shown on the request dialog.
The dialog is there to help users understand what's happening, give permission for the app to take over their screen, and know how to get out of it later. It's baked into Android by design, so malicious apps can't cause problems - it's just a limitation you have to deal with, unless you're working with a dedicated device (which can be set up to give apps more control and users less)
Have you thought about immersive mode instead, where you hide the nav bar? The user can get out of that too by swiping to reveal the controls, but it's less intrusive. There's no way to automatically lock the user's screen with no interaction though

How is Samsung Alarm app able to display a notification-like overlay on top of any screen the last forever?

Basically what's happening here is an overlay being displayed on any screen (meaning it is not a dialog, nor a notification, nor a ui service)
The closest I can think of is a custom toast message, where toasts usually lasts on any screen at any app, but toasts can't last more than 3.5 seconds as shown here
I need to do something like this, since I need the user to be alerted about an incoming order that he needs to be responding to.
Anything close is welcomed
read about SYSTEM_ALERT_WINDOW permission. it will allow you to drawn on screen on top on your/other apps
BUT afaik above perm will let you draw on top other apps, but not covering system GUI. on your GIF sticky widget with timer is drawn also on top of notifications, thats not possible in Android system even with SYSTEM_ALERT_WINDOW. so yet again Samsung (in fact any manufacturer) modified Android and adjusted to own purposes, made some new possibilities and gave proper permissions for own apps... and you won't use them as you don't know/have API and don't have privileges, which you can't even ask for

Monitor time spent by a user on different parts of an app

Is it possible to monitor the percentage of time spent on different parts of my app (activities) in relation to the total usage duration? Are Events the way to go?
Thanks!
Firebase Analytics doesn't have the possibility to monitor the percentage of time spent on different parts of an app. With events, you can count some actions, but not the time of the actions.
You can go with Google Analytics to get auto screen tracking and monitor time spent on screens.
Update:
Since screen tracking has been added to Firebase Analytics it automatically tracks screens of an app if the app uses Activity for every screen. If your app doesn't, you can still get these reports by manually setting the screen name with the API.
Firebase Analytics doesn't have screen level user engagement reporting yet. We are considering adding support in one of the next releases.
If you need this earlier you can implement something similar yourself by listening to Activity onResult/onPause or ActivityLifecycleCallbacks. You can record the time when the activity gains focus and log an event when the activity losses focus with the time spent.
Adding to what #djabi said, Firebase do support overall app level user engagement.
However no screen / activity level data.
On version 11.0.0+, Firebase Analytics now automatically tracks the activities your users are on.
Whilst a brief summary is displayed on the Analytics -> Dashboard page, a much more detailed view can be seen by clicking the View screen_view event details link:
Overview:
Detailed:
Note: If you wish to track fragments instead of activities, you'll need to select Screen name in the dropdown in the above screenshot. You'll also need to send firebaseAnalytics.setCurrentScreen(this, "myScreenName", null) on fragment creation.
Further documentation.
If you simply want to track the amount of time a user spends on a particular screen in your app, you can designate a starting event (e.g. when the screen_view screen_name matches the screen you want to time, or when a button is tapped on the previous screen to get to the screen you want to time user activity upon) and then designate an ending event (e.g. the next screen_view matches the next screen_name, or the user taps a button to go to the next screen).
Set these up in a "funnel analysis" in your GA dashboard as two events that indirectly follow one another, flip the toggle to show elapsed time, and voila! Solved.

Does Admob performs requests when the app is in background?

I've integrated AdMob with my app. I can't seem to find this in any AdMob references.
Are AdMobs still running and bringing you revenue even if the app is in background or the ad is not visible? (for example
the user pressed the "Home" button
the user turned off the screen
the ad is positioned outside screen bounds
In my opinon this is clearly a wrong behavior if AdMob is still requesting ads and paying money per impressions in any of the above cases.
How does this actually work? Can anyone point me to a link/reference that exaplains this behavior?
Thanks
Clicking back, home, or closing your phone will pause your application but not terminate it. It is possible to run your application as a Service\WakeLock and it will continue to run in the background. Admob requests should not be running in the background if your application is paused. You should not be receiving impressions or revenue while your application is in the background.
Quote from AdMob: background requests?
You can see in LogCat when AdMob is requesting ad. Are you seeing any
requests when your app is in the foreground (you should), and when
your app pauses (you should not see any requests)?
By: Android Dev Guy

Force application to front

The question I'm about to ask may seem dangerous for the user, so here's the story before the question:
I'm working in a compagny that tries to sell Galaxy Tabs to schools (children under 10). So, I've been asked to develop an application that starts on boot showing a login screen. The child HAS to log in before he's allowed to use the tablet (just like logging in a computer).
My application starts on boot, shows the login screen, all buttons are blocked (the kid must not be able to use the tablet before the application lets him) except the home button.
fortunately, it seems impossible to block the home button.
I've been trying to rebring the application to front when onpause/onstop is called, this kind of hacks.
So my question is : Can I prevent an user to quit my application until I let him do so?
I know this sounds like a virus, I'm not really happy to be looking for this kind of solution either.
You have to build a custom Home screen, and then set it as the default Home application.
EDIT: see more on this previously asked question (at How can I create a custom home-screen replacement application for Android?). You can just make your authorization the default Home application, then when they log in it forwards to the regular Home screen. If they hit the home button your app gets called, can check if they have logged in and if they have will just send them to the regular home screen.

Categories

Resources