Android - how can i make a minimizable app? - android

So , i want to make an app that can i can minimize and move over other apps.
I saw this feature on the twitch app and did some research but didn't find how they did it.here is an example of this feature.
Thank you for your answers in advance.

The example you showed is Android's Picture-in-Picture feature: https://developer.android.com/guide/topics/ui/picture-in-picture
However, it's not exactly a minimized app. Picture-In-Picture mode is simply a way for your content to be shown when users switch to other apps.
Due to this, there's a number of restrictions and guidelines, such as you're encouraged to hide all UI elements when in PIP mode besides the content that is displayed.
You're allowed to provide a list of Actions for the user to interact with, such as media controls. But note that there's a limit to how many actions that can be provided.
So it's not exactly a minimized app in the sense that its a smaller version of your app. Instead, it's more like the main viewing content of your app has been plucked out of your app and it's displaying over other apps.
If that's all your app needs, then Picture-In-Picture mode will work well.
But if you want a real mini-version of your app, you're going to have to consider Floating Windows instead. Floating Apps create a UI through a Service instead of an Activity.

Related

Unity3d. Android. Prevent application switching

Is there any way to prevent an android application from switching out?
I want to make an application for children, where you cannot switch to other applications, anyhow.
The OS control's the switching stack - not the application - this is by security design. In Android 5.0 you can "Pin applications" effectively blocking application switching.
There are a few applications which have somewhat complex (yet still easily circumventable) type of "lock screens", doing a similar task would achieve the same effect however you made need to write a native plugin. Ideally I would focus on the content of the app and push users towards using the Pin functionality.
Google Support - Pin Apps

Can an Android app interact with another app?

I want to be able to tap the statusbar and the contents in the displayed app to be scrolled up to the top.
Is it technically possible that an app intercept my tap and send the appropriate command to the active app? I have noticed for example that AntTek quick settings shows a drop-down window when swiping down from statusbar. While using the app I did also notice that even by just tapping the statusbar (before beginning to move the finger down), the app seems to already interact with the touch as it dims the screen brightness in preparation to display it's "window" (sorry I use the MS Windows term), so clearly a statusbar tap CAN be sensed by an app.
Starting from this, I wonder if such an app could then send a message to the active program telling it to scroll up.
Is that possible? And if yes, the message must be customized to a particular app (let's say the browser as the most important) or is it standardized so the apps speak the same language between themselves?
I am not a programmer so answers with codesamples might be less helpful than a plain english explanation. Finding out that is possible would lead rather to pursuing a programmer to implement the idea rather than starting to develop it myself.
Thanks :-)
There is an XPosed-module which seems to do exactly what you want.
To use XPosed-modules, you'll need to root your phone and install the XPosed-framework.
The XPosed-module is called "Statusbar Scroll to Top" and its repository can be found here:
http://repo.xposed.info/module/com.mohammadag.statusbarscrolltotop
This will work for almost all app-lists, but for example won't work for browser-content.
If you want to scroll to the top of the page in a browser, then you'll probably do best to get a browser which can do that on its own. (For example Habit Browser has it built-in and respective plugins are available for Firefox.)
Yes it is possible. HiroMacro and Frep can do this, but it requires root. https://play.google.com/store/apps/details?id=com.prohiro.macro&hl=en
(how do they simulate mouse and keyboard interactions on other applications? i have no clue :/ anyone?)
Is it technically possible that an app intercept my tap and send the appropriate command to the active app?
No. One app cannot send fake input to another app, for security reasons.
An android app comprises of several activities. Each activity display a GUI that allows the user to perform a specific task. To take the user from one activity to another, app must use an Intent to define our app’s intent to do something.
An intent can be explicit in order to start a specific component (a specific Activity instance) or implicit in order to start any component that can handle the intended action.
Interacting one app to other app in android
google docs link

Only displaying pre-installed applications on android device

So I am using the Home sample to build an application that creates a second home screen for the user. The idea is to be able to have only one user account yet restrict certain access to chosen applications. I have managed to ensure that all of the applications are invisible in the XML yet I am struggling with how to change this to make certain apps visible.
Is it possible to write a whitelist of accepted apps for instance the preinstalled apps or child friendly apps for children who game using the android device and then put in a Java method to access this white list? This is the only way I can think to make it work.
If anyone knows the correct way can you please help.
Thanks.
Ok so I discovered how to do this.
In the home sample they provide a for loop in the Home.java file that covers all apps and displays them. It take a simple if statement to restrict the apps that can be viewed -
// for loop is here
if (info.activityInfo.applicationInfo.packageName.contains("com.android"))
//then the rest of the home sample is here.
Still very basic but provides me with a good enough UI so that kids cannot see apps I don't want them to.

how to permanently override android soft keys behaviour and display through

I am relatively new to android and want to create an application that permanently overrides androids basic softkey behaviour and view (for devices with soft keys).
Some functionalities I want to implement are changing the size of the softkeys window at the bottom, change its images, and possibly change its functionality.
For example, the user can set the size to of the softkey to be "large", "medium" or "small". And I can change the functionality of the back button to open say a particular application instead of going "back".
I'm basically looking for a high level answer as to how to do this, a basic direction of what I should read/study in order to be able to accomplish this. I realise this may require root access.
Please note that I want this behaviour to change not only in my application but I want the effect to exist on all applications. If this requires the application to be running atleast at the backend, that is fine.
After doing some decent amount of search, it seems I will have to make changes in the systemUI.apk, or possibly get its source code and modify it. Is this correct?
Thanks in advance.
I don't think even root is going to be enough for the type of changes you are describing. You're going to need to edit the Android source code and build your own system image.
Well you can't override system resources because they are part of the system image.
What you are looking for is called Home Application which can be developed like any other android app no need for root , you can find an example for it in your sdk samples.
Home Sample Application.
your app would be responsible to have UI components to send the user to all of the phone functionalities which includes:
Place for wegits
Place for apps listing (menue)
Access telephony functionality (call, phone history ...)
Access settings.

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