Showing posts with label Icon. Show all posts
Showing posts with label Icon. Show all posts
How to Declare and Set a Drawable to an Integer object
1. Add a drawable to your project named myicon.
2. In the MainActivity.java file, add the below line to the onCreate method.
int myIcon = R.drawable.myicon;
3. Compile and run!
Next Recommended Article:
Change your Launcher Icon
1. Create an Android project, if you don't already have one.
2. Find or Create a new launcher icon for you Android app.
This site has some free Android icons: http://www.iconspedia.com/
Create a new launcher icon with Android Asset Studio.
3. Navigate to the res directory in your project. The folders below should be located in the res folder. If they are not, please create these directories under res.
res\drawable-hdpi
res\drawable-mdpi
res\drawable-xhdpi
res\drawable-xxhdpi
res\drawable-xxxhdpi
It is not required to have images for all the densities, only one is enough. The system will scale it up/down when needed. So the best approach is to have images for the highest density supported (xhdpi or xxhdpi). Some people only use xhdpi images in their projects. Try to design your graphics at a very high resolution, such as 300dpi so the image will look good on many resolutions.
4. Copy your new icon to each directory above. The file should be called ic_launcher.png and that
simply replaces the current launcher icon.
5. Compile and run!
Resources:simply replaces the current launcher icon.
5. Compile and run!
http://www.iconspedia.com/icon/lego-crash-test-dummy-icon-36874.html
http://stackoverflow.com/questions/16968203/is-there-a-point-having-res-drawable-ldpi-in-android
Subscribe to:
Posts (Atom)
Popular Posts
- Solution: Running Android Lint has encountered a problem Failed
- Perform an Action after Enter keypress on EditText
- How to Declare a URLConnection object
- How to Get a new HttpURLConnection
- How to Create a ProGuard Exception
- How to Get a new URL Connection
- How to Reference a Library in your Project
- How to Register an Activity that Responds to NFC tags for URI's that point to a URL
- How to Import a Library
- How to Open the SDK Manager