Can Android Studio and Unity display 3D models as desktop mascots for Android devices?

Asked 2 years ago, Updated 2 years ago, 62 views

Thank you for your help.
As per the title, can I use Android Studio or Unity to display the 3D model created in Blender as a desktop mascot for Android devices?
As an image, docomo talks and looks like a concierge.

If possible, I would appreciate it if you could tell me how to display it.

android unity3d

2022-09-30 19:55

1 Answers

It has nothing to do with the 3D model and the overlay display (desktop mascot) on the Home screen. I will just explain how to display Overlay on the Home screen.
(It doesn't matter if it's a 3D model or not)

"In conclusion, ""You can do it by force."""
There are three elements:
1. Always display Overlay created apps
2. In order for another application to be able to transition, 1. will be turned into a service instead of activity
3. Run it only on the Home screen (3. requires power)

1.
for
You can use WindowManager.LayoutParams to set the type of Window that you want to create to Overlay.
For example, TYPE_PHONE.
https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html

This is just activity, so if you press the back key, it will disappear, so
It must be implemented as a service.

public class MyService extensions Service {
@ Override
public void onStart (Intent int, int startId) {
    super.onStart(intent, startId);

    LayoutInflater layoutInflater=LayoutInflater.from(this);

    WindowManager.LayoutParams=new WindowManager.LayoutParams(
            Specifying parameters arbitrarily according to purpose
            WindowManager.LayoutParams.TYPE_PHONE,
            PixelFormat.TRANSLUCENT);

    view=layoutInflater.inflate(R.layout.overlay, null);

    ((WindowManager) getSystemService(Context.WINDOW_SERVICE)) .addView(view, params);   

3. The most troubling thing is
I feel that the only way to do this is to monitor the operation of Home in ActivityManager.RunningTaskInfo, etc.(This method requires permission and requires hard coding of the target Home app, so it is very limited.)
The behavior of the concierge seems to change depending on the Home app, so I think they are doing it by force...

(Additional note) ActivityManager.RunningTaskInfo is more restrictive than APILlevel21, and only SystemOrSignature is available...

"Also, although the approach changes, ""Overlay of the Home app"" is like a concierge."

If it's Home app background instead of
There is a way to implement it as a LiveWallPaper.
This one is simpler, but it's interactive, but it's just a wallpaper.
https://developer.android.com/reference/android/service/wallpaper/WallpaperService.html


2022-09-30 19:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.