Announcement

  •  » Requests
  •  » Email and SMS submission

#16 2010-09-20 12:14:53

mael2
Member
1970-01-01
1

Re: Email and SMS submission

Hi  (I'm mlg),
Jiwigo uses apache HTTPClient to connect to piwigo's webservice. I don't know if you can use it in an android application.
The project structure is the following :
fr.mael.jiwigo.dao -> calls to webservice
fr.mael.jiwigo.service -> calls to dao
fr.mael.jiwigo.ui -> calls to service
The Data Access Objects (dao) use a "SessionManager" (which is in fr.mael.jiwigo.transverse.session) to execute queries on the webservice.
This method executes the methods on the webservice and returns the result as a string :

Code:

    public String executerReturnString(String methode, String... parametres) {
  if (parametres.length % 2 != 0 && !(parametres == null)) {
      try {
    throw new Exception("Le nombre de parametres doit etre pair");
      } catch (Exception e) {
    LOG.error(Outil.getStackTrace(e));
    return null;
      }
  }
  PostMethod method = new PostMethod(url);
  method.addParameter("method", methode);
  for (int i = 0; i < parametres.length; i += 2) {
      method.addParameter(parametres[i], parametres[i + 1]);
  }
  try {
      client.executeMethod(method);
      return (method.getResponseBodyAsString());
  } catch (HttpException e) {
      // TODO Auto-generated catch block
      LOG.error(Outil.getStackTrace(e));
  } catch (IOException e) {
      // TODO Auto-generated catch block
      LOG.error(Outil.getStackTrace(e));
  } catch (IllegalArgumentException e) {
      LOG.error(Outil.getStackTrace(e));
      JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_connexionError"), Messages
        .getMessage("error"), JOptionPane.ERROR_MESSAGE);
  } finally {
      method.releaseConnection();
  }
  return null;

    }

The parameters are : methode : the name of the method of the webservice
parameters : the parameters of the method
for instance, I can use : executerReturnString("pwg.categories.add","name", "the name", "parent", "15");

Last edited by mael2 (2010-09-20 12:16:38)

Offline

 

#17 2010-10-13 11:31:50

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Email and SMS submission

Hi,

There seems to be several coders interested in creating an Piwigo client for Android. Let's sum up the current situation:

* muoi as created an Android application ImageApp which does basic display from a Piwigo gallery

* anthony43 is the author of G2Android the MenaltoGallery client for Android and would like to make it compatible with Piwigo and asks for a Java API which encapsulates calls to Piwigo web API.

* fcoiffie (author of the export to Piwigo plugin for Digikam) is also interested

* mlg (mael2, author of Jiwigo : Piwigo on your desktop, written in Java) is also interested and has already coded in Java the calls to Piwigo API for Jiwigo

* stentor142 is also interested see [Forum, topic 16311] Command line [again]

As far as I see it, it seems that making G2Android compatible with Piwigo API would be the easiest way to have a full featured Android client for Piwigo. anthony43, do you think the best way to go is to have a separate application, forked from G2Android, or to make G2Android compliant?

There is obviously enough coding skills to create an Android client for Piwigo :-) Let's make it!

Offline

 

#18 2010-10-13 15:05:34

fcoiffie
Member
1970-01-01
15

Re: Email and SMS submission

I share the view that the android application for Gallery 2 could be a really good starting point as it already implements several important features (like cache, upload, reusing standard zoom feature, camera support).
Now, we need the point of view of anthony43 about the feasability and the requirements. And next, we need a motivated Android developper.

Offline

 

#19 2010-10-13 16:44:19

anthony43
Member
http://blog.dahanne.net
2010-08-24
25

Re: Email and SMS submission

Hello all !
Thank you for your interest in G2Android !
Here is my status :
* I'm currently working on G3 (http://gallery.menalto.com/) Java API, my work is located on github (http://github.com/anthonydahanne/g3-java-client)
* I'm also maintaining G2Android (http://code.google.com/p/g2android/) and as I told you, many features are already available (browsing gallery, creating albums, uploading photo, cache, integration with Android gallery, camera) there are some bugs though (http://code.google.com/p/g2android/issues/list ) and room for improvements too; features such as dealing with multiple galleries and HTTPS support are the most desired features

What I was planning to do in the next weeks :
* move g2android to github
* re factor it to have a standard interface for the connection layer (addphoto(), login(), createAlbum(), etc..)
* move the current g2 connection layer to another independent project
* integrate the g3 java api
* and hopefully integrate piwigo Java API, if any available (or create it)

So, to answer your questions :
* Yes ! I would be really happy to have Piwigo integration in g2android
* but first a communication interface for g2, g3 and piwigo should be designed
* and also a piwigo java api should exist first (a very lightweight one, using most of the android http libraries->apache http client, without adding some others dependencies, see http://github.com/anthonydahanne/g3-java-client )

Suggested Next steps :
* If someone already designed a working piwigo java api, I would be glad to have a look at it (I just had a quick look at jiwigo; and it looks good; is there a public repository svn or git somewhere ?)
* I have to refactor g2android to provide a clear connection interface
* then we could integrate the piwigo java api in g2android (and rename it at the same time ! ;-) )

I'll get back to you (via this post) as soon  as I have a stable interface for the connection layer (by the end of the month); then I will ask on this forum post if anyone is willing to integrate his piwigo java api to g2android (of course I will be able to help et au besoin je parle francais aussi)

Offline

 

#20 2010-10-14 00:56:31

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Email and SMS submission

Thank you anthony43 for the current state of G2Android. The separation of the communication interfaces and other parts of the application will be nice indeed. Your steps are very clear and I have no doubt Piwigo will feel comfortable in the future *Android application :-)

anthony43 wrote:

(I just had a quick look at jiwigo; and it looks good; is there a public repository svn or git somewhere ?)

* Browse Jiwigo source code
* Jiwigo source code SVN repository

mlg, would you like to take a look at the g3 java api and see if a similar API could be built, based on what was already done in Jiwigo?

anthony43 wrote:

(of course I will be able to help et au besoin je parle francais aussi)

Let's keep French language either on the French forum or in private emails ;-) (mlg/fcoiffie speak French)

Offline

 

#21 2010-10-14 09:55:09

fcoiffie
Member
1970-01-01
15

Re: Email and SMS submission

Anthony43,

Is there some instructions on a wiki page which explain how to quickly compile G2Android ?

Offline

 

#22 2010-10-14 14:48:43

fcoiffie
Member
1970-01-01
15

Re: Email and SMS submission

To reply to myself : It's quite easy :
1. Install the Android SDK and Eclipse http://developer.android.com/sdk/index.html
2. Checkout the application with svn checkout http://g2android.googlecode.com/svn/trunk/ g2android-read-only
3. In Eclipse, Import the existing project in the workspace by selecting g2android-read-only/g2android
4. In Eclipse, select Project | Clean... to remove the strange error about the missing 'gen' directory
5. With Context menu on the project, select Run As | Android application to launch it

Offline

 

#23 2010-10-14 18:40:09

anthony43
Member
http://blog.dahanne.net
2010-08-24
25

Re: Email and SMS submission

great ! I wouldn't have explained this better !
Thanks ! (I will add those explanations in the wiki !)
Anthony

Offline

 

#24 2010-11-01 03:40:54

anthony43
Member
http://blog.dahanne.net
2010-08-24
25

Re: Email and SMS submission

Hello all !
I (really ;-) ) started working on the followup of G2Android, ReGalAndroid
It is hosted on github, is pretty unstable right now, but you can definitely have a look at the code here :
http://github.com/anthonydahanne/ReGalAndroid

Here is actually the remote gallery interface that I could extract from G2Android :
http://github.com/anthonydahanne/ReGalA … llery.java

Well, not really clean for now as I'm not done yet with the refactoring ; I'm currently trying to make my g3 java api client
http://github.com/anthonydahanne/g3-java-client
fit with this interface; but hey,  I have problems as G2 and G3 remote APIs are really different...so I guess Piwigo one should be !

Anyway, I'll get back to you all when I feel the interface is stable enough to start adding piwigo support from Jiwigo (or any other java client) source code
Bye,
Anthony

Offline

 

#25 2010-11-02 13:25:44

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Email and SMS submission

Great news anthony43!

I've recently added some new methods in Piwigo web API : pwg.images.delete, pwg.categories.delete, pwg.categories.move. You can get them with [extension by plg] pwg.images.addSimple (which of course also brings pwg.images.addSimple method). These new methods were added because Vladimir Vinogradsky is working on a Publish plugin from Lightroom to Piwigo. So the message is: if you need improvement/new features in Piwigo web API, just ask!

Offline

 

#26 2010-11-15 05:56:45

anthony43
Member
http://blog.dahanne.net
2010-08-24
25

Re: Email and SMS submission

Hello all !
I'm about to release the first stable version of ReGalAndroid (the follow-up of G2Android) as I have now finished to re design the code (true separation between the Java Remote API for G2 and G3 and the Android app).
Currently, I have G2 fully working (all the features that were already in g2Android) and G3 authentication, albums and photos browsing.
I had a look at Jiwigo and it seems to me that there is everything in it I need to add Piwigo support to ReGalAndroid.
I wrote to mlg (the author of Jiwigo) a few days ago to ask him to split his project in 2 modules (a remote api one and a graphical one; for me to only import the remote api module) but I did not get any answers yet...
Feel free to have a look at the codebase of ReGalAndroid; I should upload a binary any time soon (I need some art now...)

https://github.com/anthonydahanne/ReGalAndroid

Piwigo support is near ;-)

Offline

 

#27 2010-11-15 15:39:36

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Email and SMS submission

I notified mlg about your email, I think he will give you an answer.

For your information, as I was working on improving Piwigo API for Lightroom integration, I have added some new methods:

* pwg.images.delete : remove a photo
* pwg.categories.delete : remove a category and remove orphan photos
* pwg.categories.move : change the parent categories

These new methods will be added in Piwigo 2.2. For now they are available when you install [extension by plg] pwg.images.addSimple

Offline

 

#28 2010-12-04 22:36:51

anthony43
Member
http://blog.dahanne.net
2010-08-24
25

Re: Email and SMS submission

Hello all !
Finally, here it is, first beta version of ReGalAndroid with Piwigo support !
You can get if there :
http://code.google.com/p/regalandroid/downloads/list

Please test it, report any bugs on the issues page :
http://code.google.com/p/regalandroid/issues/list

Don't forget that just authentication, browsing albums and browsing photos is implemented !

You can have a look at the code there :
https://github.com/anthonydahanne/ReGalAndroid

Many, many thanks to Mael, for your help and your authorisation to use Jiwigo code ! It helped a lot !

I'm waiting for your impressions / suggestions/ critics !
It will be on the market before Xmas.

Offline

 

#29 2010-12-07 21:39:07

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13791

Re: Email and SMS submission

This is a good news anthony43, unfortunately I don't have my Android phone yet so I can't make any test for now :-/

Offline

 

#30 2010-12-08 09:09:44

fcoiffie
Member
1970-01-01
15

Re: Email and SMS submission

I made some tests and it basically works.
In fact, the main problem may be due to the Piwigo gallery which is hosted on a slow server : I got some "net.dahanne.gallery.commons.remote. GalleryConnectionException : No wrapped connection." or "net.dahanne.gallery.commons.remote. GalleryConnectionException : Request aborted"

Moreover, on photos where I got errors, now, the cache contains an empty photo (and there is no way to force to reload it).

It seems that the application doesn't manage correctly filenames with accent : With a photo, I get "regalandroid.utils.FileHandlingException : <my filename with é and è > (Invalid Argument)"

But, I would like to reproduce all these problems with the android simulator on a PC.

And, of course, thank you very much for this work !

Offline

 
  •  » Requests
  •  » Email and SMS submission

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact