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)
Related
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" >
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">
I'm working on an Android Activity which should not be full screen and thus uses Dialog theme. This can be achieved by adding
android:theme="#android:style/Theme.Dialog"
to the activity definition in Manifest file.
Visually that does what I expect. However, when the user interacts with the device in an area outside of this activity, the app in the background does not receive this input.
Is there a possibility to achieve this?
that is not possible with your solution as there is only one Activity possible to be active. You could try that with Fragments but I doubt that you could open your App and navigate the Homescreen / whatever in the meantime.
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.
I am trying to create a small pop-up in my Android application to let the user choose from one of many items, ala a ListView. I am hoping to make it show up as a translucent box that overlays on the screen, as opposed to completely occupying it like Activities usually do.
One technique for doing this that I've heard is possible is to launch an Activity in an AlertDialog box. This would be perfect - it's the ideal size and has a lot of the mechanical properties I'm looking for, but I'm totally unable to find any more specifics of this technique.
Is this possible? And if not, what is the preferred way of accomplishing something like this?
This should answer your question: http://developer.android.com/guide/topics/ui/themes.html
Quote: For example, you can use the Dialog theme to make your Activity appear like a dialog box. In the manifest, reference an Android theme like so:
<activity android:theme="#android:style/Theme.Dialog">
Maybe you could just display AlertDialog http://developer.android.com/guide/topics/ui/dialogs.html