I wanted to create a question on how to create notification icons for an app. Then answer it.
I will be answering the following questions that I feel need to be grouped together in one explanation rather than spread across the inter web.
FIRST
What is a small icon in notification.builder?
SECOND
What is a large icon in notification.builder?
THIRD
How do I make a small, large icon for notifications?
Small Icon : Icon that will be shown in the status bar when your notification is fired
Large Icon : Icon that will be shown in the notification tray (When slides down). If large icon is missing, then the small icon is used for this purpose.
Refer Notification.Builder for more details.
For creating notification icons, you can use Notification Icon Generator of Android Asset Studio
1.)
To answer the first question we need to understand the design guidelines that Google has graciously made for Android.
GOOGLE DESIGN GUIDELINES
Watch the video that is located in the above link, in the section shown below. It will explain the design behind android's new notifications
A small icon is basically a context to what the app is trying to convey or it can be used to act as the main icon for all notifications, but know that you will not get a filled in SMALL ICON it will always be centered in the circle that is how Google has designed it.
For example I am building an app that will have many different notifications pushed to the user. However, I would like the main app icon to show as a large icon using Bitmap, but to help the users know the context and grow a habit of understanding that notification to be connected with a certain action in the app. The small icon would serve that purpose by providing a simple transparent white image.
A small icon is a completely white transparent image that has the main components of the graphic transparent to be shown on the notification tray, and when slid down.
2.)
Refer to the above link, video for the large icon reference.
A large icon can be the main app icon, or it can be an image downloaded from a data source. Preferably in my situation I use it as the main app icon. However, it can be anything in Facebook, Instagram use images downloaded from their servers to serve as context for who is commenting on a post, then Facebook uses their small icon to represent Facebook. Focusing on the user, rather than the app.
3.)
To make a small icon you will need to either consult a graphics designer or follow the icon size guide here.
For large icons that would depend on what you need exactly. Whether you want to use the app icon itself, or make one a bit more larger for example, Music player shows album art in a big size. Possibly using custom layouts.
Lastly, something I also really struggled with for a few days was the context. I kept getting Null Pointer Exception, and the app would crash. What was happening was I was using a fragment. I was passing context properly, however I was getting the context when the fragment was created, "OnCreate". This works both in fragments and activities. Those that have this issue in an activity do the same make sure your context is being initialized in the OnCreate.
mContext = getActivity(); For Fragments
mContext = MainActivity.this; For Activities
That is it, let me know if you have any questions or concerns. I am sure that I might be missing some info, or not explaining it entirely as Google would, but I was having tons of trouble so I wanted to make sure those that were struggling as I was could have something to help guide them.
Related
As many other Android developers, I'm not a huge fan of splash screens, but still most customers want them because iPhone has them or some other "great" reason.
In the android guidelines it says:
Naturally, you want everyone to quickly learn the ropes, discover the cool features, and get the most out of your app. So you might be tempted to present a one-time introductory slideshow, video, or splash screen to all new users when they first open the app. Or you might be drawn to the idea of displaying helpful text bubbles or dialogs when users interact with certain features for the first time.
Link here, first paragraph in "Don't show unsolicited help, except in very limited cases"
And now in the material design guidelines they recommend developers to use a "Launch Screen"
Because launching your app while displaying a blank canvas increases its perceived loading time, consider using a placeholder UI or a branded launch screen.
I'm guessing the android website hasn't been updated yet. Anyway, the last version of Hangouts (5.0.104...) has a very nice and quick Launch Screen. Its displayed instantly on my Nexus 5 with Marshmallow. So my question, is there an "official" way of doing this?
I've been searching for examples but can't find anything except for kind of workarounds like this example here which uses what I think is the most common approach with a Splash Screen Activity. This, however, shows a white screen when the app has been destroyed before your actual splash screen is shown.
This second example uses a theme with a window background which is shown instantly but disappears almost equally quick.
So, how does Google make the Launch screen like in Google Hangouts which is shown without delay and without any white screen before?
A colleague from my work have been in a material design training at Google HQ in London and their official way of doing it is using the windowBackground in the theme as you posted on your own question: http://antonioleiva.com/branded-launch-screen/
The idea is that the XML theme gets show very very fast by the framework, and as soon as your actual layout is loaded it will be visible.
The difference between Hangouts or even Google Maps, is that their layout is a very heavy/complex layout and they simply take longer to load than a HelloWorld app.
As your app grows and gets more complex and with more elements being initialized during Application.onCreate or Activity.onCreate, your slash screen will also be visible for longer time.
edit:
I've found a Google+ post from the official "Android Developers" profile and repost from Google engineer Ian Lake saying the same thing:
https://plus.google.com/+AndroidDevelopers/posts/Z1Wwainpjhd
https://plus.google.com/+IanLake/posts/SW7F2CJvAmU
It's because the first solution (http://antonioleiva.com/branded-launch-screen/) is changing the theme in onCreate. But the widgets of your activity are not yet rendered in onCreate. That's why you see the white screen. The second example is a good one. If you need longer time set SPLASH_TIME to longer. Check the line Thread.sleep(SPLASH_TIME) in the doInBackground function. You can wait more.
I am posting this question because I never worked on this and I am not aware which component is used to implement such functionality.
See this screen-shot. This is an sample image. It is not my work, this is taken from Google Images:
Now on application startup I am reading Android sd card and updating my database. In the meantime, I am using ProgressDialog like this
Now what I want is to show 5 image slides. Not Image slide I want a single colour backgroung and the text should have to be change every two seconds on the same backgroung with five small circles I downside.
Now I am not able to get what is it. A image slide show or other native component. I asked in chat rooms they asked me to post here.
If it can happen without image it will be better because there is a lot of complexities with different device sizes.
How can I implement this?
Try with android smartimageview or with Viewflow
This question has been asked before, but has not been properly answered yet. I know this is possible but we're feeling a little confused.
We need to display custom/dynamic images in the status bar when push notifications are received. We're concerned with the larger image seen in the pull-down, not the small image in the actual status bar. Because they need to be dynamic, the images can not be packaged with the apk and we are trying to target Android 2.2
What we're trying to achieve is similar to how Facebook displays the profile image of the user who initiated the notification in the notification bar. It's also similar to how whatsApp shows the group image in the notification bar when a new push notification arrives.
From what we've read, this is possible only in Android 3+, sdk 11. But that can't be true.
We've installed both Facebook and WhatsApp on an Android phone running 2.3.4 and sure enough, custom icons display in the notification bar.
So what's the secret? How do they do it? How can we do it?
so what you are trying to do is set the setLargeIcon(Bitmap icon) in the notification builder. This is available in APi 11 and above (honeycomb). The notification builder in the compatibility package v9 can set it for you, but it will only appear on api 11 and above.
To achieve the same effect in 2.3 and below you must create a custom notification layout and set it with setContent(RemoteViews views) in Notification.Builder to generate a custom layout. This can be styled with a large icon on the left side to imitate the > API 11 styles.
Creating custom layouts is tricky and many things have to be taken into account, such as available screen size on other devices to display the notification, and themed text colors (especially as notifications used to be dark text on white bg, now they are light text on dark bg) There plenty of guides and even SO posts that can help you out (such as this one)
In regards to getting a dynamic image, when the phone receives the message (push notification or whatever) and your app goes to build the notification, you can do a small http request to pull a dynamic image before building the notification. This will delay the posting a few seconds, but it doesn't really matter. Then you can get the resulting image and use it in the notification. The specific image can be chosen by sending some data with the (im assuming push notification) that identifies what photo, such as a url, or an id that you can append onto an already existing url in your notification building part of the app.
Hope this helps, any followups just ask :)
You can't use anything but prepackaged drawables as your notification icon as seen on status bar. And no, you did not see anything like you look for in FB app (or you talk about notification area seen when you pull it down).
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.
My question today relates to the android home screen and where it stores icon / widget positions. Specifically, I am interested in accessing the positions and sizes of any icons that are currently being displayed. I have, so far, been unable to find a method of retrieving the positions of other applications but i figure it must be possible in some way due to the presence of third-party home screen applications.
Ideally, I am hoping to query the positions of whatever is on the screen at the moment from a live wallpaper and adjust my rendering accordingly.
Thank you in advance for your time.
There is no way as far as I know of doing this. You may be able to contact the developer of the homescreen (if it's not the default one or senseUI) and have them expose an API to do this.
Third party homescreens draw all the icons themselves. They REPLACE the original homescreen, they don't just put a theme on top of it.
You should just create your live wallpaper and if the user wants to see it instead of homescreen icons or widgets, they can move them. It would be impossible to take into account all the widgets and crap on the screen.