Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.apache.http deprecated in API 23 #104

Closed
sojharo opened this issue May 27, 2016 · 11 comments
Closed

org.apache.http deprecated in API 23 #104

sojharo opened this issue May 27, 2016 · 11 comments

Comments

@sojharo
Copy link
Contributor

sojharo commented May 27, 2016

I had to upgrade to android API 23 from API 22. This has solved the error in #89 but has introduced the error in some functions that I used in HTTP connection library.

In the API 23, http functions have been deprecated and I have to go to new version functions. Else it gives error.

@sojharo
Copy link
Contributor Author

sojharo commented May 27, 2016

I was just able to solve this problem using the following conversation.

http://stackoverflow.com/questions/17587751/gradle-execution-failed-for-task-processdebugmanifest

http://stackoverflow.com/questions/32202489/org-apache-http-packages-removed-in-api-level-23-what-is-the-alternative

I have not rewritten all our network code to support new version of HTTP connection library. In fact, I added the some workaround which android team has shown here to use legacy http library:

https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client

However, later, we would upgrade to new version of http library. Or use other http libraries which are advanced enough to download pictures from server.

@jekram
Copy link

jekram commented May 27, 2016

Sojharo Thanks for the update.

When we should upgrade to the newer level so we do have workaround? It is better to be current.

@sojharo
Copy link
Contributor Author

sojharo commented May 27, 2016

We would upgrade when demos are done in june. Yes, we have the workaround and it works. It is also given by android as upgrading the apps to Android 6.0 will break most of apps if there is not workaround.

@jekram
Copy link

jekram commented May 27, 2016

OK. Make sense

@jekram jekram closed this as completed Jun 11, 2016
@sojharo
Copy link
Contributor Author

sojharo commented Nov 19, 2016

As discussed in above comments, we had to upgrade to latest version of our http network library org.apache.http. Therefore, I want to reopen this issue and I would gradually upgrade all the networking code. This is required at this time as we are working on uploading and downloading of images. So, I have found a very good and well-maintained library called Ion. https://github.com/koush/ion

This would be very helpful in downloading images and loading them into our image viewers. It will do all this mundane task in background for us with just few lines of code. It uses the apache http in background with its updated version. I need to use this library in downloading icon task i.e. #233

@jekram
@dayemsiddiqui @Assadbintahir For your information, I would discuss this networking library with you. This also handles the Asynchronous task handling for us so we will not have to write async code for each server request we do. It would result in decreased file size of compiled binary of our application.

@sojharo sojharo reopened this Nov 19, 2016
@dayemsiddiqui
Copy link
Contributor

@sojharo Nice! no AsycTask will make the code much more readable and easy to maintain, Lets have a discussion on monday. Also I will study the library in the meantime so that we can have a discussion.

@sojharo
Copy link
Contributor Author

sojharo commented Nov 19, 2016

Yes, but AsyncTask is a lot of code which we have to write every where to do http request. This library is asynchronous and handles AsyncTask inside it. The syntax of library is cleaner and easy to maintain. In your study, please go through the sample codes too.

@dayemsiddiqui
Copy link
Contributor

@sojharo Thanks I will look at it 😄

@jekram
Copy link

jekram commented Nov 19, 2016

@sojharo Thanks. I agree with the approach.

"The best programmer is who writes the least amount of code and get the work done."

So leveraging "good" components from outside or writing modular reusable code is a great approach.

@sojharo
Copy link
Contributor Author

sojharo commented Nov 20, 2016

I have integrated the library and have used it for uploading and downloading image. The integration was successful and I was able to reduce at least 40 lines of code which was scattered in 3 separated files. Now just in 8 lines I am able to download and upload image. I would discuss this with Asad and dayem so that they can move to this.

@jekram
Copy link

jekram commented Nov 20, 2016

Thanks

@jekram jekram closed this as completed Nov 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants