Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends,

I am facing some problem with download percentage for files in android. When i am downloading 1st file then it completely downloaded and showing progress 100% but for next file it stopped only on 99% and then after nothing happening for long time and i am also not able to read that file. Here is my code that i am using for percentage progress:

What I have tried:

C#
lenghtOfFile = (int) entity.getContentLength();


C#
int count;
                byte data[] = new byte[1024];
                long total = 0;
                while ((count = inputStream.read(data)) != -1) {
                    total += count;
                    publishProgress(Integer.valueOf("" + (int) ((total * 100) / lenghtOfFile)));
                }
Posted
Updated 8-Aug-16 7:39am

1 solution

I think you can use ION [^]to avoid such complexity(a.k.a do the whole things ownself).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900