Comments (33)
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.
If I catch all exceptions and print them out I only get null
from untis4j.
What happens if you remove the try catch and run it again?
from untis4j.
Instant crash
from untis4j.
And error message / stack trace?
from untis4j.
Nothing
from untis4j.
Which example do you use?
from untis4j.
The first one without any action just the login
from untis4j.
The login itself doesnt give any response. Try to print out session.getKlassen()
from untis4j.
Im not on my pc right now ill do it and report back what it does
from untis4j.
Ok^^
from untis4j.
like i said when i do https:// and then the server url it crashes without any output
from untis4j.
Even when you try session.getKlassen()
?
from untis4j.
yes
from untis4j.
Do you use the release 1.0 jar?
from untis4j.
the latest from the readme
from untis4j.
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.
Here's the jar file (its zipped because github don't support jar file uploads in issues): untis4j-pre-1.1.zip
from untis4j.
doesn't work
from untis4j.
hmm. Could you paste your code here?
from untis4j.
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.
Well i copy pasted the code (and used my username, password, server and school name) and it works fine. Weird
from untis4j.
yeah
from untis4j.
Oh, I didn't mention I'm using this in an app
from untis4j.
Then it will probably be an android app. Does the android version you've chosen support java8?
from untis4j.
I use the SDK version 26
from untis4j.
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.
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)
Here is the app if you want to test it: MyApplication.zip
from untis4j.
Does it work now? I'll close this issue with the next version if you wont't answer
from untis4j.
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.
the only thing that works is session.getInfos()
from untis4j.
Have you tried to run the zipped app that i've sent?
from untis4j.
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)
- Issue while calling getTeachers. HOT 3
- Issues when using untis4j on android HOT 13
- Build Tools / Gradle HOT 2
- How do I get my own personId to pull my own timetable? HOT 1
- Could not get unknown property HOT 3
- ⚠️ Looking for new maintainer HOT 2
- Using Gradle is causing 401: Unauthorized HOT 2
- Invalid UTF-8 middle byte HOT 4
- Cant login with key HOT 1
- Link to Documentation is dead HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from untis4j.