samczsun / Skype4J

Skype API written in Java. Does not support P2P chats
Apache License 2.0
145 stars 48 forks source link

Android (SDK > 19) compatibility #139

Open ruha9005 opened 7 years ago

ruha9005 commented 7 years ago

This project uses Java 1.8. Are there any forks of Skype4J with Java 1.7 (SDK >= 19) compatibility? Because backporting all of this project code will take a long time.

bagelcoder commented 7 years ago

Java 7 was released 5 years ago. Any particular reason why you can't move on?

ruha9005 commented 7 years ago

@Slacktooth My skills in Java 1.8 are not so high. I thought that someone has already ported this API to Android, and I asked this question not because I'm so lazy or something else...

ducc commented 7 years ago

you dont need to know how to use java 8 features to use skype4j, the internal code is just using java 8 features so it needs 1.8.

ruha9005 commented 7 years ago

@sponges I know about it, but for Android (SDK 19) compatibility I need to backport code that used java 1.8 features to java 1.7, because Android SDK < 24 (below Android N) doesn't support java 1.8.

ruha9005 commented 7 years ago

Issue resolved. Maybe helpful for someone: FOREACH: //this.resources.forEach(interestedResources::add); for (String resource : this.resources) { interestedResources.add(resource); }

FOREACHREMAINING: //object.get("capabilities").asArray().iterator().forEachRemaining(value -> //this.capabilities.add(value.asString())); Iterator iterator1 = object.get("capabilities").asArray().iterator(); while (iterator1.hasNext()) { JsonValue value = iterator1.next(); this.capabilities.add(value.asString()); }

java.util.Function - https://github.com/streamsupport/streamsupport or https://github.com/aNNiMON/Lightweight-Stream-API

Lambdas - retrolambda or enabling Jack in build.gradle (module level)

netherpyro commented 7 years ago

@ruha9005 could you provide me resolved project code please? I wasted the whole day to finding a solution to downgrade to 1.7