I have an app which basically loads a URL. The page on this URL has a few buttons to control few things.
Now, I want to make a Live Wallpaper app which will set my app as the live wallpaper. Is it possible to do so?
If it is not possible, then can I open the required URL when I try to set Live Wallpaper?
So, ultimately, I want to set my app as the Live Wallpaper. This will need me to open the URL and set the opened page as the live wallpaper.
Thank.
Sagar.
I'm sorry but i'm afraid it's only theoretically possible, not practically. Previous user was right, you can respond to touch events in a live wallpaper and you can connect to the internet - yes.
But please let me expand this:
recreate your app UI in the wallpaper
you don't get any windows or views in your live wallpaper app;
you don't get any buttons or responders in your live wallpaper app;
Only preference activity is an activity but it is really an optional view to visit for user.
All you have is a surface which you can draw on using either OpenGL or Canvas. It would take you to re-implement browser in you live wallpaper using only what Canvas gives you.
You can respond to touch events in the live wallpaper (http://stackoverflow.com/questions/4298458/android-live-wallpaper-touch-event-hierarchy) and so you could recreate your app UI in the wallpaper, and respond to the touch events on the buttons manually (by comparing the location of the tap with the boundaries of the button images and responding if a button is "pressed").
Related
I'm trying to work my way into Kotlin, and AndroidStudio 4.01. I've got several questions in this regard.
1.) Suppose my application is supposed to be a live wallpaper (with some settings that you can call). This live wallpaper is supposed to be updated every second (by a service?) How am I to declare this (service?) within the manifest?
2.) How can my app get access to the wallpaper? E. g. how can I place a button onto the wallpaper that leads to the settings window?
Create your own wallpaper using wallpaper service. Android support implementing our own live wallpaper by extending. Follow link to get more details about WallpaperService.
Once you implement wallpaper service you can draw your own graphics in window
In same way you can draw your button on canvas on desired location. Implement on touch listener on your canvas and listen for button coordinates. Use accessibility service to launch your activity from the wallpaper service. You have to enable accessibility for your app before loading your wallpaper in system. This is one way to do it. You can find more ways on link bellow.
https://developer.android.com/guide/components/activities/background-starts
Is there any way to display an Android live wallpaper in a fragment? I have a live wallpaper, and currently if the user wants to change some settings, they need to click settings, make a change, hit the back button, and see if the change is what they want. For certain wallpapers, the user doesn't exactly know what numbers they want, and usually they figure out the settings through experimentation, so the current method of going back and forth between the settings and the preview is a pain.
Right now a lot of the settings are in the form of a slider fragment that I wrote. I was wondering if it is possible to include a preview of the wallpaper in the fragment that will change live with the slider?
I am building an Android app that uses the phone's camera feature. I know there is a way to build a custom camera view. Instead, I am choosing to use the camera app via an intent and not build my own camera view. I want to disable/make disappear the pause button while taking a video and have just the stop button. I looked up the Camera API Guide at www.developer.android.com but it doesn't talk about how I could do this. Does anyone know a way to do this?
I doesn't think that this is possible. Using Intents is just a way to tell Android "hey, I'd like to take a video (photo, see MapView, etc). Can you do it for me?". It may trigger one or MORE Apps listening to that Intent, depending on what apps the user has Installed. Usually you can only choose very basic options via Intents, i.e. take video/picture or tell the MapView at which Position it should show up. These options usually also appear inside the App during normal use. I never see a "CustomCamera-App" that hasn't a pause Button, or where one is able to deactivate it inside the menu. Therefore the chances that it is possible to set that special option tends to zero.
I am creating an HOME screen application for my android device. I am creating this app with the help of Android sample Home application. I found one thing in home sample app, if we set wallpaper it is calling android.content.ContextWrapper.setWallpaper(InputStream data); to set wallpaper.
In this app a BroadcastReceiver with action Intent.ACTION_WALLPAPER_CHANGED already registered to catch the changes to wallpaper, then in OnReceive() method, using below code
getWindow().setBackgroundDrawable(new ClippedDrawable(getWallpaper()));
to set background to application window.
So if we are using same app as our home screen, we thought the wallpaper is really set as background in window, but its not true.
If i set any live wallpaper, its not displaying as background in home screen app. The previous wallpaper only displaying in window. If i use default home screen app its displaying the live wallpaper.
Finally i want to know one thing, why live wallpaper is not displayed in app window when i am using sample home screen app ?
If anybody know about this, please help me regarding this.
You cannot set live wallpapers by code, this can only be done with static wallpapers.
I was recently told to convert my flash app over to a tablet. So I only just started coding in the java language.
I am going to have a default picture set as the background. However, if the user wishes they would be able to change the the background to a picture contained on their tablet. So it would change the background at that point and load it at that point when started next time. If they later delete the picture, it would go back to the default.
To top it off, my boss who knows nothing of coding thinks it would be easy for me to "allow those cool live backgrounds in a similar fashion" ... As if learning a new programming language was not difficult enough...
Any help or pointing to various tutorials/resources that I would have to merge to effectuate this would be greatly appreciated
Jc
For live wallpapers, you can only show the current live wallpaper that the user has global selected for the device (or static wallpaper if that is what they selected). This is done by setting the theme of your activity to Theme.Wallpaper. For example, in onCreate() do Activity.setTheme(android.R.style.Theme_Wallpaper) or doing in your manifest