Loading media from another applications resources

All your problems with Audio, Video and Images.

Loading media from another applications resources

Postby samaldis » Wed Jan 13, 2010 1:11 pm

I have been trying to work this one out for a few days now,
I'm attempting to load an mp3 from another apk file (which i created
and so have all the information for).
but i keep hitting errors, here is my code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. PackageManager pm = mContext.getPackageManager();
  2.  
  3. Resources res2 = pm.getResourcesForApplication(pm.getApplicationInfo(mSongID, 0));
  4.  
  5. mSongId = res2.getIdentifier("song", "raw", mSongID);
  6.  
  7. Log.e("Got Resource", "" + mSongId);
  8.  
  9. mp = MediaPlayer.create(mContext, mSongId);
Parsed in 0.032 seconds, using GeSHi 1.0.8.4


if anyone could point out what i've done wrong or if it is even possible with the current
framework?
Thanks,
Sam Aldis
samaldis
Freshman
Freshman
 
Posts: 6
Joined: Wed Jan 28, 2009 1:23 am
Location: Worcester, UK

Top

Postby samaldis » Wed Jan 13, 2010 1:26 pm

At the moment im getting

Code: Select all
Got Resource       2130968576
MediaPlayer         info/warning (1, 44)
MediaPlayer         Info (1, 44)
samaldis
Freshman
Freshman
 
Posts: 6
Joined: Wed Jan 28, 2009 1:23 am
Location: Worcester, UK

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: TurnitinBot [Bot] and 11 guests