I'm playing with Android development and making some simple apps. I don't want to specify a theme for my app, I'd like it to use the system one; here I mean that every producer and/or user might choose a theme for the device, and the app should adapt to it, looking "native" everywhere. Coming from desktop development, that makes sense to me. I have an LG p880 with android 4.1.2, and I'm developing command-line only just to have control on such things.
Now, the strange thing: on my device my app has white text on black background, but all the other system apps, and especially Google's ones, are black on white. I suppose my app has the "right" appearance, not having forced one myself. So can it be that all the other apps have a custom theme inside? Does that mean that major app developers, and Google first, don't care about system consistency? Should a developer care as much about presentation as the contents?
I don't want to specify a theme for my app, I'd like it to use the system one
There are several dozen "system ones" (see the Theme_-prefixed entries). And, at the time of this writing, those don't even include the Theme.Material set coming up in the next major Android release (and available for experimentation in the "L" Developer Preview).
Coming from desktop development, that makes sense to me
Conversely, Web developers would consider a "system one" to be a foreign concept.
I have an LG p880 with android 4.1.2, and I'm developing command-line only just to have control on such things.
You are certainly welcome to develop "command-line only", but since the theme declaration (and definition, if custom) are in XML, you are welcome to use an IDE.
I suppose my app has the "right" appearance, not having forced one myself.
There is no "right" appearance.
So can it be that all the other apps have a custom theme inside?
Many probably do. Others will have chosen a different "system" theme. For example, if your targetSdkVersion is 11 or higher in your app, you are getting Theme.Holo as the overall default, given that you have not specified something to the contrary. Other apps will use Theme.Holo.Light.DarkActionBar, for example. Theme.Holo has a dark background with light text; Theme.Holo.Light.DarkActionBar has a light background with dark text except for the action bar.
Does that mean that major app developers, and Google first, don't care about system consistency?
No more than most Web developers care about "system consistency".
In part, that's because we went down the path you thought of years ago and rejected it. Device manufacturers would tinker with themes, and then our apps would no longer work well. For example, a manufacturer might decide to have dark text on a light background, inverting what other manufacturers had, and then in cases where we are tailoring our own font colors, we'd be screwed, as our colors wouldn't work right on some devices.
In Android 3.0, Google created the Theme.Holo family and said that those themes could not be modified by Google Play ecosystem devices. Instead, a Theme.DeviceDefault family was created, where manufacturers could tinker. I am not aware of any app that ever chose to use a Theme.DeviceDefault theme.
In the new Material Design aesthetic being promoted by Google as part of the next version of Android, things like highlight colors are supposed to vary either by app (for branding) or by content (e.g., choosing hues that work well with the photo we're displaying). And even before Material Design, Google has been taking steps to help make it easier for developers to use a custom color scheme to go along with one of the stock system themes (e.g., Android 4.4 de-emphasizing blue as being a touch highlight color).
Related
Seems Android is displaying notification icons in different places depending on OS or device.
Usually it's on top left corner, but sometimes, it's left side but centred with text. Does anybody know what is the logic behind it?
Examples:
Centered
Top left
Seems it's not related to OS so much as I have seen both versions on same versions of Android. Maybe something else?
Different releases of Android have changed the UI styling for notifications - your first example is from Marshmallow (Android 6) or before, the other is what it looks like on modern versions of Android. And that's just for stock Android - almost every phone manufacturer adds their own tweaks to the UI to some degree, and if they decide to make changes to the standard layouts, they can!
If you want to create a notification, it's recommended you use the NotificationCompat support library. This allows you to configure the notification in different ways, so you get a few standard variations. Using the support library means you can use configurations that weren't supported by the notification system on older OS versions, and they'll use safe fallbacks.
How those standard variations will actually appear depends on the device - for consistency, all notifications on a device will follow those standard templates. You wouldn't be able to get your modern example mixed in with the old Holo style, it would look weird because the styling is completely different.
It's ultimately up to the OS to decide what notifications should look like, you just provide some attributes like different text labels, an image, media content, etc. and it decides what to do with them. That's why the old style puts the icon in a big circle on the left, with the two bits of text displayed that way, and the newer version uses a small icon inline with the app name, etc.
It is possible to create a custom notification, where you can basically define the whole content and have control over the UI, so you could have completely mismatched notification styles on the same device - but I don't think you'd see that much, since it would make your app look strange on devices where the UI doesn't match. And like that link says, from Android 12 onwards you're only able to customise an area of the notification, which doesn't include the standard header (app icon and name, timestamp etc)
I am working with a team to develop a cross-platform application on mobile, and we're using Visual Studio 2015 and Xamarin.Forms v2.3.2.127.
We have already created the application icons that we need for the three different platforms (Android, iOS, UWP) and each one follows the native platform specifications.
There's only one more problem that we have faced, and I would like to know if there's any answer for my problem. Some of the devices that run Android OS forces the application icon to have a squared background, and they seem to give arbitrarily colours for the background (please check the image afterwards). We don't want to change the application icon by itself for Android so we're looking for a better way.
Is there any way in Xamarin to be able to detect that the device is adding a coloured background for the application icon so we can provide it with the icon that we want, or at least change the colour the device is going to use?
As you can see, Whatsapp, Facebook and Dropbox icons are all modified and given a squared coloured background.
Thanks in advance for any help that could be given.
Regards, Paul.
This is a custom launcher / icon pack's doing. Most likely the manufacturer's doing(LEAGOO). You may notice that "Known" apps will have a custom icon, but if you created a custom app it might look much different with a random background and perhaps an icon transformation of some sort.
It might be worth getting a stock Android device to ensure your Icon looks great on stock Android as you'll never know what different launchers(bloatware) will do to your app's icon.
If the OEM has a way to interop with it, then by all means that would be the easiest way to customize this behavior. However most launchers are included in the OEM's package/bloatware.
I want to add black padding (a thick black border) to the android screen such that every app is displayed with the padding around it. I know how to do this for my app but how do I do this such that when my app is running in background the display is padded?
I don't believe this is possible unless you're willing to create and run a custom ROM.
Thankfully, this is not possible for the average non-ROM third party Android developer.
The screen on mobile devices is actually very limited, and when programming for the mobile environment, you have to learn to get away from the windows metaphor used by traditional desktop PCs.
On the other hand, may be your app could pretend it is running in the background, but still stay in the foreground with its transparency enabled. And perhaps if you can't do something, may be you can find a way to fake that something for your users.
Also, note that the default home launcher is capable of doing something similar to what you want, but only for widgets. And if being able to run widgets is sufficient for you, perhaps you could write your own launcher application that can embed widgets.
My Samsung Galaxy S2 running Android Ice Cream Sandwich has nice little counters that appear on the home page shortcuts for Mail etc. telling me how many new messages there are waiting. That's just the behaviour that I want for my own app.
If I've read the Android docs and related questions in SO right, that behaviour is not exposed through Android, but is provided by the launcher itself, so it can't be done directly.
But I have produced the behaviour that I want using an app widget. Now I'm left with the problem of making the app widget layout visually consistent (alignment, text appearance) with the appearance of the regular shortcuts. I can't see a sensible robust way to to this. Anyone?
(Otherwise it looks as though I'll have to make the app widget look sufficiently unlike a shortcut that visual consistency isn't an issue.)
I run my applcation in Motorola,HTC devices and each group of devices my application dialog box,Text box appearance is different.Why this will happend?Is device to device any specific theme applied on my application?Iam n't used any custom theme for my application.
how to persist my application look and feel in all devices.I know little bit, by using our own theme we can persist.but, I don't have time to develope my own theme.I want to take the source of one device default theme and utilise that one in my application.So that I think i can see the application same in all devices.how to get the theme from one device,if my above sentence correct?
You are right every manufacturer applies some styling to their user interface.
There are some places where this is fine for example dialog boxes should look the same in every application on the device. If a dialog box would look completely different then all the other dialogs this would confuse the user.
Some things are annoying for example the motorola motoblur phones use a black background image for spinners and normal andoroid phones use a grey one.
Have a look at my question regarding this problem. It is a solution for a small part of your problem but maybe it shows you how to search for the other images and themes that you need to copy.