Hide Icon and label in Activity (splash screen) - android

Here's the part of the Manifest that I believe is important:
<application android:icon="#drawable/icon"
android:label="TestApplication"
android:theme="#android:style/Theme.Holo.Light">
<activity android:icon="#drawable/splashicon"
android:label=""
android:name=".Splash">
The splashicon is a 1x1 transparent png. When I try this way, the Application icon renders then fades to the transparent one.
I've tried various combinations of modifying the icon/label section for both activity and application and getting bad results. Removing the icon/label from the activity gives the most preferred result sans icon and label displaying during splash.
How do I get rid of those two items without messing up the icon/label in the app drawer and possibly other locations (haven't tested Market).
Edit:
I'm not after removing the icon/label from the app drawer (in fact, that is one thing I'm trying to retain).
The issue is that if I run the application in 3.0+, I get the icon and the label in the upper lefthand corner of the splash screen which is not what I'm wanting to see.
An example of an application that performs this behavior properly would be Pulse, Angry Birds Rio, and the like.
One application that I've noticed that falls victim to the same issue I'm having is Wyse PocketCloud Pro. If you run it in Honeycomb, look in the upper left hand corner as it is initially loading. Momentarily you can see the icon/label and it fades.

You need to be more specific about what you are looking for. I'll try to answer what you may possibly be asking for.
An activity that is being displayed in the launcher must have a label and icon. That's kind-of... well, it wouldn't make sense to not need these. So please don't play games here and try to not have them. You start to look like a malicious app by doing so.
If you don't want your activity to show up at all in the launcher, then don't declare the intent filter for the MAIN action and LAUNCHER category.
If you want the preview window when launching the app to look more like your real window (let's say you hide the title bar), then in the tag in your manifest use android:theme="..." to declare the theme you use so this can be used for the preview. For example, if you are using Theme.NoTitleBar to not have a title bar, do android:theme="#android:style/Theme.NoTitleBar".
If you want to show a splash screen for your app and have the preview window match it, and one of the standard themes does not match enough, then make your own theme and in the manifest specify it for android:theme. This will let you set a custom background color, or even set the background to an image that is your splash screen.
Keep in mind that launching applications should be fast, so having to show a splash screen every time it launches is very not desirable. On a mobile device, there is a good chance this will greatly reduce the amount your app is used because people won't wait for a long time for it.
If you are looking for something else, please update your question to more clearly state what it is.

Related

Entire screen overlay

just a simple question (hopefully):
Is there any easy way to make a simple translucent screen overlay on android? Just a solid color would work perfectly for starters. I would wager that this wouldnt be started as an activity but run as a service since the overlay should display over everything always until disabled, whether or not the application that hosts this overlay is running/paused/stoped.
It's easy to make an overlay for a specific activity/fragment, but I'd want this overlay to appear over the entire screen regardless of what's on screen (except maybe error dialogs, those seem to take presidence over anything).
Edit: To add more information, apps like "twilight" and "screen filter" seem to be able to do this sort of thing, whereas they are able to display a color at a custom transparency over the entire screen whether or not the app is running.
Yeah, it's possible to implement entire screen overlay using SYSTEM_ALERT_WINDOW permission and WindowManager, that's how Facebook chat heads works. Basically, you need to add your View to WindowManager instance, search WindowManager for more information.

How does WhatsApp pop-up notification work?

I am trying to mimic the pop-up notification of WhatsApp.
(If you have not seen it, it might be a bit hard for you to understand this.)
Below is an image to give a clearer perspective.
Some suggested that this might be done using an oridnary activity which has the Theme.Holo.Light.Dialog.Alert theme. However, when I implemented that I got half of the activity full with the views (and the other half) which is supposed to be empty like a dialog, showing a white background. ie, I did not have the dialog feel.
Morever, when the device is in standby mode (power button pressed) and locked, whatsapp is able to bypass that and show the popup dialog (or activity, or whatever) above that.
Any ideas how to implement this ?
Oh god! After hours, I found the solution!
Refer link:http://developer.android.com/guide/topics/ui/dialogs.html#CustomLayout
It's extremely easy, you just need to set up the theme of the activity to #android:style/Theme.Holo.Dialog in manifest like:
<activity android:theme="#android:style/Theme.Holo.Dialog" >

Pulling up a blank page for use with a translucent background in Android

I'm putting the following snippet in the manifest for the activity to make the background translucent.
android:theme="#android:style/Theme.Translucent"
That does exactly what it supposed to and displays whatever the user had pulled up before running my app (like the list of applications). Is there anyway to make just the users background display behind my app and not whatever they had pulled up before?
use this instead
android:theme="#android:style/Theme.Wallpaper">

Android - Set image over home screen?

I want to set image over home screen when my app runs, like crack screen applications(Ex: https://play.google.com/store/apps/details?id=mk.g6.crackyourscreen&hl=en) to achieve something.
I beileve it has something to do with these permissions;
DISPLAY SYSTEM-LEVEL ALERTS
DISPLAY UNAUTHORIZED WINDOWS
But i cant find an example, tutorial or any article about it?
Thanks...
You should be able to do this by setting a transparent activity. For that matter, you can make your activity use the Translucent theme, like this (put this in the Manifest):
<activity android:theme="#android:style/Theme.Translucent.NoTitleBar">
(source)

How can I provide *immediate* confirmation of an app's execution when the main activity is transparent?

The main activity of my app is defined in the Android manifest file with the following attribute:
android:theme="#style/Theme.Translucent.NoTitleBar"
This makes the activity transparent, which in turn makes it possible to control the transparency of my app in code by manipulating the main View object (e.g., by invoking setVisibility(View.INVISIBLE) on the main view). This works fine.
However, one undesirable consequence of this approach is that when the app is launched there is no visible response until my main View is displayed. Normally, the default black background of an app's main activity is immediately visible when an app is launched, which provides immediate confirmation that the app is starting to run in response to the user tapping its icon in the launcher. But with a transparent background, the user continues to look through the background at the display from which the app is being launched until the main view is displayed, and so it appears (during that interval) as if nothing has occurred.
Even on a device with mediocre performance (e.g., the Motorola Droid) my view comes up in about one second, which is not too bad. However, on a really slow device (e.g., the G1) it can take almost four seconds. While this is not a disaster, I'd prefer an immediate response so that the user is not left wondering whether the app was in fact triggered.
I have tried removing the transparent theme, which results in immediate confirmation via a black background, as usual. However, I've been unable to set the activity background to transparent in code once the app has been initialized.
I've invoked setTheme() on the activity just prior to calling setContentView() for the first time, passing it a transparent theme, but this does not make the activity transparent.
I've also tried this in onCreate() (again, just prior to calling setContentView()):
ColorDrawable transparentDrawable = new ColorDrawable(Color.TRANSPARENT);
getWindow().setBackgroundDrawable(transparentDrawable);
This also appears to have no effect.
I've also tried using a theme in my manifest that has android:windowBackground set to a drawable that is a mostly transparent PNG, but with some text (e.g., the app's name) superimposed on the transparent background that would provide a cue to the user that the app was loading. Unfortunately, the moment I use a drawable as part of the theme, the background fails to display at all until after the main view is initialized.
All time-consuming initializations are already being done in a worker thread, so I'm not looking for advice on how to accomplish that. The view itself just takes a certain amount of time to display, and while it is fairly quick, nothing beats the instantaneous response of seeing the main activity's background as soon as the app is launched.
Even on a device with mediocre performance (e.g., the Motorola Droid) my view comes up in about one second, which is not too bad. However, on a really slow device (e.g., the G1) it can take almost four seconds.
It should come up in milliseconds. Make sure you are not doing excessive work on the main application thread.
The view itself just takes a certain amount of time to display, and while it is fairly quick, nothing beats the instantaneous response of seeing the main activity's background as soon as the app is launched.
Then initially display something else that is cheaper to bring up (e.g., ProgressBar), replacing it with your regular UI when it is ready.
I've upvoted CommonsWare's answer, because he pointed me in the right direction, which is away from trying to change the transparency of the main activity after it is launched (something I'm beginning to suspect cannot be easily done).
However, that advice cannot itself be the accepted answer, given that it is only a pointer in the right direction.
The answer I decided upon, given this guidance, was to create a splash display. However, I could not find a truly good android splash example anywhere. So, I devised one, and it is working very well for me, and completely solves my problem.
Because creating a splash display is a more general question than the one I started out with, I have placed my detailed description of how that can be done as an answer to a question about how to implement a splash screen, and have linked to that answer below:
Create a true splash screen

Categories

Resources