Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:25:32+00:00 2026-06-07T23:25:32+00:00

How do I add a cover art (album art) to a downloaded mp3 programmatically?

  • 0

How do I add a cover art (album art) to a downloaded mp3 programmatically?

I am letting my app download a mp3 file via the DownloadManager from the Android APIS as shown below:

private void startDownload(){
    Uri uri = Uri.parse(BASE_URL+DOWNLOAD+mp3+".mp3");

    filename = title+".mp3";

    Request request = new DownloadManager.Request(uri)
    .setDestinationInExternalPublicDir(MUSIC_PATH, filename);

    DOWNLOAD_MANAGER.enqueue(request);
}

Is it possible to add a coverart to the downloaded mp3 file, so that the mp3 player on the phone will show a image while playing the song?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:25:35+00:00Added an answer on June 7, 2026 at 11:25 pm

    Download this jar file MyID3_for_android and add it to your project’s build path. here is a sample code of how you can change the cover

            File src = new File("filepath");
            MusicMetadataSet src_set = new MyID3().read(src);
    
            File img = (new File("imagePath"));
    
    
            Vector<ImageData> fileList = new Vector<ImageData>();
            ImageData data = new ImageData(readFile(img), "", "", 3);
            fileList.add(data);
    
            MusicMetadata metadata =  (MusicMetadata) src_set.getSimplified();
            metadata.setPictureList(fileList);
    
            File dst = new File("destinationPath");
    
            new MyID3().write(src, dst, src_set, metadata); 
    

    You Will need also the Jakarta Regex jar

    readFile is only a function to get byte[] from File

    public static byte[] readFile (File file) throws IOException {
        // Open file
        RandomAccessFile f = new RandomAccessFile(file, "r");
    
        try {
            // Get and check length
            long longlength = f.length();
            int length = (int) longlength;
            if (length != longlength) throw new IOException("File size >= 2 GB");
    
            // Read file and return data
            byte[] data = new byte[length];
            f.readFully(data);
            return data;
        }
        finally {
            f.close();
        }
    }
    

    Got it from stackOverflow , dont know from who 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to add tests to the gobject-introspection test suite to cover more of the
I need to programmatically add additional graphical elements onto an existing, static PDF book
I added a blob field to add an image to my MYSQL database via
I created a button in my cover.h file for my first view #import <UIKit/UIKit.h>
I want to add a scheduled task to a client's ASP.NET app. These posts
I have a page to add new article. Fields accepted from user are: article
I want to fetch Images from my URL and add it to the radio
I want add shadow/cover (I'm not sure how to name it) to my div,
I am trying to add a cover photo above a UITableView, so that the
I want to add a UIView to another UIView so that child view covers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.