How to make a variable icon of Android application? - android

Usually the icon is fixed. But I want to make an application: when user presses the icon, it won't open any new UI but just change the icon itself. That means it has only two status and can be changed by users pressing on it.
Are some code examples available for this?
As you can see from below screenshots of my phone. The app icon represents a cleaner. When I press it, the 2nd picture shows that the icon changes and it won't enter any UI, just shows the percent of phone's processes cleaning status.
I want to make an app with this effect.

You cannot change your application icon at runtime, in terms of what is displayed by the home screen in its launcher.
You are welcome to write a home screen app widget that can respond to user input and can change its UI.

Related

How to change Android thumbnail to protect sensitive data

Our Android app may present sensitive data and we wish to hide it when the app is not in use - Android is taking a snapshot of the app and displays it in the overview screen. At the same time we want to enable the user to take screen shots of the app when using it. We already checked following options:
Using FLAG_SECURE - Answers the need to hide the app in the overview screen but completely blocks the user from taking any screen shot of the app
Using onPause to change the activity content. Specifically we tried to show there the splash screen. We do see the splash screen appears when the app is minimizing, but the thumbnail presents the app before the splash appeared, meaning this is too late.
Any idea how we can hide/change the activity before the app moves to the background and still keep the print screen ability when the user is using the app?
Here are some links about the issue - all are only partial to this question:
How do I prevent Android taking a screenshot when my app goes to the background?
Hide a view before onStop?
Thanks!
Is removing the app from recent apps completely an option? Then set android:excludeFromRecent to true for the activity.

Hide all the icon [android sdk]

I am making a live wallpaper for android. I want to implement a function that allow user hide all the icon from the screen of android to show off the live wallpaper(User double click to screen -> hide all the icon). I made everything but I still dont know how to hide all the icons. Anyone know how?
Thank
This is not possible. You cannot attack the home screen, or other apps, in this fashion. A home screen may not even have "icons", depending upon its implementation.
You are welcome to write your own home screen, or perhaps partner with the developers of some replacement home screens, to have this feature implemented by the home screen.
Or, IIRC, there is a way to show a live wallpaper as the background of an activity, though I am not certain of the details. If that is indeed possible, to "show off the live wallpaper", you would offer an activity to do so, one that has nothing in the foreground.

How to display balloon counter over application launcher icon on android

I would like to make an icon counter for andoid just like the Email and the Samsung Apps applications i have seen such requests from other developers, but you all say it can't be done.
if so how come those 2 apps and other apps can do it?
do i have to make like more than one icon image and swap them or something?
is it really cant be done and why?
thanks.
you all say it can't be done.
That is because it cannot be done, except by the maker of the home screen, or via an app widget (instead of a launcher icon).
if so how come those 2 apps and other apps can do it?
Because Samsung wrote the home screen and can do what it wants with its home screen.
do i have to make like more than one icon image and swap them or something?
That will not work, as you cannot change the launcher icon at runtime.
is it really cant be done and why?
It really can be done by making an app widget, or by making your own home screen.

How to Create 'how to use' screen (like Go launcher) for the first launch of app (Android)

I just want to add a screen help just like that one is in Go Launcher. The screen just loads in first time the app started in phone and with low opacity guides user to how to use that application with arrows and texts that notice.
You can save a flag in your app prefernces.
When your app starts the first time, set the flag and save it in the preferences. On startup check this flag and you can decide to show or hide your screen.
Some nice tutorials:
http://www.vogella.de/articles/Android/article.html

Is possible to set the home screen programmatically?

I have set my app as home screen(), so when i clik in home button the system let me to choose between default home screen and my app. I choose my app, it's ok. But when a user change a setting i need to change the home screen to default (system home screen) without choosing it, directly. Is it possible?
Thanks in advance and sorry for my english.
You cannot set the home screen programmatically: you must provide the user with an option to choose which launcher they want to use.
I ran into a similar issue when developing a soft keyboard for Android. Since you can't set the default keyboard, I showed a dialog which allowed the user to pick my keyboard during setup. I then verified that my keyboard was now the default before moving forward in the setup wizard.
Basically, the best you can do is show the dialog chooser to allow the user to choose the default system home screen.

Categories

Resources