Open-event-droidgen: App generated using zip is not able to fetch latest data

Created on 25 May 2017  路  16Comments  路  Source: fossasia/open-event-droidgen

Actual Behaviour

App generated using zip is not able to fetch updated/latest data because if app is generated using zip then api end point is null. Api end point is used to fetch latest data.

Expected Behaviour

If app is generated using zip it should also able to fetch latest event data.

Steps to reproduce it

Generate app using zip file provided in sample

LogCat for the issue

GET http://abc//tracks http/1.1 HTTP FAILED: java.net.UnknownHostException: Unable to resolve host "abc": No address associated with hostname

Screenshots of the issue

zip_error

Would you like to work on the issue?

Yes

Target Milestone to solve the issue

Milestone 4

bug APK Generator

All 16 comments

Which sample. Please be specific

I think for all because in app generator implementation if zip is provided we are not storing api url

It should be. It was replacing the last time I checked. I'll recheck. Thanks

It is assigning the API link to the config json

https://github.com/fossasia/open-event-android/blob/development/apk-generator/v2/app/generator/generator.py#L123

Can you please extract the generated apk and see the config.json in assets and match the API link in the event zip?

For fixing it while generating app we can check if api end point is not specified we can get api end point from event.json using id and use it.

api end point will be https://eventyay.com/api/v1/events/ + id

It happens so that the apk is having default eventyay.com as API link, which is obvious

"https://eventyay.com/api/v1/events/6/"

Your log shows abc/
That means the event you tried had wrong API link

Please confirm

@Shailesh351 It isn't necessary that every event is hosted on EventYay

Just as this apk is a template. Server is also provided so that organisers can host on their own, so your solution isn't feasible

Got it, but please tell which event did you try

https://github.com/fossasia/open-event/blob/master/sample/FOSSASIA16.zip

I think problem will be for all samples , because in app generator we have implemented radio button so we can use either api end point or zip.

and if zip is selected then api end point will be null.
So we have to get api end point from event id.

What's your thought @mariobehling @the-dagger @mananwason @niranjan94 ?

But we can't guess the API link from id because it may be myevent.areeb.com/events/43 for ID 43 for all it matters

Yes true. we can have SERVER_BASE_URL+/api/v1/events/+id

We have to think better approach if any so that it don't create problem in future.

So solution i have for now

There are three cases
1) Zip is exported using server(we have api endpoint)
2) Zip is generated by user (no api endpoint)
3) Zip is generated by user (but user wants to use api endpoint like @arp95 created google_io sample by adding api link in config.json)

We can check if zip is generated using server or user manually created it using meta file.
If meta file is there we can say that zip is generated using server else manually by user.

We can add one field in config.json showing how zip is generated.

If zip is generated using server we have meta file which contains root_url (base url of the server from which event was exported) Reference
So while generating app we can get api end point using : root_url + /api/v1/events/+ {event_id}

And in generic app we can make changes accordingly.

@arp95 @iamareebjamal @mahikaw @rohanagarwal94 @heysadboy
@niranjan94 @the-dagger @mananwason @mariobehling please suggest better solution if any

@Shailesh351 the meta file should always be present if it is a zip. It's part of the Open Event archive Format

@niranjan94
In all samples in open event meta file have root_url as http://open-event-dev.herokuapp.com/ but actually samples are not created using server so it gives response like this
{"field": null, "status": "NOT_FOUND", "code": 404, "message": "Event does not exist"}

So we will need to update samples

Sorry my bad fossasia samples are created using server https://eventyay.com will create and send PR for updating meta file in open event

After that i will continue working on this issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iamareebjamal picture iamareebjamal  路  8Comments

mayank8318 picture mayank8318  路  4Comments

mariobehling picture mariobehling  路  6Comments

iamareebjamal picture iamareebjamal  路  7Comments

dreadpool2 picture dreadpool2  路  7Comments