set android app background to picture or live wallpaper - android

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

Related

How to declare and set buttons in a live wallpaper using Kotlin and Android Studio

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

Android Invisible Remote Views

So I am building a media player app and need some direction from anyone who knows.
Since I am forced to show a notificaiton, just to control lock screen wallpaper back to android 4 I am wonder now, if a remote view has the ability to be Visibility>INVISIBLE OR GONE.
This question is mainly just to get a yes or no answer from someone who make know since I am short on time now and don't wanna chase after something that may not be possible.

Capture android screen for text

Im trying to build an app that can copy and save all text that user selected in any othe apps such as chrome, adobe reader, sms .....
In fact I have no idea how should I do that or even is that possible or not
I will be thankful if any one can help me.
The Accessibility API allows you to investigate the view hierarchy displayed on the screen and read text from different views. On top of that, you may be able to fetch the coordinates of where user tapped (maybe by using some kind of system overlay view) and translate them to the position of text the user most likely wanted to copy. Note that if this even works at usable level, will be very hacky and most likely making it work across considerable number of devices will be hard.

Is it possible attach a widget to the Android background?

I was wondering if is it possible attach a widget to the main Android background/wallpaper/desktop?
I want develop something like a clock, actually It's a very simple widget that have three buttons. This is quite different from another desktop-widgets-like, all the widgets that I've seen are like a customization of the Android wallpaper, or a customization of the Android unlocker, but this is rather different.
If it is possible, do you know some sample code source?
Not sure what "background/wallpaper/desktop" really means, as "background" is too wide term, "wallpaper" may be either static bitmap or live wallpaper, "desktop" means nothing on Android (did you mean Launcher by any odd chance?). If you meant live wallpaper, then you cannot have full functionality in Live Wallpaper you have on Launcher, but if "three buttons" means you want to allow user to tap certain area and react on this, then it should be not a big problem - you can use onTouchEvent() to receive taps from user and act accordingly. If you meant Launcher then well, "yes". For any other options "no" or "most likely no"

Any way to hide Android home screen icons to show Live Wallpaper?

As Android live wallpapers are becoming more prevalent, and developers are doing more with them, a question coming up more and more is how to hide the home screen icons temporarily while the user interacts with the wallpaper.
For this to work, the icons would have to be removed temporarily – not just made invisible, since a tap on an invisible icon would still run the app.
Also, it would be ideal to have a universal solution that works across customs launchers, not just the Android stock launcher.
This question was already asked on StackOverflow, and the answer was that you cannot do this. But this is clearly not correct, as there are at least two programs on Android Market that do exactly this: Show Off (Your Live Wallpaper) and The Cleaner (Show Wallpaper)
Is there a way to hide Android home screen icons, and then later put them back in place?
You can launch an activty which backgroung will be your live walpaper, and finish the activty upon touch... Just a thought...
Edit:
1st comment answer:
Preventing the delay:
You should be more "gentle" in the onCreate() method...
Try creating the minimum as possible in the onCreate(), like, just displaying the basic background...
in the end of the onCreate function, set an alarm (i.e. by AlarmManager) to call some BroadcastReceiver/Activity after half a second or so (with AlarmManager) to set the rest of the live wallpaper graphics... that way you don't have to worry about the delay.
This would have to be a completely new launcher. This is not possible without this I don't think. Sorry. However; to be absolutely sure though you'd have to look at the Launcher2 package in the android source and look through files like Homescreen.java. I'll look into it later on 2.3.3 for you and see what I find.
Try using the zoom gesture as you would to zoom in on a web page (reverse pinch). And you guessed it, the opposite makes everything come back.

Categories

Resources