Coder Social home page Coder Social logo

Comments (33)

bytedream avatar bytedream commented on August 25, 2024

Yes I can add gradle and maven support in the next update. I'm currently writing a discord bot based on this library an I never got an error (i've tested it with multiple accounts). Do you get this error while using the login method? If yes, you mabye using the wrong server url. When you are at the webuntis login screen the url is https://xyz.webuntis.com/WebUntis/?school=abc-school#/basic/main (for example). For the url parameter in the login method you have to extract the https and the server (or base url), in this case it is https://xyz.webuntis.com. For the school name you have to enter the text between ...?school= and #/basic... in this case abc-school. The final result for this example would be Session.login("username", "password", "https://xyz.webuntis.com", "abc-school"). If you've already tried this and still get the error you can comment the error here so I can analyze it

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

If I catch all exceptions and print them out I only get null

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

What happens if you remove the try catch and run it again?

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

Instant crash

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

And error message / stack trace?

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

Nothing

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Which example do you use?

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

The first one without any action just the login

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

The login itself doesnt give any response. Try to print out session.getKlassen()

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

Im not on my pc right now ill do it and report back what it does

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Ok^^

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

like i said when i do https:// and then the server url it crashes without any output

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Even when you try session.getKlassen()?

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

yes

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Do you use the release 1.0 jar?

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

the latest from the readme

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Hm ok. I could send the pre 1.1 release jar here. Maybe it will work then but currently im not on my pc, so you have to wait about 2.5 hours. Alternatively you can download the source code, unzip it and try to include it into your project if you not want to wait for my jar

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Here's the jar file (its zipped because github don't support jar file uploads in issues): untis4j-pre-1.1.zip

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

doesn't work

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

hmm. Could you paste your code here?

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024
 try {
            Session session = Session.login("", "", "https://borys.webuntis.com", "");  // create a new webuntis session

            System.out.println(session.getKlassen());

            session.logout();  //logout
        } catch (LoginException e) {  // this exception get thrown if something went wrong with Session.login
            System.out.println("Failed to login: " + e.getMessage());
            return;
        } catch (IOException e) {  // if an error appears this get thrown
            e.printStackTrace();
            return;
        }

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Well i copy pasted the code (and used my username, password, server and school name) and it works fine. Weird

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

yeah

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

Oh, I didn't mention I'm using this in an app

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Then it will probably be an android app. Does the android version you've chosen support java8?

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

I use the SDK version 26

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Currently I have tested the api only with the "normal" Java. Android support is not bad at all, so I will test the api on android as well. If there is any progress / if i find the bug or whatever this is, i'll post it here^^

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

I've used a empty activity and added: the api and the org.json library; android.permission.INTERNET to the android manifest file.
Then I added the following to the onCreate(...) method:

this.requestPermissions(new String[]{Manifest.permission.INTERNET}, 0);
Thread t = new Thread(() -> { //if i would do this without a thread a 'android.os.NetworkOnMainThreadException' gets thrown
        try {
             Thread.sleep(5000);
        } catch (InterruptedException e) 
              e.printStackTrace();
        }
        try {
              Session session = Session.login("username", "password", "https://xyz.webuntis.com", "a-school");

              System.out.println(session.getKlassen());
        } catch (IOException e) {
              e.printStackTrace();
        }
});
t.start();

And it worked (with virtual and real device)
image

Here is the app if you want to test it: MyApplication.zip

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Does it work now? I'll close this issue with the next version if you wont't answer

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

I get this error when i use session.getKlassen() and without it it works kind of
java.lang.NoSuchMethodError: No static method metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; in class Ljava/lang/invoke/LambdaMetafactory; or its super classes (declaration of 'java.lang.invoke.LambdaMetafactory' appears in /apex/com.android.art/javalib/core-oj.jar)

from untis4j.

xRealNeon avatar xRealNeon commented on August 25, 2024

the only thing that works is session.getInfos()

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

Have you tried to run the zipped app that i've sent?

from untis4j.

bytedream avatar bytedream commented on August 25, 2024

There is no Maven / Gradle support planned as I am not a big fan of it. And since I haven't received an answer for a long time, I think the Android problem is solved (or you use a different API).

from untis4j.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.