Android :: How To Use Inbuilt Drawable Resource?
Oct 10, 2009
I need to use some inbuild drawable I found in
http://developer.android.com/reference/android/R.drawable.html
I set drawable @drawable/ic_input_add to a button in my layout xml file. The add icon appears on the button of layout editor. But there is a error of that xml file said that
Description Resource Path Location Type ERROR Error: No resource found that matches the given name (at 'drawableLeft' with value '@drawable/ic_input_add'). spend_list.xml / AccountBook/res/layout line 5 Android AAPT Problem. How to use a inbuild drawable?
View 3 Replies
Aug 21, 2009
I have some image names stored in a database, but the images themselves are in the /res/drawable folder of the application. I need to assign these images to some views at runtime, and I'm currently doing it this way:
// public static final String DRAWABLES_PATH = ":drawable/";
int resId = getResources().getIdentifier(packageName+DRAWABLES_PATH +imageName,null,null); mButtonX.setBackgroundResource(resId); //
Is there a more efficient way to do it? Or should I be storing the images directly in the database (they are many)?
View 2 Replies
View Related
Dec 17, 2009
I need to create a tiled drawable using BitmapDrawable but I need to create it from xml resource rather than code.
View 3 Replies
View Related
May 13, 2010
I would like to get a byte array from an jpeg image located in my res/drawable file?
View 3 Replies
View Related
Feb 28, 2010
I have:
String uri = "@drawable/myresource.png";
How can I load that in ImageView? this.setImageDrawable?
View 2 Replies
View Related
Oct 19, 2010
Does all resource (all in res folder if on eclipse IDE), specially drawable image, is loaded to memory during runtime? Or it is just like a file which is available when the application need it?
View 1 Replies
View Related
May 2, 2010
I am trying to create a drawable in code and change the color based on some criteria. When I try and set the Drawable as the background of the ImageView it displays but won't let me set any padding. I realized I need to set the ImageView image via the setImageDrawable() function in order to be able to set the padding. The problem I am running into is that when I set it via the setImageDrawable() function nothing is displayed.
Here is what I have written:
<?xml version="1.0" encoding="utf-8"?>
ImageView icon = (ImageView) row.findViewById(R.id.icon);
ShapeDrawable mDrawable; int x = 0; int y = 0;
int width = 50; int height = 50;
float[] outerR = new float[] { 12, 12, 12, 12, 12, 12, 12, 12 };
mDrawable = new ShapeDrawable(new RoundRectShape(outerR, null, null));
mDrawable.setBounds(x, y+height, x + width, y);
switch(position){ case 0: mDrawable.getPaint().setColor(0xffff0000); //Red break;
case 1: mDrawable.getPaint().setColor(0xffff0000); //Red break;
case 2: mDrawable.getPaint().setColor(0xff00c000); //Green break;
case 3: mDrawable.getPaint().setColor(0xff00c000); //Green break;
case 4: mDrawable.getPaint().setColor(0xff0000ff); //Blue break;
case 5: mDrawable.getPaint().setColor(0xff0000ff); //Blue break;
case 6: mDrawable.getPaint().setColor(0xff696969); //Gray break;
case 7: mDrawable.getPaint().setColor(0xff696969); //Gray break;
case 8: mDrawable.getPaint().setColor(0xffffff00); //Yellow break;
case 9: mDrawable.getPaint().setColor(0xff8b4513); //Brown break;
case 10: mDrawable.getPaint().setColor(0xff8b4513); //Brown break;
case 11: mDrawable.getPaint().setColor(0xff8b4513); //Brown break;
case 12: mDrawable.getPaint().setColor(0xffa020f0); //Purple break;
case 13: mDrawable.getPaint().setColor(0xffff0000); //Red break;
case 14: mDrawable.getPaint().setColor(0xffffd700); //Gold break;
case 15: mDrawable.getPaint().setColor(0xffff6600); //Orange break;
} icon.setImageDrawable(mDrawable); icon.setPadding(5, 5, 5, 5);
This results in a space for the ImageView but no image.
View 1 Replies
View Related
Aug 18, 2009
I tried doing a ProgressBar and I wanted to change the background and the progress bar using my own drawables from the drawable resource. Is this possible? I just don't want to spend time creating my own custom component if can be done relatively easy.
View 4 Replies
View Related
Nov 2, 2010
I'm going to be using
setBackgroundResource(R.drawable.background)
in my onCreate() method.
When I create the XML file with the and its colors, what type of resource am I creating? "values", "layout"?
View 1 Replies
View Related
May 28, 2010
Can I have sub-folders to hold my drawable resources. For example can I store an image in, say, 'res/drawable/content/images/myimage.jpg' and then find that resource via a call to:
id = context.getResources().getIdentifier("com.mycompany.myprog:drawable/ content/images/myimage", null, null);
I have tried this and it doesn't seem to be working (but I may have something wrong). Is it supposed to work or do all the resources need to be in the root drawable folder? Also, are jpeg files supported and drawable resources?
View 5 Replies
View Related
Oct 5, 2009
Is it possible to have subfolders in the /res/drawable directory. I would like my resources to be organized in a tree view and not in a flat dir. If it is possible so how do I reference the resource from the code?
View 3 Replies
View Related
Sep 1, 2010
I have an app with locally stored .jpg files. I would like to be able to send the images (1 at a time, on user interaction) to the Gallery app's activity using an explicit intent.
View 3 Replies
View Related
May 14, 2010
Does anyone know the syntax for an XML file for a single bitmap drawable resource? What I'm looking to do is "alias" a drawable in my app. I have need for the same image with 2 different names, and rather than including the image twice in my res/drawable directory, I'd rather alias it (it's fairly large). In other words, instead of:
res/drawable/name1.png res/drawable/name2.png
I'd like to have:
res/drawable/name1.png res/drawable/name2.xml
where name2.xml looks SOMETHING like this:
<?xml version="1.0" encoding="UTF-8" ?> <bitmap src="@drawable/name1" />
Is this possible? If so, any idea what the syntax should be? I can't find it in the docs, and I've had no luck with trial-and-error.
You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
View 6 Replies
View Related
Oct 19, 2010
I am running my application in the emulator using a high density skin (like WVGA800). However the ressources in my application are loaded from the drawable- mdpi folder instead of drawable-hdpi ... what else should I do so that android use the correct folder ?
View 4 Replies
View Related
Aug 3, 2010
I have an XML resource file:
<resources> <section>
<category value="1" resourceId="@xml/categoryData1" />
<category value="2" resourceId="@xml/categoryData2" />
<category value="3" resourceId="@xml/categoryData3" />
</section> </resources>
Using XmlPullParser, on the START_TAG, I can use:
int value = parser.getAttributeIntValue(null, "value", 0);
to get values 1, 2, 3...however:
int resourceId = parser.getAttributeIntValue(null, "resourceId", 0);
doesn't work...it just yields the default value 0, or whatever I change the default value (3rd parameter) to be. Does anyone know what I am doing wrong or if this is possible?
View 1 Replies
View Related
Jul 29, 2009
I want to design an application that would use the android's inbuilt "Maps " application . I want to add the extra functionality to this application . Like , in my application , It would take 2 User inputs (i) Where the user currently is (ii) and where he wants to go (destination) . and I'll show the public transport options available for his journey . ( I'll hard code this part of the program) . But I want this application to have an extra functionality that this application will also show the traffic route of his journey . but for this part I want to use the inbuilt "Maps" application . Is there any way I can do that .
View 2 Replies
View Related
Apr 4, 2010
Could someone tell me how we could use the inbuilt camcorder api for our applications? I am trying to use the camcorder application to record videos for my own application. I would really appreciate an example of how to use it.
View 5 Replies
View Related
Jun 25, 2010
Like the Eclipse has a nice graphics integration runner for Android Test project, which does show how tests have run and what the errors or.. is there a built in (which runs with in Android simulator) test runner or any open source version of test ruuners pl.
Command Line version which runs though ADB is horrible.. had to search to even to figure out how many tests have run and what their fate is :)
View 2 Replies
View Related
Jul 17, 2010
Smart-phones have built in ROM and RAM separately. Also a few phones has virtual memory support too. I would like to know what these memories are basically used for. I understand that RAM is available to user processes. But why do they have a big chunk of ROM? E.g. The wiki page for Droid Incredible says
512 MB DDR RAM
1 GB ROM (748 MB free to user) - what's this free to user?
plus 8 GB moviNAND - typically used for data storage
View 1 Replies
View Related
May 31, 2010
I am using vpnc on my computer to connect on my university VPN. Once again, the configuration is not straightforward, but, mainly, I use IPSec, I have an ID for the VPN, a gateway URL, a secret word, IKE Authmode of PSK, IKE DH Group, Xauth username, Xauth password, I need to enable Single DES, and I have two 'target networks'.
The fact is that Android (2.1)'s built-in VPN does not ask me all these info. It keeps asking for a pre-shared key (this is evidently the contrary of the certificate method), but I do not have such a pre-shared key. Connecting (to the VPN) through my computer works perfectly. What can I do to make Android compatible with the VPN?
View 2 Replies
View Related
Oct 8, 2009
Being a newbie to Android I can't work out how to call the camera application (or you can say camera preview?) when I click a button in my custom application.
View 1 Replies
View Related
Nov 18, 2009
Is there any inbuilt function to load PDF or DOC file.. Tried using Webview but content was not displayed...
View 7 Replies
View Related
May 12, 2010
I wanted to know whether we can call Android's inbuilt ContactList. ?
View 1 Replies
View Related
Oct 19, 2010
I want to use a function for image recognition i don't want to make an algorithm.
please suggest me a function where i could compare two images and tell whether these images belong to the same object.
View 3 Replies
View Related
Apr 8, 2010
I want to add a external third party jar file in the inbuilt android app.I've added the LOCAL_CLASSPATH variable in Android.mk due to which the compilation goes fine. But during runtime, it is not able to find the class definiation which is in the JAR.Which is the variable I need to set to add the third party JARs in the .dex/.apk ?
View 3 Replies
View Related
Oct 18, 2010
Does anyone use them and are they still needed? I have heard that Android has built in virus protection. In another I read that Android is not capable of getting viruses. Can anyone elaborate on this?
View 3 Replies
View Related
Dec 9, 2009
I am trying to look for a torrent solution. I have transdroid right now, and it is able to communicate with my seedbox and I can manage torrents that are already loaded on there. My problem is adding new torrents from my private websites. I have noticed that torrent-fu will allow you to search some of the public websites for new torrents, but that doesn't work for me. Right now I have to download the .torrrent file with my default browser.
And it saves the file as "unknown.torrent" then I have to open it with transdroid. This question is worded weird, but basically what I would like, is a torrent app with built in private torrent site searching / downloading. Or the ability to have my dolphin browser, recognise the .torrent extension, and associate transdroid with that.
View 1 Replies
View Related
Jan 18, 2013
I saw some previous posts on not using the task killers etc.... I wanted to ask whether one should end a particular ongoing active process or not or even for that matter "end all" active applications..... I know these active apps don't have any CPU usage but active apps r meant to use power rite? So should I use end or end all in the inbuilt task manager/power monitor widget or not to save my battery usage??
View 7 Replies
View Related
Jul 3, 2010
I was wondering, is there anyway a developer can hide or exclude a certain app permissions from being seen by Android market users? And are the permissions for an app controlled or regulated by Google? Another question I have - Is there anyway to restrict PDF files from opening in the default browser? This is a problem when I am on a search engine and accidentally click a link that's a pdf file- I don't want pdf's downloaded without asking me permission atleast. And my last question, is there a way to view current extensions that are installed in the browser.? Where is androids inbuilt file manager? Does uninstalling an application completely take off everything related to that app from your phone?
View 2 Replies
View Related
Nov 19, 2010
Its happy to see that there is a inbuilt battery status widget in android 2.1. But sometimes it hangs and % value isn't changing in widget. At the same time its working correctly in
Settings ----> About phone ----> status ----> battery level
If I restarts the phone widget is also working.
View 1 Replies
View Related