Entries tagged app

Minimal Mensa Plan

Posted on 9. Dezember 2014 Comments

We’ve been doing a lot of website scraping for a university project latel so I decided a little app to scrape the universitys‘ cantine website for the lunch menu.

minimalmensaplan-screenshot

A network connection in the main Activity is not allowed so I’m using a private class for that. Once the doInBackground method is over onPostExecute is automatically called.

Luckily the jSoup library which is used for parsing also brings a way download a website for parsing.

Document doc = Jsoup.connect("http://speiseplan.studierendenwerk-hamburg.de/de/520/2014/0/").get();

There is only one category class and it contains the date. The dish-description class contains what you will later see in the app. The size is needed for a for-loop later on.

date = doc.select(".category").text();
int maxDishes = doc.getElementsByClass("dish-description").size();

With the next piece of code all the dish descriptions are extracted. The original website contains details about the food (made with alcohol, pork or if it’s vegeterian etc). For blending this out I use a regular expression which filters out:

1 non-word character(\W = an opening bracket), then possibly multiple digits (\d) and non-word characters (\W = commas) and then another non-word character (\W = a closing bracket)

String dish = doc.getElementsByClass("dish-description").get(i).text().replaceAll("(\\W[\\d\\W]*\\W)", " ");

These dishes are then saved together with every second price (the one for students, the other one’s for employees) in a HashMap, which is then added to a list. For recognizing later, the dishes get the key „dish“ and the prices the key „price“.

Once the data extraction is done, onPostExecute is automatically called. The date is set to a TextView above the ListView and a SimpleAdapter is populating the list of HashMaps into the layout

dateTextView.setText(date);
simpleAdapter = new SimpleAdapter(MainActivity.this,
dishList, R.layout.list, new String[] { "dish",
"price" }, new int[] { R.id.text1, R.id.text2 });
setListAdapter(simpleAdapter);

Since i’s called Minimal Mensa Plan, no other features (such as caching or selecting a cantine) are available. The app in the Play Store is used for scraping the cantine at the campus Berliner Tor but it might as well be used for others, just by changing the URL. It’s released under the MIT License and available at GitHub.

Most minimal note taking app for Android

Posted on 2. Oktober 2014 Comments

As of September 2014 the smallest (15KB!), most minimalistic app for simply taking notes is called Zen Notes from Peter Gyorffy.

It doesn’t have any features like reminders, changing the theme or font or any other useless stuff. It’s basically like a sheet of paper where you can write your thoughts on, just digitally. The only thing it can do is share the written text over whatever Android offers you, e.g. email. When you exit the app the notes are saved automatically.

 

Ohrenbär Single Purpose App für Android

Posted on 15. März 2014 Comments

update: s.u.

Als Kind habe ich früher oft abends vor dem Radio gesessen und Ohrenbär – Radiogeschichten für kleine Leute gehört. Letztens hörte app-ohrenbaer-screenshotich die Titelmelodie (Peter und der Wolf von Sergei Prokofjew) und ich googelte, ob es das wohl noch gibt. Beim RBB gibt es eine Homepage dazu und es ist sogar möglich sich die verpassten Episoden herunterzuladen, welch‘ Fortschritt!

Letzten Monat hat Daniel Oeh für Toby Baier vom Einschlafen Podcast eine kinderleicht zu bedienende Single Purpose App geschrieben. Er war so nett, sie unter der MIT Lizenz als freie Software zur Verfügung zu stellen. Ich habe diesen Code genommen und in ein bisschen an Ohrenbär angepasst. Das Ergebnis findet man jetzt im Google Play Store. Das Icon habe ich wie so häufig von OpenClipArt. Es ist gemeinfrei.


 

Zum Rechtlichen: Die .mp3-Dateien kommen alle von RBB Servern, ebenso wie das Logo. Die Feed Adresse ist: http://www.ohrenbaer.de/podcast/podcast.feed.podcast.xml. Ich habe keinerlei Absichten mit dieser App Geld zu verdienen oder Copyrights zu verletzten. Ich arbeite auch nicht mit dem RBB zusammen. Ich habe die App geschrieben, weil ich Fan dieser Sendung war/bin. Die Inhalte stehen selbstverständlich immer noch unter demselben Copyright. Wenn es Probleme mit irgendwelchen Rechten gibt, dann schreibt mir bitte erstmal eine E-Mail bevor ihr mich verklagt 😉 Sollte das zufällig jemand von der RBB lesen und Interesse haben, können wir gerne darüber reden 🙂 Ich hatte schon mal eine E-Mail geschrieben aber keine Antwort erhalten.

Get it on Google Play
Ich habe mich dazu entschieden, die App offline zu nehmen. Heute bekam ich folgendes Schreiben* :

Sehr geehrter ,
wir mussten feststellen, dass Sie im Internet eine OHRENBÄR-Podcast App anbieten. Ich hoffe, Sie haben Verständnis dafür, dass die OHRENBÄR-Redaktion des rbb selbst entscheiden möchte, wie und auf welchem Wege sie die OHRENBÄR-Angebote verbreitet. Wir können daher Ihr Angebot nicht gut heißen. Es verletzt nach Auffassung unserer Juristen zudem Urheber- und Titelrechte des rbb.

Insofern fordern wir Sie auf, zur Vermeidung rechtlicher Schritte, Ihr Angebot unverzüglich aus dem Netz zu nehmen und hoffen, dass Sie dennoch Fan unserer Radiogeschichten bleiben.

*

ohrenbaer-brief-cut

Minimal Open Source Flashlight

Posted on 1. Januar 2014 Comments

Nachdem OI Flashlight bei mir nicht funktioniert habe ich gestern Nacht kurzerhand entschloßen mal AIDE auszuprobieren und mir meine eigene Taschenlampen App zu schreiben. Stellt sich raus, dass das garnicht so schwer ist. Der Developer Account bei Google kostet $25 und ist super einfach zu bedienen. Details folgen noch.

update: Ich habe eine Version für Smartphones mit Android < 4.0 hochgeladen. Je nach Androidversion wird automatisch die richtige App ausgewählt.

Screenshot
   

Market Link

Google Play

Get it on Google Play

Github

APK SHA1SUM(15 Jan 2014/v 1.0.2)

$adb pull /data/app/de.repat.mosf-2.apk
$sha1sum de.repat.mosf-2.apk
  • c5b311b6d85ab1f4e3e99fe3bdcfc4f104a4a375 for 4.0+
  • 1db8ad27f07f60dc843eefb3df6a7ee35f1fd880 for < 4.0

Droid-Break

Droid-Break – high quality alternatives to proprietary Android apps

Posted on 23. Oktober 2013 Comments

After the NSA scandal 2013 the website prism-break.org got a little famous for recommending software, that would help keeping snooping intelligence services out of your private conversations. There are a couple of proprietary solutions, because there are just no alternatives but it’s mostly free and open source software(FOSS). While the disclaimer says „this site will not guarantee that 100% of your communications will be shielded against surveillance states“ it’s probably the best you can do. So that got me thinking and I created droid-break.info.

Prism-break.org lists a couple of Android apps, but only to security related issues such as encryption. Droid-Break is about FOSS apps in general because – as it turned out – for most of the apps we use everyday there is a good alternative FOSS solution. Most of the apps are in the F-Droid app store so you don’t have to rely on Google doing no evil.

The list includes the following categories: Browser, Social Networks, Messenger, VoIP, Audio/Podcasts, Video, Email, Notes, News Reader, File Manager, Navigation, Keyboards, Cloud, and a category for misc app that didn’t fit anywhere else.

If you have any suggestions, write a comment, an e-mail, tweet @repat123 or @droidbreak or fork the project on github.

Btw, it’s kindly hosted by neocities.org 🙂

Owncloud News Reader Error after update to 5.0.11

Posted on 21. Oktober 2013 Comments

After updating to owncloud 5.0.11 I got the following error in my Owncloud News Reader:

Screenshot_2013-10-21-10-20-56

(For Google: A Toast saying „End of input at line 1 column 1“)

In my owncloud instance, I got an error in the administrator menu saying:

SQLSTATE[HY000]: General error: 1 no such column: feeds.articles_per_update at db.php#391

I updated the owncloud instance and app framework/news app but it still showed me that everything was uptodate, even when 5.0.12 was released. Via phpMyAdmin I could see that the feeds were still in the database but I couldn’t see them in the web app or Android app. So I just deleted the owncloud folder, downloaded the new .tar.bz2 from owncloud.org, removed the oc_news tables(do not delete e.g. the contacts or bookmarks!). Then I changed my username in oc_users, used my old username as my new username and reinstalled owncloud, this time version 5.0.12.  I could then delete the old (changed) username via the admin panel.

This is the third time I had to reinstall owncloud, because the update mechanism didn’t work properly… And yes, as advised, I did deactivate the news app and app framework for the update process 😉

I just had a look at the SQL-statements from my last backup and saw that articles_per_update is supposed to be a column in oc_news_feeds in the new version of the news app. Somehow, the owncloud update process didn’t update the news app or didn’t trigger a 3rd-party update process. Anyways, I guess this could also be solved by just adding this column manually:
`articles_per_update` bigint(20) NOT NULL DEFAULT '0'

Scuttle Bookmarks in Owncloud App

Posted on 21. Juni 2013 Comments

Ich habe ein kleines PHP-Skript geschrieben, was aus einer Scuttle Installation die Bookmarks ausliest und in die Owncloud Bookmark App einfügt.

In der jetzigen Version wird nur MySQL (noch kein SQLite) unterstützt und aus  einem mir nicht erklärlichen Grund funktionieren die Tags nicht. Vielleicht kommt ja jemand dahinter.

Den Quellcode findet man auf github.

Mit Arduino und Android 434MHz Funk Steckdosen schalten

Posted on 10. April 2013 Comments

Schon lange wollte ich die Funksteckdosen wieder hervorräumen und mit meinem ebenfalls schon eingestaubten Arduino Uno (rev 3)und einem 434MHz Sender von watterot wieder in Gange bringen. Das Ganze gestaltet sich aufgrund der RCSwitch Library relativ einfach. Ich benutze hier im Gegensatz zum homecontrol4me-Projekt (mit kostenpflichtiger Android App) die Arduino IDE 1.0 aus den Ubuntu Repositories. Das hatte zur Folge, dass man den Beispielcode etwas anpassen muss. Dazu muss man aber auch sagen, dass ich hier keine Sicherheit eingebaut habe, jeder der die (interne) IP vom Arduino kennt, kann HTTP-Requests absenden und damit wild meine Geräte an- und ausschalten, NAT ist ja nicht wirklich ein Sicherheitsfeature.

Arduino

Sketch: Download (github)

Weil Arduino 1.0 die neuen libraries enthält muss für Server immer EthernetServer und für Client immer EthernetClient geschrieben werden. Ausserdem müssen die beiden Dateien EthernetServer.h und EthernetClient.h included werden. Am besten kann man das mit Strg+F(Suchen+Ersetzen) machen.

Die Funktion httpResponseHome() stellt die Website dar. Im Grunde bräuchte man das nicht, wenn man nur die Android App benutzen möchte.

 

Android

Android-Projekt für Eclipse: Download (github)screenshot-lichtsteuerung

Im Grunde muss man nur HTTP-Requests absetzen, die /?1-On usw. hinter der IP stehen haben. In Android dürfen keine langen Operationen, also hier Netzwerkverbindungen, in der MainActivity aufgebaut werden. Dafür habe ich die Klasse Network.java geschrieben, welche über einen AsyncTask Threads mit den HTTP-Requests startet. Weil sich das bei Lampen anbietet, habe ich ToggleButtons genommen. Diese haben das Attribut  android:onClick=“onToggleButton1Clicked“. Für jeden dieser Button habe ich eine entsprechende Methode in der mainActivity.java, die diesem Schema folgen. update: weil es manchmal hakte, hab ich eine loop eingebaut, die die Requests an die Network-Klasse drei mal sendet. Das löst zwar nicht das Problem(was immer es war), aber es funktioniert.

public void onToggleButton1Clicked(View v) {

boolean on = ((ToggleButton) v).isChecked();

        if (on) {
            loop(LICHT1ON);
        } else {
            loop(LICHT1OFF);
        }

 

In Requests.java finden sich ein Haufen Strings nach dem Schema:

public static final String IP = "http://192.168.1.42/";
public static final String LICHT1ON = IP + "?1-on";

Da ich den Code hier sehr simpel (und damit natürlich auch unsicher) gehalten habe, war’s das auch schon. Den Arduino und den Sender habe ich dann in eine Box hinter den Schrank gestellt und ein altes Netzteil zur Stromversorgung benutzt.

arduino-lichtsteuerung

Credits
Den Async Task Code habe ich (leicht editiert) von Konstantin Burov von stackoverflow.com.

Den Code für die ToggleButtons habe ich aus der Developer API von Google.

Der Arduino Code stammt überwiegend von RCSwitch aus der Datei /examples/Webserver/Webserver.pde. Ich habe die oben genannten Anpassungen an Arduino 1.0 vorgenommen, mal abgesehen von der Anpassung an meine Steckdosen.

Beste Podcast App fuer Android

Posted on 26. September 2011 Comments

Ich habe mir einige angeschaut und bin von Podkicker restlos begeistert. Wüsste nichts, was die hätten besser machen können.

qrcode

Features:

  • Verwaltung und Hinzufügen von Podcast-Feed via URL oder Empfehlungen
  • Neue Podcasts werden in einer Liste/Tab angezeigt, unabhängig vom Feed, auch automatische nach einer bestimmten Zeit
  • Integrierter Player, der sich merkt, wo man zuletzt war(-> kein nerviges Suchen mehr)
  • Download und von dort aus Hinzufügen in die Playlist
  • Löschen oder aus der Playlist nehmen, wenn der Podcast fertig gehört ist
  • Abspeichern/Laden von abonnierten Podcasts im OPML-Standard
  • RSS und Atom

 

update: inzwischen habe ich mir wegen der flattr-Unterstützung die Pro-Version gekauft. Mit Android 2.2 funktioniert das aber leider nicht wegen irgendwelchen Zertifikaten. Da werd ich nochmal nachforschen. Dafür spielt der Podcast weiter, wenn man den Stecker rausgezogen hat und ihn dann wieder reinsteckt, sehr praktisch!

update2: da nach einer Weile die flattr Unterstützung aufgrund API Änderungen auch bei Podkicker Pro unter Android 4.4 kaputt war, habe ich zu AntennaPod gewechselt, die inzwischen eine sehr brauchbare und schlichte Oberfläche erstellt haben. Es gibt außerdem ebenfalls eine flattr Unterstützung und es ist Open Source.