ushahidi / Ushahidi_Android

[Deprecated] Ushahidi Android app For Ushahidi V2.x.x. Working on V3.x.x at
https://github.com/ushahidi/platform-android/
GNU Lesser General Public License v3.0
202 stars 153 forks source link

Ushahidi android app v3.9, MAJOR BUG #166

Open Robzter opened 10 years ago

Robzter commented 10 years ago

the server show report with right photo but at the android app, some photos are repeated or wrong.

when refreshing the images change to repeated or wrong again.. the server is always showing the correct ones.

This is a MAJOR bug and needs to be fixed ASAP please assist with this.

Thanks

alessandronunes commented 9 years ago

Any predictions on when it will be released the new version? Or could @eyedol show some easy fix for this? Thanks!

alessandronunes commented 9 years ago

I found the problem. On file ReportsApi.java, line 102, the fileName is using the date/time to create the name for the saved photos. It creates a mess, once a lot of pictures are saved on the same second, with the same name.

My fix is just replace the line:

final String fileName = Util.getDateTime() + ".jpg";

By:

String fileName = m.getLinkUrl().substring(m.getLinkUrl().lastIndexOf('/')+1, m.getLinkUrl().length());

Saving the picture with the same name on the server.

eyedol commented 9 years ago

@alessandronunes mind sharing a PR?

alessandronunes commented 9 years ago

PR?

Rszotak commented 9 years ago

Will submit push request with change and documentation shortly...

Rszotak commented 9 years ago

Pull request committed, changed date time descriptor for file names to specific URL, similar to alessandronunes with the minor difference of making the String final.