Reply
Thread Tools
Posts: 252 | Thanked: 252 times | Joined on Nov 2009
#1
Hi!

I am devoloping an application for Maemo 5 and use two libraries not included in the Maemo repositories. These are libzbarqt and libmagick++.

I was wondering what the best approach is to include these with my application? They are available in the Debian repositories, but asking a user to download these and install them manually seems like too much of a hassle for most users. The same goes for asking them to do a manual .configure && make && make install.

Is it possible to include Debians repositories for these packages, or would that crash the device? Or are there any preferred methods to include such libraries with a Maemo application?

Last edited by dragly; 2009-11-27 at 09:34.
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#2
"Port" them and push them to extras.

BTW libzbar is in extras-devel already, so is this a Qt binding for it? If so I can alter the build to create it.
 

The Following 3 Users Say Thank You to lardman For This Useful Post:
Posts: 252 | Thanked: 252 times | Joined on Nov 2009
#3
Thanks for the quick reply

I'm afraid I don't know much about packaging libraries. As you probably figure I'm pretty new to developing for Maemo (and Debian in general). How would I go ahead to port the packages and push them to the repositories?

If you have a look in the sources for zbar-0.10, there is a folder named "qt". I'm not sure what compile options one needs to compile it with the Qt bindings, but they are included in the Debian repos as the package libzbarqt-dev.

It would be great if you could include the Qt bindings in the zbar package. And thanks for adding the package in the first place
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#4
I'm just sorting it out now.

I'm not going to do libmagick++ though I'm afraid. What is the app you are trying to build?

If it's just a barcode scanner, try mbarcode (in extras-devel).
 
Posts: 252 | Thanked: 252 times | Joined on Nov 2009
#5
Originally Posted by lardman View Post
I'm just sorting it out now.
Great! Thank you very much!

Originally Posted by lardman View Post

I'm not going to do libmagick++ though I'm afraid. What is the app you are trying to build?

If it's just a barcode scanner, try mbarcode (in extras-devel).
I'm actually not sure I need libmagick++ after all. I thought it was a zbar dependency, but it seems like it is not.

I am developing an application which is supposed to let users scan barcodes and look up information about the products based on what other people think. I had a look at mbarcode, but I could not get it to run in the SDK. And when I started to develop for Maemo I found that it was a much more gentle learning curve for me to use Qt rather than GTK. Creating the GUI is quite easy as well as networking and XML is both easy and object-oriented. It was the maemo-barcode project which pointed me in the direction of zbar though
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#6
Originally Posted by dragly View Post
Thanks for the quick reply

I'm afraid I don't know much about packaging libraries. As you probably figure I'm pretty new to developing for Maemo (and Debian in general). How would I go ahead to port the packages and push them to the repositories?

If you have a look in the sources for zbar-0.10, there is a folder named "qt". I'm not sure what compile options one needs to compile it with the Qt bindings, but they are included in the Debian repos as the package libzbarqt-dev.
For general question how to "port" libraries, don't you to the library home page to get the source. Go to debian repositories to download source deb package. Check if there is other depecies for the package, evaluate if they are really necessary (often they are not), study debian/rules file and then just compile it. "Port" done.

Find "Maemo Policy" document to read about version numbers and changing maintainer address.
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#7
Well I've pushed a new version of zbar which has Qt bindings.

I'm actually pursuing the same goal as you apparently, though I'm not using Qt (yet). Where are you thinking of obtaining your review information? AWS?

The problem you may well have using the Qt zbar plugin (which I assume includes a link to the camera) is that of focusing the camera. That's why I'm just using the raw zbar decoder, and not the GTK+ plugin.

Please let me know if you would like to collaborate.
 
Posts: 252 | Thanked: 252 times | Joined on Nov 2009
#8
Originally Posted by lardman View Post
Well I've pushed a new version of zbar which has Qt bindings.
Cool, I'll have a look at it tonight.

Originally Posted by lardman View Post
The problem you may well have using the Qt zbar plugin (which I assume includes a link to the camera) is that of focusing the camera. That's why I'm just using the raw zbar decoder, and not the GTK+ plugin.
Actually, I was considering saving the image as a file and use the Qt binding for reading the image afterwards. I don't know how that approach would work out, but it sounded like a really easy way to create a beta-application. But if you know of a better way that could integrate with Qt, I'm all ears

Originally Posted by lardman View Post
I'm actually pursuing the same goal as you apparently, though I'm not using Qt (yet). Where are you thinking of obtaining your review information? AWS?

Please let me know if you would like to collaborate.
Collaboration would be perfect! Count me in I'll send you my contact info by e-mail.

The application I'm building is in connection with a project named Informed Individual which I'm working on with a group of people. The goal is to make it easier for everyone to get information about products, companies and organizations, based on who they trust.

As a simple example, the goal is to let all kinds of people (your friends, ethical organisations etc.) review different products and companies, and let you access that information by scanning the barcode on the product in the store. Just to make it easier for you to know whether it is a good product or not, in both ethical and practical terms. It is just fantastic if this is somewhat the same as you are trying to achieve.

At the moment we have a working pre-alpha version for Java ME, but it has been made with a SOAP/WSDL API instead of REST, so it is going to be completely rewritten and put aside for a little while. I figured it would be a lot more flexible to implement with REST. At the same time my N900 arrives in a couple of days, and I think it would be much more fun to show the first version of the app running on that, rather than on some two-year-old Java ME-phone.

The data is currently hosted on a dedicated server, but it has been quite unstable recently, and thus slowing down the development process. I was thinking about moving it to the Google App Engine since it is free and I've had some good experience with it and a REST API earlier. Is AWS free of charge?

A goal, nonetheless, will be to write code which is easily ported to any Java enabled server to ensure the system is as open as possible. An important point in such a trust system would of course be to make sure people are able to choose another provider in case they don't even trust us
 
Posts: 2,102 | Thanked: 1,309 times | Joined on Sep 2006
#9
Well AWS is Amazon Web Services, which will allow you to see the product reviews for products that they offer.

Basically I am (slowly) creating an app with which you can scan a barcode, then look it up (on various providers) and obtain, amongst other things, the price and reviews (from e.g. AWS). Having other sources for reviews sounds like a really good idea.

We were just discussing in the mbarcode thread (http://talk.maemo.org/showthread.php...light=mbarcode) whether to separate the barcode scanning bit (e.g. mbarcode) from the app which does the processing/other things with the barcode information.

I'm still undecided tbh whether it would be better for a light-weight mbarcode (or similar) which just scans the barcodes, and then sends the information over dbus for other apps to use, or for mbarcode itself to have plugins so that various apps could be integrated with it (i.e. the barcode scanner).

What are your thoughts?
 
Posts: 252 | Thanked: 252 times | Joined on Nov 2009
#10
I thought you were talking about the AWS as in Amazon's cloud computing solution, where they offer low-cost servers in the cloud. Apparently they have the same name for their API to access product reviews. After all, they are all web services.

When it comes to whether to separate the bar code scanning from the app I would say that it depends on how much time you've got on your hands. Making mbarcode as extendible and reusable as possible is definitely a good idea. In my opinion the best would be both to make mbarcode send DBus messages, able to integrate plug ins and even make a library for other apps which needs the functions as code.

I'm not sure how much should be done now anyways though. All in all, it is not that hard for a developer to create an application using zbar, which means there is already a light-weight framework available. On the other hand, you are integrating important functions like autofocus which could be very useful for other developers, but these are already available in the source code, and I'm not sure it is worth spending time on making the necessary wrappers for these other than some simple DBus messages. At least not yet. In the first place it might be better to make a killer app, and just keep in mind that all functions should be made in a way where it is possible to "open" them up in the future.

Just to show how much one can do with zbar and Qt already, I've made a simple app now. It does not show the camera output and does no autofocus, but it scans barcodes perfectly. At least with my webcam, as I haven't got a N900 to test with yet (stupid delays ), and only with some huge, printed barcodes since my webcam has no macro focus whatsoever.

I'll post it here just to show you how few lines of code one actually need to scan barcodes using zbar and Qt. It is written as a Qt GUI app using Qt Creator. All you need in addition to this source code is an ui with a button named btn_test, and a label named lbl_test. Just hit the button, hold a barcode in front of your camera and the number should appear in the label.

project.pro
Code:
QT += network \
    xml
TARGET = informi
TEMPLATE = app
CONFIG += link_pkgconfig
PKGCONFIG = zbar-qt
SOURCES += main.cpp \
    mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
mainwindow.h
Code:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

private slots:
    void slotTest();
    void slotDecode(int type, const QString &text);
};

#endif // MAINWINDOW_H
mainwindow.cpp
Code:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <zbar/QZBar.h>

using namespace std;
using namespace zbar;

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    connect(ui->btn_test,SIGNAL(clicked()),SLOT(slotTest()));

}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::slotTest() {
    QZBar *zbar = new QZBar(this);
    zbar->setVideoDevice("/dev/video0");
    zbar->setVideoEnabled(true);
    connect(zbar,SIGNAL(decoded(int,QString)),SLOT(slotDecode(int,QString)));
}

void MainWindow::slotDecode(int type, const QString &text) {
    ui->lbl_test->setText(text);
}
 

The Following User Says Thank You to dragly For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 22:59.