Getting Home Screen Positions on Android - android

My question today relates to the android home screen and where it stores icon / widget positions. Specifically, I am interested in accessing the positions and sizes of any icons that are currently being displayed. I have, so far, been unable to find a method of retrieving the positions of other applications but i figure it must be possible in some way due to the presence of third-party home screen applications.
Ideally, I am hoping to query the positions of whatever is on the screen at the moment from a live wallpaper and adjust my rendering accordingly.
Thank you in advance for your time.

There is no way as far as I know of doing this. You may be able to contact the developer of the homescreen (if it's not the default one or senseUI) and have them expose an API to do this.
Third party homescreens draw all the icons themselves. They REPLACE the original homescreen, they don't just put a theme on top of it.
You should just create your live wallpaper and if the user wants to see it instead of homescreen icons or widgets, they can move them. It would be impossible to take into account all the widgets and crap on the screen.

Related

AutoCapture Screen views and button clicks events globally in without manually putting them on every screen and button

I was looking for some auto event capture for every screen and button clicks without manually putting them on every single button or Activity/Fragment and I could find few. But I am really curious to know what to going under the hood and how are they getting these info about screen views and button clicks.
Looking for some tips to create my custom auto capture events in Android App.
You just have your tracking logic in global screen renderer, or button click listener, using whatever available there (screen ids, button ids, class names) to put in your events.
However, this only works if you don't hack around and always use the same methods for rendering and navigations.
Soon enough, the product owner will ask you to make a transparent screen, or to have a screen that flows from right to left, or a screen that opens only to a 1/3 of the screen, or a pop-up, or an overlay, or a weird iframe. You'll have to have defined tracking for those separately.
And then, on top of that, the Analytics team will donate their bit of discord where they don't want to see transparent screens as new screenviews, but also track red buttons differently from green ones. And Toggles should be tracked differently too. By the way, the screen class names aren't useful for analytics, please name them manually. And also, buttons that look like links should be tracked this special way. And don't track the buttons that are just tooltips. Oh, the iframes. The iframes issue messages on activity in them, so listen to those and translate them to events please.
Now, this is an example of what it's going to be like. In real life, it's even more than that. If you have to add an exception for your universal tracking every time Analytics doesn't like it, you will end up with a mess of nested logic that is impossible to maintain. Also, every change to it will cause more bugs in unexpected places than fixes.
Still, universal tracking makes sense when you don't have dedicated analysts or a large marketing team and so you don't want to be able to answer complex business questions frequently.
In all other cases, it's better to hardcode analytics in a structured manner, maybe mapping screen ids to screen names in one neat place, then have analytics sdk wrappers to store the core logic and make use of the name mapping,

Is there a way to create an Android app that looks and behaves just like the homescreen of the same device?

I need a home screen clone app that uses apps, folders, swipable screens of more apps and so on.
So far, I have looked into custom launchers like this one here: https://www.androidauthority.com/make-a-custom-android-launcher-837342-837342/
But to achieve what I need will require a lot of extra additions (the icons are easy enough, but I'll need folders and swiping as well).
Another approach I wondered about is Kiosk mode/Lock-Task-Mode and multi-app kiosk mode. I've looked at the docs and wondered if this could be used to harness the actual homescreen, while still executing code in the background based on what apps the user selects (ultimately acheiving the same desired effect of my project).
I've spent a full day looking at this but I want to know if I'm on the right path. Obviously, I could create an app that contains all of this, but I do think I want it to be a launcher app that's locked in place so that users can't operate the actual home screen and its apps. No malicious intent here, it's just for a closed-off research project.
Any insight is greatly appreciated.

How do you display hint circles in Android?

I'm wondering how to display the "hint circles" (I don't know what they're really called, and I couldn't find it anywhere) when opening an app for the first time. I've seen this in many stock android apps, but not in many third party apps. Is there even a way to do this?
Thanks!
Here is a picture of what i mean. (The blue circle with the OK, not the white one)
there is a library for that, check ShowcaseView
From what I have experienced with these, they seem to just be a form of a splash screen, or another image overlaying the actual app. Even if the stock apps don't handle it like that, couldn't you just have the app open up a new screen that contained a mostly transparent image except for where you want the ring or other hints. Then you can just at a button to that screen, so that after the user has read all of the hints, then they could close the screen.
I do not know how to totally do this, but since you said you couldn't find any documentation on it, I figured this could either give you a solution or point you in another direction to keep looking.

How to Guide Users to Add Widgets?

I have an app which is mainly two things: a widget that can be added to the hone screen, and a how-to-add-widget activity made out of images.
As I noticed, there are different ways to add widgets to the home screen depending on the device/android version. So, my activity's guided images will be different according to the device.
Do you have suggestions in how I can display the right how-to in the right device?
Is there a programmatic way to open device's widgets list to the user?
Thanks.

Android terminology and how to set panel's beckground image

I am new to Android. So new that I am not even clear on the terminology. From the user perspective, one can swipe from one page (iOS term) to another on Android. I have been told that these are called "panels" - but googling that term, I find out about the notification panel - which seems to be what iOS would call the status bar. Or, perhaps, these are called "home screens"
I would like to find out if there is a way to change the background image as the user swipe from one page/panel(?) to another. For example, I might want my game apps to have a green background and my social media apps to have a blue background. If this can be done by setting a panel's background image, that would be good. If there's a hack with wallpapers, that would be okay, too.
Any pointers to Android UI guideline doc that names visual entities would be great. Likewise, any pointers to a glossary of Android UI terms would also be wonderful.
Thanks in advance.
UPDATE:
I have just come across "live wallpaper" and am wondering if this - with onOffsetsChanged() - is the way to go.
In regards to the widget questions the term has two meanings: the UI components provided by the API such as TextView, Button, and WebView and the other meaning is an icon on the launcher that does more than start an app. The latter is also referred to as App Widget and an example of this would be music player controls or weather report. Both kinds of widgets are documented at the Android Developer website.
Wallpapers are typically Live or static. Live Wallpapers are similar in idea to screensavers but do not have the same function as screensavers are for inactivity. They can also be interactive. Static wallpapers are generally bitmaps that are cropped for the situation or specially made for the dimensions. In addition a Launcher (which is the name of the "desktop application" and the Launcher Home being the "Desktop") can be replaced to provide additional features for wallpapers. For your specific question about having an image gallery style wallpaper, the vanilla Launcher does not support this.

Categories

Resources