Open-event-droidgen: Adding speaker images in apk

Created on 26 May 2017  路  12Comments  路  Source: fossasia/open-event-droidgen

Actual Behaviour

As discussed in issue #1593 , our main aim is to allow event organiser to upload images either manually or using server code. Adding relevant code in generator.py .

Expected Behaviour

If images/speakers have speaker images they should be in the res folder.

Steps to reproduce it

-

LogCat for the issue

-

Screenshots of the issue

-

Would you like to work on the issue?

Yes

Target Milestone to solve the issue

https://github.com/fossasia/open-event-android/milestone/27

bug APK Generator

Most helpful comment

@m-murad it's completely upto the person who is creating the APK. We have the following cases

  • The user creates the app via an integration in the organizer server itself (yet to be implemented) - The app will not have images in it. All images will be referred to via a cloud storage URL
  • The user uploads a zip which has no images in the zip and instead images are referenced by cloud storage URL - The will not have images in the build
  • The user uploads a zip with speakers photos in it. Which means the user expects the app to be completely offline. Which is a reasonable requirement. So in this case the app will have images as a part of the build

So, we need this feature. It's completely upto the user to do what he/she prefers. We're just giving them the choice.

@arp95 please go ahead.

All 12 comments

Its ideal for an event having 10-20 speakers, but when there are too many speakers in 100s (like we have in fossasia summit or I/o) it will unnecessarily bloat the APK.

I don't think that including the images in the build is a good idea.

Then what should be the approach @m-murad ?

If a user uploads a zip with photographs, surely he is looking for these photos to be loaded in the app, or else he would have just used photo links in the JSON

No photos is worse than huge apk

Can i start working on this then?

Yes @arp95, but first let @niranjan94 approve

@m-murad it's completely upto the person who is creating the APK. We have the following cases

  • The user creates the app via an integration in the organizer server itself (yet to be implemented) - The app will not have images in it. All images will be referred to via a cloud storage URL
  • The user uploads a zip which has no images in the zip and instead images are referenced by cloud storage URL - The will not have images in the build
  • The user uploads a zip with speakers photos in it. Which means the user expects the app to be completely offline. Which is a reasonable requirement. So in this case the app will have images as a part of the build

So, we need this feature. It's completely upto the user to do what he/she prefers. We're just giving them the choice.

@arp95 please go ahead.

Let's discuss the approach really quickly @arp95

We need to take milestones more seriously. This is due tomorrow. How should we handle the checking of status of the zip. After that, the copying of images will hardly take half an hour of code

Earlier we added code for the assets part right. What we can do is put the images in the apk and if that folder doesnt exist, the apk wont have that folder. Or is there a better way of doing it?

That is the easy part. I was asking about the detection of 3 cases which Niranjan pointed out. How will we guess which case the zip belong to. Whether to include images or not

is there a way we can check whether images/speaker folder exist during runtime, because if it does we know that the organizer wants to include images otherwise not.

Yes there is, but there can be a case where there are images too and the image links in JSON are provided as server images. In this case, we'll want to use server links only

I guess for now, include the images if they are present. A suggestion, when you move the images, do it in drawable-nodpi as it does not impose any restriction on the size of images

Also look at PIL to compress the images so that no image exceeds 1 MB, or else there is a risk of OOM exception

no i think in that case we have to include the images too for offline mode i guess.
yes you are right, for now adding them as it is.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mahikaw picture mahikaw  路  7Comments

heysadboy picture heysadboy  路  3Comments

PareshMayani picture PareshMayani  路  5Comments

gogeta95 picture gogeta95  路  7Comments

97k picture 97k  路  5Comments