Android :: Launch Local Drawable Resource In Gallery Application Using Intents
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
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
View Related
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
Jul 26, 2010
All of the android examples for XmlPullParser pull from a local resource file, and all of the SAX examples pull the XML from a URL. I've been told SAX is faster, so I'm trying to use that to pull data from a local resource file (res/xml/thefile.xml)
The example code I'm working off of is here. So in that example, the code I want to change is:
URL url = new URL("http://example.com/example.xml");
...
xr.parse(new InputSource(url.openStream()));
Instead of using URL, I want to use getXml(R.xml.thefile)
Is that possible, or does SAX need to get data from a URL?
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
Mar 30, 2009
How do you pass an intent from a service to a new activity launched from a main activity? There's a passextra( intent src ); but I don't think thats what I am looking for?
activity main > start service( intent wuteverserviceintent );
activity main > start activity( intent newactivityintent );
View 2 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
Nov 11, 2010
I published an application that stores data in a local database.
Now I have to publish an update to this application to fix some little bugs, but I am afraid that downloading and installing the update will delate the local database associated with the previous version.
I would like to know how the update system works. Will installing an update completely delete all the apk, files, databases associeted with the previous version?
If so, how can I avoid this in my code?
View 2 Replies
View Related
Mar 2, 2010
What is more expensive to load in a Gallery, a Bitmap or Drawable???
View 1 Replies
View Related
Aug 12, 2010
I am trying to get a input stream from something like this.
CODE:.........
And then call parse on the parser instance i Created. SOm how i get nothing . Works fine if I use a server XML....
View 1 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
Jan 23, 2010
I wonder if this is a bug. This code works on Android 1.x, but fails on 2.x, generating a SecurityException whose explanation seems to have a null String in it where it means to describe the missing permission:
CODE:.............
I think that perhaps the issue is that the classname's prefix (com.android.camera) is not the same as the package name (com.android.gallery).
Can someone comment on what permission (if any) would actually permit this to work on Android 2.x?
The code is thuslike:
CODE:......................
View 5 Replies
View Related
Jul 28, 2009
My application has buttons to launch gallery and video camera apps but the below code only seems to work on phones with the standard Cupcake build:
// For Gallery Intent intent = new Intent(); intent.setClassName("com.android.camera", "com.android.camera.GalleryPicker");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent);
// For Video Camera Intent intent = new Intent(); intent.setClassName("com.android.camera", "com.android.camera.VideoCamera"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mContext.startActivity(intent);
On rooted / non-cupcake phones, I get this error:
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.camera/com.android.camera.VideoCamera};
have you declared this activity in your AndroidManifest.xml? at android.app.Instrumentation.checkStartActivityResult (Instrumentation.java:1480) at android.app.Instrumentation.execStartActivity(Instrumentation.java: 1454) at android.app.Activity.startActivityForResult(Activity.java:2656) at android.app.Activity.startActivity(Activity.java:2700)
View 3 Replies
View Related
Sep 17, 2009
I use latest android sdk 1.6_r1 i launch the emulator(with the avd comes with sdcard ) then using adb push to push some videos and pictures onto sdcard because i cannot insert/eject sdcard on emulator so i reboot it after reboot, Gallery can find my videos and pictures just inserted now i want to push more pictures to sdcard so i reboot it after pushing files to sdcard but now Gallery cannot find the newer files after i check with adb i found the files i pushed in 2nd time all of them are of length 0 , so i think Gallery cannot read these files so my problem is Why the files i push to sdcard have zero size after i launch Gallery?
View 2 Replies
View Related
Jul 14, 2010
I have few intents in my manifest file and an AIR application. How can I instantiate AIR application from android.
View 3 Replies
View Related
Aug 29, 2010
Was trying to call another application using an *explicit* intent, but am finding it does not seem possible. I do not wish to use implicit intents. To test it out, try calling the YouTube main activity.
Intent i = new Intent(); ComponentName cn = new ComponentName("com.google.android.youtube","com.google.android.youtube.HomeActivity.class"); i.setComponent(cn); startActivity(i);
I get this error:
08-29 00:54:26.598: ERROR/AndroidRuntime(7332): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.google.android.youtube/ com.google.android.youtube.HomeActivity.class}; have you declared this activity in your AndroidManifest.xml? Does anyone know whether this is possible? (using explicit intents to call another application)
View 3 Replies
View Related
Jan 17, 2010
I have an application that uses a lot of png textures. There are too many to store with the app, so they are installed onto the SDCARD instead. The problem is that the default android gallery is seeing the png textures and is cluttering up the user's gallery screens with them. Is there a way to mark this resource folder in a particular manner so that Gallery will skip over it? Ideally, i'd like this to be something that my app can set so that the user doesn't have to do it.
View 3 Replies
View Related
Aug 20, 2010
Is there a way to replace the scrollbar drawable in an application (i.e. I have a customized scrollbar view that I would like to use instead of the default gray scrollbar that comes with the Android framework). I looked through I believe all of the android attributes and none seem to support it (at least the simplest way I know how which I would assume would be setting a drawable to some android attribute). If not and say it requires a change in the framework, where would I start looking for it (in the framework)?
View 1 Replies
View Related
Nov 7, 2009
I have some code that is creating and removing alarms, and which works great in Android 1.5 and 1.6 but breaks on the Android 2.0 AVD.The code that's giving this exception is: Code...
View 3 Replies
View Related
Jun 11, 2010
I dont want just news. i want to look at the TV channel (video) any program to access local TV ?
View 1 Replies
View Related
Jan 27, 2010
I am buiding an Android app, and I have a problem to get resource from string.xml.
I need to have an URL in String.xml that will be used several times through the app.
I tried Resources.getText("my_url"), but this does not work. Eclipse complains when I use this.
Do you think this is the best way to do ?
View 2 Replies
View Related
Oct 19, 2010
How do i load a local image from android assets from a generated (php) server-side html file?
eg.
>
img src="file:///android_asset/calendar-date-icon.png">
-or-
background:#ffffff url(file:///android_asset/calendar-date-icon.png)no-repeat;
cannot get either to work
View 1 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