android

Mobile restaurant app for EVA on Android

I'm proud to announce the first mobile application for EVA. Late december, I offered to develop an app allowing you to search for restaurants in your neighbourhood, or anywhere in Belgium, serving vegetarian food. After two months of learning and developing, the first version is available on Google Play (aka the Android Market in earlier times) and iTunes. The app is now taken offline.

Besides the java part for the application, I also needed to dive into Joomla, writing my first ever component adding extra administration features in the backend and new dynamic pages on the public website. The look and feel was designed by Koffie Verkeerd. I'm pretty excited with this first release and new features are already planned, so stay tuned. In the meantime, I'm starting (well, rather, learning first) to port the app to iOS, so in case somebody wants to help out, do contact me or EVA so we can make that happen much faster.

The mobile app itself connects with an online database which is managed by the EVA crew, so you are always sure the data is up to date. But that's not all. Features in this first release:

  • Geolocation through Wifi/edge/3G
  • Lot's of criteria to search on: postal code, veggie, etc ..
  • Upload pictures, share or add reviews per restaurant
  • View a google map and ask directions
  • Call directly, send a mail or surf the website
  • Lots of details per restaurant
  • Send in new suggestions

There's a clear social aspect to the site, because all pictures and reviews are also visible on the website. Besides the overview, every restaurant now has its individual page as well, showing all user generated content - if available. Checkout the Komkommertijd page, incidently, my favorite veggie restaurant.

Last, but not least, thanks to Tobias for letting me develop this, Vincent and Pascal for the java reviews and all the first beta testers, your input was invaluable!

Posting images from Android to Drupal

I've blogged about this topic almost more than 3 years ago how I used a couple of drupal modules to send mails with images from my iPhone which automatically got posted to my site. But times change. I now own a Nexus One and one of my goals for 2012 is to write at least one decent mobile application. I experimented with Titanium first, but decided to go native for a couple of reasons, performance and size of app being the main reasons.

While I already have an official go for an application I can develop, I started with a simple use case to learn android application development: uploading images to my personal blog saving a new node. Especially the java part is as good as new to me, so starting simple is always the best advice. After 3 hours of Drupal hacking and a lot more Java reading and debugging, my first application is happily working on my own phone and I have cute Druplicon on my desktop.

The code is freely available (see below) consisting of 2 parts.

The Android part

The application is build at SDK version 10, so it should work on any Android 2.3 or higher. It might possibly work on lower versions as well. After installation of the application and the first run on your telephone, you will need to login. The app authenticates with a Drupal user and only stores the endpoint URL and the session cookie. The session cookie is send when uploading an image so we know exactly who's uploading. Besides selecting from the app, you can also go to your Image gallery, select an image and use the Share menu to drop the image to the application.

The layout of the application as the code is relatively simple, it probably doesn't follow the best practices of Java programming, so be gentle in case you start reviewing, I'm still learning :)

The Drupal part

The Drupal module - D7 only - is simple as well, but was less hard to develop. While I could 've used a combination of services and other modules, I decided to write a simple module with a single menu callback that accepts a request that can either authenticate a user or create a node with title, image and other keys. Once enabled, you need to go to 'admin/config/media/drupapp' and start configure following items:

  • The endpoint. Defaults to 'drupapp', but you can change this to your likings.
  • The image field name: this will immediately select the content type that will be used to save the node.
  • Published status: default status, handy if you want to review after upload.
  • Debug option: log the complete $_POST variable through watchdog for testing purposes.

You will need to grant permission on the permissions page as well. Best practice is to create a new role which only has the "upload images via app" permission, and that role does not necessarily need a permission to create nodes.

Combine the 2 technologies and you get Drupoid. What's in name right ? You can browse, fork and/or download the code at http://github.com/swentel/Drupoid. Feel free to modify it to your own needs. The app in its current version will never be made available on the Android market as it's really a personal project. But it might serve as a nice start example for your own adventures in mobile application land.

You can also see some pictures from the screens at http://realize.be/mobile or an installation guide at http://www.slideshare.net/yoroy/drupoid.

Pages

Subscribe to RSS - android

You are here