Android Question Help Mp3 Player

ibra939

Active Member
Licensed User
Longtime User
I create mp3 player android app as
bKK6QZrqlVwrImQlQxcpfPG13Mc3ZN1Rh4SILNWENcXzGwYnna2_g-AZ3lfXvGjdeQ=h900



But i want add link button link (URL) for making download directly
can any body help me ??? :eek:o_O:rolleyes:
 

DonManfred

Expert
Licensed User
Longtime User
Assuming the list is a customlistview (i dont know and without seeing any code you are using it is hard to give advices!)

If you know the url of this song you simple need to build a button on each item and on buttonclick you can use httputils2 to download that song
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
yes but The file is downloaded to a temporary folder.How i do ( You should use File.Copy2 together with Job.GetInputStream to copy the file.) ???

to make sure the file download it???
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Please note that usually for the size of an mp3 you do not need the service solution
You can simply use a httputils-job for such small files

But from principle it works like

B4X:
Dim OutStream As OutputStream
Log("DownloadReady: "&job.Tag)
OutStream = File.OpenOutput(File.DirRootExternal, job.Tag, False) ' Job.Tag is read to set the Original Filename we specify earlier in the creation of the Job
File.Copy2(job.GetInputStream,OutStream) ' save the file
OutStream.Close
Log(job.Tag&" written to "&File.DirRootExternal) ' Write the Originalname to the log to see what happens ;-)

Please note that this is an code from an app written by me using httputils-lib. And i´m storing the filename in the Tag of the job...

You need to fit this code to your needs!!
 
Last edited:
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Please note that usually for the size of an mp3 you do not need the service solution
You can simply use a httputils-job for such small files

But from principle it works like

B4X:
Dim OutStream As OutputStream
Log("DownloadReady: "&job.Tag)
OutStream = File.OpenOutput(File.DirRootExternal, job.Tag, False) ' Job.Tag is read to set the Original Filename we specify earlier in the creation of the Job
File.Copy2(job.GetInputStream,OutStream) ' save the file
OutStream.Close
Log(job.Tag&" written to "&File.DirRootExternal) ' Write the Originalname to the log to see what happens ;-)

Please note that this is an code from an app written by me using httputils-lib. And i´m storing the filename in the Tag of the job...

You need to fit this code to your needs!!


i will tested .........
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Please note that usually for the size of an mp3 you do not need the service solution
You can simply use a httputils-job for such small files

But from principle it works like

B4X:
Dim OutStream As OutputStream
Log("DownloadReady: "&job.Tag)
OutStream = File.OpenOutput(File.DirRootExternal, job.Tag, False) ' Job.Tag is read to set the Original Filename we specify earlier in the creation of the Job
File.Copy2(job.GetInputStream,OutStream) ' save the file
OutStream.Close
Log(job.Tag&" written to "&File.DirRootExternal) ' Write the Originalname to the log to see what happens ;-)

Please note that this is an code from an app written by me using httputils-lib. And i´m storing the filename in the Tag of the job...

You need to fit this code to your needs!!

I try it working yet ?
 

Attachments

  • 1212.png
    1212.png
    29.7 KB · Views: 214
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
screen problem
 

Attachments

  • Screenshot_2014-10-25-21-44-25.png
    Screenshot_2014-10-25-21-44-25.png
    104.8 KB · Views: 215
  • Problems.zip
    11.6 KB · Views: 184
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
sorry Erel but this require the mp3 player program reqirment

Then you should start writing your own code instead hoping OTHERS will do the job for you!!
When i look at your problemcode i see my code and erels code from an other thread pasted unchanged in cour code.

As i said in my post #7 the code i posted is NOT a solution for you. It shows you the principle and i told you need to fit the code to your needs too.

I´m out here
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
Then you should start writing your own code instead hoping OTHERS will do the job for you!!
When i look at your problemcode i see my code and erels code from an other thread pasted unchanged in cour code.

As i said in my post #7 the code i posted is NOT a solution for you. It shows you the principle and i told you need to fit the code to your needs too.

I´m out here

I edit the code but the mean problem mp3 more then 1024 kb not allowed to download ..... thank you DonManfred
 
Upvote 0
Top