Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Android support? #19

Open
ralphilius opened this issue Jan 29, 2018 · 3 comments
Open

Android support? #19

ralphilius opened this issue Jan 29, 2018 · 3 comments

Comments

@ralphilius
Copy link

I'm trying to run this on Android, but can't seem to get this compile.

try {
    BinanceSymbol symbol = new BinanceSymbol("ETHXLM");
    new BinanceApi().websocketTrades(symbol, new BinanceWebSocketAdapterAggTrades() {
        @Override
        public void onMessage(BinanceEventAggTrade event) throws BinanceApiException {
            Log.i(TAG, "onMessage: "+event.getPrice()+"/"+event.getQuantity());
        }
    });
} catch (BinanceApiException e) {
    e.printStackTrace();
}

Error message:

Error:com.android.builder.dexing.DexArchiveBuilderException: Error while dexing org/eclipse/jetty/util/statistic/SampleStatistic.class
Error:com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
...and more

It seems that this will only work on Android 8.0 since the jetty library is not support for earlier versions

@wcrbrm
Copy link
Member

wcrbrm commented Jan 29, 2018

may be official library will work for your purposes?

@ralphilius
Copy link
Author

I've tried with that earlier but no luck. That's why I seek for this library in hope that it could work :)

@wcrbrm
Copy link
Member

wcrbrm commented Jan 29, 2018

Well you can fork this library and remove 4 websocket classes to replace jetty's dependency with other websocket client that works. I would also love to know what is working on the old Android.

drkarl pushed a commit to drkarl/java-binance-api that referenced this issue Feb 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants