Android App. Download and use Icons at runtime - android

I have some questions regarding Icons in our Android App.
We currently have a lot of Icon Sets in the drawable folder (like 20-30 Sets) which we use depending on which user is logged in currently. Each of the Icons exists multiple times for different resolutions (HDPI, XHDPI...).
We don't like having all the Icons in the App because we need to release a new update every time when we need to add some new Icons (which happens a lot).
Question:
Is it possible to download Icons at runtime and use them to create a view? Then we wouldn't need to store all the Icons in the app.
If yes, how would it work with different resolutions? Would we need to download each Icon in different sizes?
Thanks in advance.

Related

Using icons for app from internet for android app

I am wondering what are the legal ramifications of using an icon from the internet in my app. I am not much of an artist but there are gazillions of icons on the web. I was going to use one and tweak it a bit and use it for my android app. Is this legal to do?
Thanks.
If you wish you can use your icons from drawable folder by creating vector icons giving it your own colors and styles

Android apps and icons

Coming from web development to Android development, I've found that there are many similarities and differences.
Being used to icon fonts, I have some questions about using fonts and icons in Android apps.
Are icon fonts a "thing" in Android app development?
I've seen people mentioned putting icon images under drawable, but others say to put them under mipmap. What are the differences?
Thanks.
Q1. Yes, Icon Fonts are a "thing" in Android. I suggest you do a Google Search on how to use them, or you could ask another question on StackOverflow.
Q2.
The mipmap folder should only be used for your app's Launcher Icon, all other images should be placed under the drawable folder. This is because the launcher icon's resolution is different from the device's current density. See this for more

Is creating Android layout files for different DPIs necessary?

I recently downloaded some famous apks(like Instagram) and unzip them, I found out that they only contain single "layout" folder, however, Google advised using layout-hdpi,layout-xxhdpi to support different screens.
When I develop my own app I find if I use "xhpi ratio"(1dp = 3px), the app works fine for almost all devices(from 320*480 to 1080*1920).
And I'm using Android Studio under Windows now, the default structure only contains "layout" folder alone.
So, is it necessary to create different layout files to support different dpis? And what is right way to adapt the various android screens?
Google advised using layout-hdpi,layout-xxhdpi to support different
screens
Where is it written? Usually drawables are put into directories with different density, but not layouts. Sometimes different layouts are created for different screen sizes (not density) and orientation (portrait, landscape).
Changing several layouts when you are changing/updating your UI is a pain in the a.. Make your best to keep as min. number of layouts you need to maintain for your own good. Make one for phone, one for the tablet if you really must.
It depends. I had done some apps with only one layout folder and also some which has even 5 folders to perform well on different devices.
I have mindset that if i use Relativeayout, i won't have to use multiple screen. Its just according to me.
If you have observed instagram doesn't contain much complex design so may be they did not need to. as well as they only had to put things inside container(relative or linear) and the container are in order .

Switching between app icons programmatically in android

I have two different variants of an app with slightly different behavior. They share the same code, but the different behavior is through property files in the same project. I would like to have different icons for the apps.
Is there a way for me to change this programmatically? I have two sets of icons images in res/drawable-* folders, one for each app variant.
I've already looked at How to change an application icon programmatically in Android?, but that seems to be addressing a slightly different issue.
If I understand you, then you have an app, which functionality depends on a config file, and you want to have two different icon for the two installation of the app.
In this case, you have to change the package name, if you want to have these apps to be installed simultaneously. If so, you could change the icon manually too.
In any other case, you cannot change the icon of an application in running time.
If you are using ActionBarSherlock, try this:
getSupportActionBar().setIcon(R.drawable.ic_launcher_two);
If not, try this:
getActionBar().setIcon(R.drawable.ic_ic_launcher_two);

Is there an easy way in eclipse to edit one version of icon and reflect the changes for all resolutions (hdpi, mdpi, xhdpi et al) at once ?

While working on Android projects I sometimes feel the need for editing my icons to cope up with the changes in theme and or background of activity / view that is going to hold it. The way I do it currently is I first remove the icon file from all the drawable folders and then create a new icon through launcher Icon wizard. I was wondering if there is a plugin or some way in eclipse to edit the icon and reflect the same changes for all the resolutions without the need for deleting and creating from scratch.
I researched in several forums and I dont think eclipse has any such capability as of now.

Categories

Resources