i want to Create different layout depending api version as follows. Since the default folder layout is already available,when i create new layout as below screenshot it doesnt apppear in android studio folder list under res. but i right click on res and open with explorer those folder does shows. can any one please help me how to create those layout folder.
/res/layout/layout.xml (Default)
/res/layout-v14/layout.xml (Api 19)
/res/layout-v17/layout.xml (API 21)
I think the reason for not seeing the folders is due to the current viewing option you have selected in Android Studio. (please refer to the image below)
When Android is selected the folders are more compact, meaning it will focus on showing a single resource/folder regardless of qualifiers and I think that's what you experience. Switching to Project would solve it however.
This viewing option does have some great benefits by the way, for example I really love how gradle scripts are grouped together and it even shows the Global gradle.properties file (at least on MacOS) which it doesn't in Project view.
When I try to create action icon in Image Asset of Android Studio I saw the error log: Android.png does not exist and I can not create action icon. Anyone can help me?
screenshot
This issue can be resolved by:
Select Launcher Icons, definitely, there will be the previous linked file which was removed from the system. Just go there and choose some other file and the issue will be resolved automatically.
In my case it was an image wizard issue. Image asset wizard caches path to ic_launcher icon and can't find it.
To resolve it you need repick ic_launcher image file for background layer and/or/maybe foreground layer.
Also you can use such command line tool like ack to find all strings 'burma_launcher.png' and manually edit finded files
recommend that you use the material design style for action bar and tab icons, even if you support older Android versions. Use appcompat and other support libraries to deliver your material design UI to older platform versions.
As an alternative to Image Asset Studio, you can use Vector Asset Studio to create action bar and tab icons. Vector drawables are appropriate for simple icons and can reduce the size of your APK.
Because Android studio adds padding to custom icons(this is a known problem) i was playing with different images and putting them using File->new ImageAsset.
Now i have too many of same image.png in all folders.
Is there way to delete all corresponding images at once in all mipmap folders?
In Android Studio change your folder view from whatever it is (project/packages etc) to Android and it will group the similar images together in one file. All you have to do is delete the file
Nevermind, when you delete image from mipmap folder, android studio asks to delete all other corresponding images at once! solved
I downloaded collection of icons from Android Developers center
Each icon in this collection is ordered in forlders according to its resolution: drawable-hdpi, drawable-mdpi, drawable-xhdpi, drawable-xxhdpi.
Is there a way to import all the 4 icon's files in one action to Android Studio or I need to copy it one by one?
(when I used new->Image Asset , I had to fill a file path, I couldn't fill it with folder path)
Update 25/2/15:
According to this SO question, seems like there is a way to generate the 4 size of icons by Android Asset Studio, and then import the zip file directly to your Android Studio project res folder - has anyone used it?
Edit :
After Android Studios 1.5 android support Vector Asset Studio.
Follow this, which says:
To start Vector Asset Studio:
In Android Studio, open an Android app project.
In the Project window, select the Android view.
Right-click the res folder and select New > Vector Asset.
Old Answer
Go to Settings > Plugin > Browse Repository > Search Android Drawable Import
This plugin consists of 4 main features.
AndroidIcons Drawable Import
Material Icons Drawable Import
Scaled Drawable
Multisource-Drawable
How to Use Material Icons Drawable Import : (Android Studio 1.2)
Go to File > Setting > Other Settings > Android Drawable Import
Download Material Icon and select your downloaded path.
Now right click on project , New > Material Icon Import
Use your favorite drawable in your project.
Actually if you downloaded the icons pack from the android web site, you will see that you have one folder per resolution named drawable-mdpi etc.
Copy all folders into the res (not the drawable) folder in Android Studio. This will automatically make all the different resolution of the icon available.
For custom images you created yourself, you can do without the plugin:
Right click on res folder, selecting New > Image Asset. browse image file. Select the largest image you have.
It will create all densities for you. Make sure you select an original image, not an asset studio image with an alpha, or you will semi-transpartent it twice.
If for some reason you don't want to use the plugin, then here's the script you can use to copy the resources to your android studio project:
echo "..:: Copying resources ::.."
echo "Enter folder:"
read srcFolder
echo "Enter filename with extension:"
read srcFile
cp /Users/YOUR_USER/Downloads/material-design-icons-master/"$srcFolder"/drawable-xxxhdpi/"$srcFile" /Users/YOUR_USER/AndroidStudioProjects/YOUR_PROJECT/app/src/main/res/drawable-xxxhdpi/"$srcFile"/
echo "xxxhdpi copied"
cp /Users/YOUR_USER/Downloads/material-design-icons-master/"$srcFolder"/drawable-xxhdpi/"$srcFile" /Users/YOUR_USER/AndroidStudioProjects/YOUR_PROJECT/app/src/main/res/drawable-xxhdpi/"$srcFile"/
echo "xxhdpi copied"
cp /Users/YOUR_USER/Downloads/material-design-icons-master/"$srcFolder"/drawable-xhdpi/"$srcFile" /Users/YOUR_USER/AndroidStudioProjects/YOUR_PROJECT/app/src/main/res/drawable-xhdpi/"$srcFile"/
echo "xhdpi copied"
cp /Users/YOUR_USER/Downloads/material-design-icons-master/"$srcFolder"/drawable-hdpi/"$srcFile" /Users/YOUR_USER/AndroidStudioProjects/YOUR_PROJECT/app/src/main/res/drawable-hdpi/"$srcFile"/
echo "hdpi copied"
cp /Users/YOUR_USER/Downloads/material-design-icons-master/"$srcFolder"/drawable-mdpi/"$srcFile" /Users/YOUR_USER/AndroidStudioProjects/YOUR_PROJECT/app/src/main/res/drawable-mdpi/"$srcFile"/
echo "mdpi copied"
Newer versions of Android support vector graphics, which is preferred over PNG icons. Android Studio 2.1.2 (and probably earlier versions) comes with Vector Asset Studio, which will automatically create PNG files for vector graphics that you add.
The Vector Asset Studio supports importing vector icons from the SDK, as well as your own SVG files.
This article describes Vector Asset Studio:
https://developer.android.com/studio/write/vector-asset-studio.html
Summary for how to add a vector graphic with PNG files (partially copied from that URL):
In the Project window, select the Android view.
Right-click the res folder and select New > Vector Asset.
The Material Icon radio button should be selected; then click Choose
Select your icon, tweak any settings you need to tweak, and Finish.
Depending on your settings (see article), PNGs are generated during build at the app/build/generated/res/pngs/debug/ folder.
just like Gregory Seront said here:
Actually if you downloaded the icons pack from the android web site, you will see that you have one folder per resolution named drawable-mdpi etc. Copy all folders into the res (not the drawable) folder in Android Studio. This will automatically make all the different resolution of the icon available.
but if your not getting the images from a generator site (maybe your UX team provides them), just make sure your folders are named drawable-hdpi, drawable-mdpi, etc. then in mac select all folders by holding shift and then copy them (DO NOT DRAG). Paste the folders into the res folder. android will take care of the rest and copy all drawables into the correct folder.
Since Android Studio 3.4, there is a new tool called Resource manager. It supports importing many drawables at once (vectors, pngs, ...) . Follow the official documentation.
what u need to do is icons downloaded from material design, open that folder there are lots of icons categories specified, open any of it choose any icon and go to this folder -> drawable-anydpi-v21. this folder contains xml files copy any xml file and paste it to this location ->
C:\Users\Username\AndroidStudioProjects\ur project name\app\src\main\res\drawable. That's it !! now you can use the icon in ur project.
Since upgrading to Windows 8.1 from Windows 8 I've noticed the colour of the tiles looks awful, is there a way to change these that is...
Free
Doesn't involve hacking around with registry/XML files
As you can see below my GIT icons are barely visible :(
I don't have a non XML Solution, but the XML solution is quite easy to follow and could easily be converted into a tool.
For example to change the background of the GIT Bash tile:
the shorcut of the tile links to something like: "C:\Program Files (x86)\Git\bin\sh.exe" --login -i (to find the shortcut: right click -> goto location)
Go to the folder of the executable (here C:\Program Files (x86)\Git\bin)
Create a sh.visualelementsmanifest.xml with the content:
<Application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<VisualElements
BackgroundColor="maroon"
ShowNameOnSquare150x150Logo="on"
ForegroundText="light"/>
</Application>
(full spec at http://msdn.microsoft.com/en-us/library/windows/apps/dn393983.aspx)
Update the shorcut file time stamp (e.g. copy file, delete old file)
Enjoy new tile. For example:
In reference to Xyroid's answer which has - so far - received no points, maybe this is because the link has changed / gone.
OblyTile, for those who want a GUI to manage Tile design, works perfectly on my Windows 8.1
The link to this is:
http://forum.xda-developers.com/showthread.php?t=1899865
In particular, the developer has provided much improved icons for some internal windows apps (e.g. Control Panel) where the standard tile doesn't really match the design of the other Modern App tiles.
(I would have just added a comment, but I still need more reputation)!
According to Desktop App Tiles on the Start Screen, the background color of desktop app's Start menu tile is derived from the user's chosen background color, so try changing Start menu's background color.
Also checkout
How to customize tiles (change/bigger icon, change color) for desktop applications in the Start Screen?
How to Create Custom Windows 8 Tile Icons for Any Desktop Program