Benachrichtigung am Smartphone

Albatrox

Mitglied
Hi Leute,

ich schreibe gerade ein Programm, das auf meinem Raspberry Pi läuft und z.B. irgendwelche Zahlen auswertet. Sobald von diesen Zahlen eine bestimmte Grenze überschritten wird will ich eine Benachrichtung auf meinem Smartphone bekommen (kurze Vibration oder sowas).

1.Frage: wie kann zwischen den beiden Geräten kommunizieren? Theoretisch hätte ich glaub schon eine Lösung, mit Pushbullet sollte das funktionieren, noch nicht ausprobiert, wollte zuerst nachfragen obs auch andere Möglichkeiten gibt.

2.Frage: Wie sieht hierbei die Android Programmierung aus? Habe nur dürftige Grundkenntnisse von der Android Programmierung. Falls jemand einen guten Link zum einlesen hat, bitte schreiben :).

Soweit wars das, ich bedanke mich schonmal im Voraus!
Mfg
 

Tobse

Top Contributor
Ich rate dir auch zu Pushbullet oder Pushover. Damit ist das wirklich easy; das selbst nachzuprogrammieren bringt so gut wie keinen Mehrwert und ist viel Aufwand (mit Push Provider, dann auf dem Handy empfangen und zuverlässig anzeigen, etc.)
 

Albatrox

Mitglied
Hi, danke für die Antwort.
Ich habe jetzt etwas rumprobiert, kann von meine PC zu meinem Handy schreiben und andersrum. Also funktioniert soweit.
Hab jetzt bissle nach Code gesucht und folgenden gefunden und ausprobiert:
Java:
public class SendNote {
    public static void main(String[] args) throws PushbulletException{
        PushbulletClient client = new PushbulletClient( "[B]ABCD1034...your.key.here...ABCD[/B]" );
        String result = client.sendNote([B]null[/B], "My First Push", "Great library. All my devices can see this!");
        System.out.println( "Result: " + result );
    }   // end main
}   // end Note

Das was ich fett markiert habe, da habe ich meinen Access Token eingefügt. Dann habe ich das Programm ausprobiert, aber erhalte leider keine Nachricht.
 

Albatrox

Mitglied
Hi,

hab den Code nochmal auf meinem Linux System kompiliert:

Java:
package PushbulletTest;

import net.iharder.jpushbullet2.PushbulletClient;
import net.iharder.jpushbullet2.PushbulletException;

public class sendNote {
    public static void main (String[]args) throws PushbulletException{
        PushbulletClient client = new PushbulletClient("KEY");
        client.sendNote("KEY", "Test", "Test");
    }
}

Fehlermeldung:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/auth/Credentials
at PushbulletTest.sendNote.main(sendNote.java:8)
Caused by: java.lang.ClassNotFoundException: org.apache.http.auth.Credentials
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 1 more
 

Albatrox

Mitglied
Hi,
danke für die schnelle Antwort. Hab jetzt alle JARs eingebunden, die hier gelistet sind:
http://iharder.sourceforge.net/current/java/jpushbullet2/

Nun kommt die folgende Fehlermeldung:
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.http.impl.conn.CPool.setValidateAfterInactivity(I)V
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:176)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:158)
at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:962)
at net.iharder.jpushbullet2.PushbulletClient.<init>(Unknown Source)
at net.iharder.jpushbullet2.PushbulletClient.<init>(Unknown Source)
at PushbulletTest.sendNote.main(sendNote.java:8)
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
J Benachrichtigung Freigabe ab Android 14 Android & Cross-Platform Mobile Apps 1
J Android Benachrichtigung zum Zeitpunkt ers Android & Cross-Platform Mobile Apps 15
B Android Feste Benachrichtigung? Android & Cross-Platform Mobile Apps 2
M Android Studio - App auf dem Smartphone testen Android & Cross-Platform Mobile Apps 7
W .txt File aus dem Speicher des Smartphone lesen Android & Cross-Platform Mobile Apps 15
G App wird nach Installation auf Smartphone beendet Android & Cross-Platform Mobile Apps 1
Fab1 Kommunikation Fernbedienung --> Smartphone Android & Cross-Platform Mobile Apps 5
L Android Spiel stockt auf Smartphone Android & Cross-Platform Mobile Apps 3
A Wie kann ich meine app auf meinem Smartphone zum laufen bekommen Android & Cross-Platform Mobile Apps 8
G Unterschiedliche Ausgabe in Emulator und auf Smartphone Android & Cross-Platform Mobile Apps 2
G unterschiedliches Verhalten beim Installieren des App auf dem Smartphone Android & Cross-Platform Mobile Apps 3
DaniSahne96 Problem beim Appdebuggen auf Smartphone Android & Cross-Platform Mobile Apps 3
D gpx-Datei von Smartphone auf Server uploaden Android & Cross-Platform Mobile Apps 4
S Entwicklung von Smartphone programmen ohne selber eins zu besitzen Android & Cross-Platform Mobile Apps 17
M Android Von Smartphone auf Daten von Server zugreifen Android & Cross-Platform Mobile Apps 2
H Smartphone (Front-)Kamera-Zugriff per Website Android & Cross-Platform Mobile Apps 6
E Fertiges Programm auf Smartphone zum laufen bringen. Android & Cross-Platform Mobile Apps 2

Ähnliche Java Themen

Neue Themen


Oben