Before android 4.0 you could create and overlay over any app with TYPE_SYSTEM_OVERLAY and get touches with FLAG_WATCH_OUTSIDE_TOUCH... Now with android 4 you cant receive the touches.
basically the idea follows this app,
http://www.appbrain.com/app/smart-taskbar-%28sidebar%29/com.smart.taskbar
You can keep your app open, or always on top. it will run over any app.
Ive looked every where for information and even source code for the use on android 4.0 but no luck... Now.. I know for certain there are apps that still do this even on 4.0... there is still a way. Any ideas?
I found a full sample app here that works for Android 4.0
Here is the highlight:
To create an overlay view, when setting up the LayoutParams DON'T
set the type to TYPE_SYSTEM_OVERLAY.
Instead set it to TYPE_PHONE.
Use the following flags:
FLAG_NOT_TOUCH_MODAL
FLAG_WATCH_OUTSIDE_TOUCH
FLAG_NOT_TOUCH_MODAL << This one is quite important. Without it, focus is given to the overlay and soft-key (home, menu,
etc.) presses are not passed to the activity below.
Also make sure you add the SYSTEM_ALERT_WINDOW permission to the
mainifest file.
Related
I would like to add an option to launch my app video the android pull down menu/notification bar. I have attached screenshots of this:
Image 1 shows the pull down menu I'm referring to. Image 2 shows where I would like my app launcher to be. Is there any possible way of doing this using either regular Java for Android or the Flutter SDK?
If you mean that you are looking to add an option where you see "Huawei Share", "Screenshot", etc., that requires you to implement a TileService. I do not know whether Flutter supports this, but you can definitely implement one in Java or Kotlin.
This class implements a TileService, though the example is rather old.
I'm developing an app. I have implemented dark mode by creating colors-night file , using a switch and appCompatDelegate. I have written some code so that the app doesn't follow the system when phone's dark mode is on . And it works properly. Yet, the Splash screen does not obey and appears dark-colored when phone's dark mode is on(while the app continues light). I know this happens because the system reads the night resources before launching. (I figured it out since disabling dark mode in the onCreate method in SpashActivity or in Application does not work(and did some research) ). Adding "forceDark = false" on xmls doesnt work either. Does anyone know how to fix this?
I know it would be better to leave it this way since it is user's preference but i want on the first use, the user to see my company's colors and logo and then, choose the dark theme. Which, i also cant find how to change. I mean change dynamically splash activity's color depending on the sharedPreferences. (as i said before, doesnt work).
Thank you in advance :slight_smile:
This is my first question on StackOverflow, so please bear with me if I fail to articulate my question.
I am working on an Android app that targets Android O, and I want the launcher to NOT show the icon adapted i.e. remove the white background.
I tried to use adaptive icons and they work, but the problem is that they change the icon itself making it rouned, square, squircle and tear-shaped.
At first I thought it's out of my hands, but some other apps (facebook, whatsapp and snapchat for example) have their icons unchanged.
tl;dr: How can I force an icon to be used by the launcher on Android O?
The other apps you mention (Facebook, Whatsapp, and Snapchat) don't yet target Android O. Once they do, they'll also be forced to have an adaptive icon as well.
Just remove the targetSdkVersion property from your app level build.gradle file. It will work.
I have made an android application and put adverts in using Google AdMob.
On Eclipse's Graphical Layout there is a white rectangle which says 'Ads by Google' in it, which shows that it has been set up properly.
However, when I run the app on the simulator and in real life, nothing shows up. Why would this be?
Thanks in advance!
You should make sure you have setup your Android Application properly with Ads, go over the following steps and ensure that you have done them correctly.
GoogleAdMob Jar in your libs folder
GoogleAdMob Activity in your manifest
GoogleAd AdView in your main activity XML file, with your adunitId correctly inputted
And Ensure your class in which your AdMob is coded in is correct.
Let me know if these steps help you or not.
I've tried to start the camera and use it my app - with unsatisfactory results. I followed the sample code provided in the android SDK (the Preview class), and I got bad results - the camera was rotating and when I tried to add a button, it never showed up.
I checked other apps and it looks like the skype app uses the same camera app as the one built into the phone. I want to know how I can implement this in my own app. Any solutions?