iLexiconn / Magister.java

A Java implementation of the Magister 6 API for desktop and Android.
MIT License
6 stars 3 forks source link

Migrate to HttpUrlConnection #31

Closed iLexiconn closed 8 years ago

KeizerDev commented 9 years ago

Can you be more clear? I can implement it right away for android. You just have to run it on another thread instead of the ui thread.

iLexiconn commented 9 years ago

The BufferedImage and ImageIO classes can't isn't part of the android sdk. And maybe use the android http stuff as well.

KeizerDev commented 9 years ago

You can use FileOutputStream. I used it to store images on Android.

iLexiconn commented 9 years ago

I don't want to store it. It's used to get the profile picture. I also can't get the httpclient to work in Android 6.0+

KeizerDev commented 9 years ago

Could you make an test repo or branch for Android? I'll take a look at it

iLexiconn commented 9 years ago

Done. :)

KeizerDev commented 9 years ago

How do you exactly want to return the profile picture? There are so many ways

iLexiconn commented 9 years ago

Er, just an image. :p

KeizerDev commented 9 years ago

So, FileOutputStream.

KeizerDev commented 9 years ago

I mean a test project for Android. Not really a development branch

iLexiconn commented 9 years ago

Sure. :p

iLexiconn commented 9 years ago

Whoops missed that message. I'll create one in a few mins.

JWolvers commented 9 years ago

There is no more httpclient in android 6.0 and up

iLexiconn commented 9 years ago

I know, that's why I tested it on that version.

JWolvers commented 9 years ago

And it doesn't fall back on urlhttpconnention?

iLexiconn commented 9 years ago

I'm talking about the HttpClient stuff.

JWolvers commented 9 years ago

Yeah but if the library is used on android, it should fall back on using urlhttpconnention instead of using httpclient.

JWolvers commented 9 years ago

I'm sorry i already get what you wete talking about. I will add this to my todo list for tomorrow.

iLexiconn commented 9 years ago

:+1:

KeizerDev commented 9 years ago

Lol, why don't you just compile it with a lower version?

KeizerDev commented 9 years ago

The lib is gone maybe, but that doesn't mean that older version won't run.

JWolvers commented 9 years ago

Because than it will crash on android 6.0+ because they cant find the class

iLexiconn commented 9 years ago

I want this lib to be future-ready. You never know when they are going to remove it completely.

KeizerDev commented 9 years ago

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

KeizerDev commented 9 years ago

Got a fix for it.

JWolvers commented 9 years ago

Please dont let it be just adding:

useLibrary 'org.apache.http.legacy'

To the gradle file 😕

KeizerDev commented 9 years ago

Yeah.. :smile:

JWolvers commented 9 years ago

Well that's not really a 'fix'

KeizerDev commented 9 years ago

I agree, let's migrate to HttpURLConnection than.

JWolvers commented 9 years ago

Only for android or also for normal desktop use?

iLexiconn commented 9 years ago

Let's take the easy path and do both.

KeizerDev commented 9 years ago

I agree with that. Let's keep it as universal as possible

JWolvers commented 9 years ago

Ok them I will migrate every thing to HttpUrlConnection

KeizerDev commented 9 years ago

Cool :+1:

JWolvers commented 9 years ago

👍

iLexiconn commented 9 years ago

Well this still doesn't fix the BufferedImage stuff.

JWolvers commented 9 years ago

Yes i forgot

JWolvers commented 9 years ago

We can return an object containing a drawable or a buffered image depending on which os we are running.

KeizerDev commented 9 years ago

Yeah, just return an universal type of object.

JWolvers commented 9 years ago

Well there is none. So we will have to create a wrapper.