Getting Bitmap from drawable object

by Devin Yu » Wed, 14 Apr 2010 03:03:48 GMT


Sponsored Links
 Hi all,

I got a drawable object from Res ID. But I want to know its
coresponding bitmap file.
Any body can tell me how to do it?

Thanks.

--



Other Threads

1. Picasa API does not work as expected under Android

Hi,

I am using the latest google data api (1.40) and try to get all albums
for a user.

The feed is 
http://picasaweb.google.com/data/feed/api/user/....@gmail.com?kind=album

On a JavaSE environment it works fine (!!), returning all album
information
for that user. However on an AndroidOS the same code returns null!

After debugging the google data api I find out that getAdaptedEntry()
always returns null though AlbumEntries are available. Again it is
always null only when running on AndroidOS. By the way, retrieving an
album by id does also work on AndroidOS.

I use the methods provided in PicasawebClient (sample app). It does
not matter if I use

public List<AlbumEntry> getAlbums(String username) throws IOException,
      ServiceException {

    String albumUrl = API_PREFIX + username;
    UserFeed userFeed = getFeed(albumUrl, UserFeed.class);

    List<GphotoEntry> entries = userFeed.getEntries();
    List<AlbumEntry> albums = new ArrayList<AlbumEntry>();
    for (GphotoEntry entry : entries) {
      GphotoEntry adapted = entry.getAdaptedEntry();
      if (adapted instanceof AlbumEntry) {
        albums.add((AlbumEntry) adapted);
      }
    }
    return albums;
  }

from the PicasawebClient or change the method to

public List<AlbumEntry> getAlbums(String username) throws IOException,
      ServiceException {

    String albumUrl = API_PREFIX + username;
    UserFeed userFeed = getFeed(albumUrl, UserFeed.class);

    userFeed.getAlbumEntries();
    return albums;
  }

I set the use-permission for INTERNET access.

Any idea?

--

2. Gyrometer granularity and running app in background?

Hi,

  I've never developed for a mobile platform, so hopefully someone
could clear this up for me. I would like to develop an application
which implements the gyrometer. Is it possible to detect varying
degrees of 'shakiness' from a user as well as the direction? Or is
such a granular level not possible?
Also, is it possible to develop an application that runs in the
background, so that the user can use the phone as normal?

Thank you

--

3. Enabling Android.Speech

4. hi all query regarding alert

5. Usage Stats Data Storage

6. Calling another class/activity

7. Responding to a touch-screen motion...