forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: ISANexusDev on September 09, 2014, 07:14:08 pm

Title: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on September 09, 2014, 07:14:08 pm
Hello!

Just created this new plugin:

AndroidCPG Plugin ( https://github.com/IsaNexusDev/androidcpg/raw/master/androidcpg_coppermine_plugin.zip ) - Allows Android CPG application to connect with the gallery's server. Allowed operations: create albums and upload files (Images and videos)

and its correspondent application for android:

AndroidCPG ( https://f-droid.org/repo/com.isanexusdev.androidcpg_6.apk ) - Create albums and upload files (Images and videos) through the standard Android Share context menu.

The instructions are:

1- Install and activate the AndroidCPG Plugin to your Coppermine gallery.
2- Install AndroidCPG to your Android device. It is not at Google Play... But it is at F-Droid ( https://f-droid.org ) Open Source App Repository. You can install AndroidCPG by installing F-Droid App repository ( https://f-droid.org/FDroid.apk ) to your device and searching for AndroidCPG, Or directly from: https://f-droid.org/repo/com.isanexusdev.androidcpg_6.apk . If you need additional instructions read http://www.maketecheasier.com/install-applications-without-the-market/
3- Open the AndroidCPG main activity, configure it (Host address, username and password) and exit
4- Go as example to the Android Gallery, navigate your photos/videos and select one (or several), press Share and choose AndroidCPG. At this point the AndroidCPG share activity will appear.
5- select the album to upload (or create a new one) and press Upload Photo/Video. Activity will automatically exit when uploads are done.

* Steps 1, 2 and 3 need to be done just once.
* Every time you want to upload more videos or photos just repeat steps 4,5

Source code For AndroidCPG (both server and client side) is available. Modify as you want or need... If you write to this post with new versions I'm sure people will appreciate :-)

Also, I listen for bugs or improvement ideas.

See more at the project page: http://androidcpg.mine.bz/
Github address: https://github.com/IsaNexusDev/androidcpg
AndroidCPG F-Droid page: https://f-droid.org/repository/browse/?fdid=com.isanexusdev.androidcpg

HISTORY
--------------
* 29/03/2015 - Version 1.5
    - Bridge support (only MyBB at the moment)
    - UTF8 support (title, description, username, password, album name)
    - Show Result button is visible at ShareActivity when login or fetch albums fails
    - Greek Translation
    - Translator credits at preferences. Thanks dimangelid.
* 02/01/2015 - Version 1.4
    - Android Vine application support (Upload Vine remote videos to Coppermine) see comment: http://forum.coppermine-gallery.net/index.php/topic,77788#msg377063
    - Give feedback when there are no available albums (Upload activity)
* 30/11/2014 - Version 1.3
    - Android Vimeo application support (Upload Vimeo remote videos to Coppermine)
    - Upload Result activity (Clicking final upload notification)
    - Autofill title and description for Youtube and Vimeo videos.
    - Not used permissions removed.
    - Added more supported devices.
* 26/11/2014 - Possibility to add image or video's title and description + More compatible notifications...and so, android_support_v4 dependency has been finally removed, reducing AdroidCPG.apk size from 350Kb to 100Kb... Gorgeous!
* 30/10/2014 - Login Result when Error + Respect Plugin enabled/disabled logic (both androidcpg_coppermine_plugin.zip and AndroidCPG.zip are updated, anyway, backwards compatibily has been kept)
* Double Login option (At AndroidCPG activity preferences). In case that SendShare Activity fails to login due to Android CookieHandler bug, enable this option (This might happen at HoneyComb or other devices)
* Compatibility Fixes (Progess Animator crash in some devices + do NOT follow redirects)
* Code refactor (moved whole project from AndroidStudio to Eclipse). APK size went from 855K to 353K, Great!
* Custom thumbnails upload (using plugin http://forum.coppermine-gallery.net/index.php/topic,60272.0.html)
* Youtube videos upload (using plugin http://forum.coppermine-gallery.net/index.php/topic,60195.0.html) see comment: http://forum.coppermine-gallery.net/index.php/topic,77788#msg376147
* UploadService handles uploads
* Initial
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on September 11, 2014, 02:41:37 pm
Updated AndroidCPG application. Now Uploads are handled by a Service instead of an Activity.

UploadActivity (SendShare) is just a receiver of the UploadService.

Noticeable Benefit: even the Upload activity is paused/closed (As example, because the user navigates to other activity or device screen is turned off) the uploads will continue normally until they are finished.

Additionally, Upload progress is shown at Notification bar. A notification ticker (with the progress) is also shown to the user every 30 seconds.

Source code is attached, Enjoy and Remember: at http://androidcpg.mine.bz/ there is a direct link to download the compiled apk (for easier install to your device)

Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on September 25, 2014, 02:25:36 am
New Update for AndroidCPG application:

Now youtube videos can also be shared to your coppermine gallery by pressing Android Youtube application share button and choosing AndroidCPG in the context menu.

Extra requirement (For youtube videos to success uploading and play):

-At server side the Remote videos extension version 1.9 or newer (http://forum.coppermine-gallery.net/index.php/topic,60195.0.html) needs to be installed and enabled.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Phill Luckhurst on September 25, 2014, 11:38:59 am
Excellent work.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Αndré on September 25, 2014, 01:36:08 pm
As, Android Youtube application sometimes use http://youtu.be/VID_ID format, I needed to modify sightly the Remote videos extension (I attach the modified version) Changes are at codebase.php:
I'll update search pattern accordingly as soon as possible.
Title: Re: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on September 25, 2014, 03:00:15 pm
I'll update search pattern accordingly as soon as possible.

Thank you for that! :)
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on September 27, 2014, 02:33:14 am
Another nice update for AndroidCPG,

At Video upload, also its preview image (thumbnail) will be uploaded.

In the case of local video upload, the thumbnail will be the frame at the half of the video... Meaning: in a 100 seconds video, the thumbnail will be the frame at second 50.
In the case of Youtube video upload, the thumbnail will be the video's original thumbnail at youtube.

For being able to upload these thumbnails the Custom Thumbnail plugin (http://forum.coppermine-gallery.net/index.php/topic,60272.0.html) needs to be installed and enabled in the target Coppermine Gallery.

AndroidCPG will detect if Custom Thumbnail plugin is installed and if not, thumbnails extraction and upload will be just ignored.

Source code and APK are inside the attached zip file.

Have fun!
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on October 09, 2014, 01:34:35 pm
Some Android HoneyComb devices have been reported to fail at SendShare Activity while uploading image or Videos. The problem is that SendShare doesn't log in properly to the coppermine gallery.

This problem might be related with HoneyComb's CookieHandler buggy version. Double Login option (At AndroidCPG activity preferences) might fix this problem.

So, if you are having issues login in to your coppermine gallery while trying to share an image or video, please, download latest AndroidCPG version, install it, open AndroidCPG Activity and (without changing your credentials):

press Settings button
press Preferences
check Double Login
press back, at this point AndroidCPG will try to login again to the coppermine gallery and it should success. If so, press Exit and try to share again the image or video

AndroidCPG.zip (including AndroidCPG.apk) can be downloaded from this thread's first post
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: MrMister247 on October 28, 2014, 07:29:01 pm
Hi!

I've installed Coppermine today and was happy to find an Android app to upload my stuff.

Installed the Plugin and activated it (I find it under the installed plugins at the Admin site).
Nevertheless my Android say's that I should aks the Gallery-Admin to install the plugin because it cannot be found.

Any idea how to find the problem? Where to start searching what it could be?

Thanks in advance!

Mr Mister
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on October 28, 2014, 10:00:30 pm
Installed the Plugin and activated it (I find it under the installed plugins at the Admin site).
Nevertheless my Android say's that I should aks the Gallery-Admin to install the plugin because it cannot be found.

Hello,

Can you write the exact error message?

It might be:

"Error connecting host!", "Host doesn't contain a Coppermine Gallery!" or maybe, "This Coppermine Gallery is missing AndroidCPG plugin. Contact the administrator to install it!"

Also, can you verify that /path_to_your_coppermine_gallery/plugins/androidcpg/ folder exists in your host? you can test it like this:

http://your_coppermine_gallery_host/plugins/androidcpg/login.php

You should get something different than:

Code: [Select]
Not Found

The requested URL /plugins/androidcpg/login.php was not found on this server.

If you get a Not Found error, It means that the plugin hasn't been installed properly and then, you should verify that the plugin is at /path_to_your_coppermine_gallery/plugins/androidcpg/ and all the files inside this folder are readable by the web server's assigned user/group.

Thanks
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: MrMister247 on October 29, 2014, 08:22:18 am
Hi!
Thank you for your quick answer!

Sorry, I didn't know that there are more Errormessages....

The Errormessage is: "This Coppermine Gallery is missing AndroidCPG plugin. Contact the administrator to install it!"

I've just made the whole folder rw to the WebServer-User (also tried rw to everyone) - no luck.

Using the full Path in die App worked half. I see now the Login-Fields, but trying to log-in faild ("Wrong Username or Password"). But I am logged in with this credentials via web browser.... Very strange.

I've created a new User with a very simple password, this didn't work, too..

I've deleted the androidcpg - folder und downloaded it once more and installed the plugin - unfortunately same error.

I've tried the "Double Login" - function without success.

Do you know anything else to try?

Best regards,
MrMister



Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on October 29, 2014, 02:46:09 pm
Hi!
Thank you for your quick answer!

No problem!  :)

Do you know anything else to try?

I attached a new version in the first post. Both the plugin and the Android application are modified.

Among other changes, In this version, when login fails, it will appear a button "Show Result" and pressing it, the HTML response from the server and its code OR the error stacktrace will be shown.

So, download both files from first post, install the plugin and APK and try to login. If it fails see the result. Maybe you can figure out what is going wrong.

You can swith to "Show source" mode and scroll down to locate where is the cpg_message

The login success when:

Code: [Select]
mReply.toLowerCase().contains("<div class=\"cpg_message_success\">"))
so, somewhere in the html code should be: class="cpg_message_success"

If you have some Java knowledge, you can take a look to IsLoggedInAsyncTask, There the Login happens...

Anyway, try to analize the Html output and if problem persist, reply to this thread (or write me an email to isanexus at cryptolab.net ) with the HTML CODE (you can copy it pressing the "Copy Text" button. Before sending the reply be sure that there is no sensitive data in the HTML CODE, as example HostName, username...)

Thanks for your help
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on November 25, 2014, 10:40:16 am
In order to make easier to maintain and install AndroidCPG to your device I included AndroidCPG to F-Droid ( https://f-droid.org ) Open Source App Repository.

AndroidCPG F-Droid page: https://f-droid.org/repository/browse/?fdid=com.isanexusdev.androidcpg

Direct link to the latest APK: https://f-droid.org/repo/com.isanexusdev.androidcpg_2.apk
Direct link to the latest Source (Including Coppermine Plugin): https://f-droid.org/repo/com.isanexusdev.androidcpg_2_src.tar.gz
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on November 30, 2014, 11:09:44 am
Update 1.3 for AndroidCPG application:

Now Vimeo videos can also be shared to your coppermine gallery by pressing Android Vimeo application share button and choosing AndroidCPG in the context menu.

Extra requirement (For Vimeo videos to success uploading and play):

-At server side the Remote videos extension (http://forum.coppermine-gallery.net/index.php/topic,60195.0.html) needs to be installed and enabled.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Buster452 on December 30, 2014, 12:39:41 am
I just installed the plugin and AndroidCPG.  Login and test works from my phone, but when I try to upload a photo it gets to a screen for selecting or creating an album and sending the photo, but nothing works.  Can't click buttons or select from a list of albums.  Just stuck.

I enabled double-login, but still it doesn't work.

I'm running a Samsung Galaxy S5 on android 4.4.4.

Any ideas on how I can get this running?

TIA,
   Buster
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on December 30, 2014, 07:39:40 pm
I just installed the plugin and AndroidCPG.  Login and test works from my phone, but when I try to upload a photo it gets to a screen for selecting or creating an album and sending the photo, but nothing works.  Can't click buttons or select from a list of albums.  Just stuck.

I enabled double-login, but still it doesn't work.

I'm running a Samsung Galaxy S5 on android 4.4.4.

Any ideas on how I can get this running?

TIA,
   Buster

I have tested this with S5 running a modified kitkat 4.4.4 (kernel version 3.4.103) built by cyanhacker and it works correctly (both login at LoginActivity and album retrieve + photo upload at ShareActivity).

I know that some kitkat builds might have a buggy CookieManager (see: https://code.google.com/p/android/issues/detail?id=65786 ) and this will affect login and album retrieve operations at ShareActivity.

I would recommend to upgrade your phone to newer Lollipop (5.0) I know that CookieManager has been fixed. I haven't tested AndroidCPG with Android 5.0... But I believe it works
According to this post, 5.0 should be available for your phone already: http://www.androidcentral.com/lollipop-update-galaxy-s5-now-live-more-european-territories

Anyway, I will try to investigate more and bring a decent solution for official 4.4.4 android phones.

Happy New Year 2015!!
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on December 31, 2014, 11:59:25 am
I just installed the plugin and AndroidCPG.  Login and test works from my phone, but when I try to upload a photo it gets to a screen for selecting or creating an album and sending the photo, but nothing works.  Can't click buttons or select from a list of albums.  Just stuck.

I enabled double-login, but still it doesn't work.

I'm running a Samsung Galaxy S5 on android 4.4.4.

Any ideas on how I can get this running?

TIA,
   Buster

I have been looking into the AndroidCPG code. It looks like if you have not any album at coppermine previously created for your user then the Upload Activity won't let you do anything nor show any information about what is going on. I think this might be the issue you are experiencing.

This is now fixed at AndroidCPG version 1.4 (you can download and install it following 1st post in this thread instructions). So, if you have no albums then the Create Album Button will be enabled and a toast message will be shown.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on January 03, 2015, 01:35:26 pm
Starting from AndroidCPG version 1.4, Vine videos can also be shared to your coppermine gallery by pressing Android Vine application share button and choosing AndroidCPG in the context menu.

Extra requirement (For Vine videos to success uploading and play):

- At server side the Remote videos extension version 1.9 or newer (http://forum.coppermine-gallery.net/index.php/topic,60195.0.html) needs to be installed and enabled.

*NOTES (If you are updating previously installed Remote videos extension):

- After plugin update, login to coppermine admin panel, go to plugins, disable remote videos plugin and enable it again, after this the vine extension is recognized as valid file extension.
- At remote videos plugin configuration, you can configure the vine videos mode as Postcard or Simple and if you want them to start with sound or muted.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Αndré on January 31, 2015, 02:01:05 pm
Vine support has been added to version 1.9 of the Remote Videos plugin.
Title: Re: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on January 31, 2015, 07:58:13 pm
Vine support has been added to version 1.9 of the Remote Videos plugin.

Works like a charm, thanks :)

Thread for Remote Videos plugin: http://forum.coppermine-gallery.net/index.php/topic,60195.0.html
Remote Videos plugin version 1.9: http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=60195.0;attach=42975
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: dimangelid on March 26, 2015, 10:42:08 am
Hello,
I'm using Coppermine as me gallery for many years. I decided to try that plugin in order to give my users the ability to upload photos from their mobile phone. I have set up a bridge with my forum (MyBB) in order not to require double registrations. Probably the plugin can't use the bridge in order to login to the gallery and displays the message "Wrong username or password!" . When i press "Test Host" it displays "Host is OK!" . I don't want to deactivate the bridge and request from my users to make a double registration in order to use both the gallery and the forum. What can i do for that?
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 26, 2015, 11:06:11 am
Hello,
I'm using Coppermine as me gallery for many years. I decided to try that plugin in order to give my users the ability to upload photos from their mobile phone. I have set up a bridge with my forum (MyBB) in order not to require double registrations. Probably the plugin can't use the bridge in order to login to the gallery and displays the message "Wrong username or password!" . When i press "Test Host" it displays "Host is OK!" . I don't want to deactivate the bridge and request from my users to make a double registration in order to use both the gallery and the forum. What can i do for that?

Thank you for reporting this issue, I will look into it in detail and fix asap.

Can you tell how is your coppermine/mybb configuration. I mean:

* Is mybb bridged into coppermine as main service or other way around ( http://www.communityplugins.com/forum/forumdisplay.php?fid=6 )?
* mybb, coppermine and bridge (if applicable) versions.
* In the case you are using other than the coppermine official bridges (at admin->configure -> bridges) I would appreciate, if possible, a link from where I can download the coppermine<->mybb bridge, that you are using.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: dimangelid on March 26, 2015, 06:09:56 pm
Thank you for reporting this issue, I will look into it in detail and fix asap.

Can you tell how is your coppermine/mybb configuration. I mean:

* Is mybb bridged into coppermine as main service or other way around ( http://www.communityplugins.com/forum/forumdisplay.php?fid=6 )?
* mybb, coppermine and bridge (if applicable) versions.
* In the case you are using other than the coppermine official bridges (at admin->configure -> bridges) I would appreciate, if possible, a link from where I can download the coppermine<->mybb bridge, that you are using.

Hello and thank you for the quick reply :) Here are the answers you need:

1) The bridge between MyBB and Coppermine has been setup using the integrated Bridge feature of Coppermine.
2) Coppermine version is 1.5.20 and MyBB version is 1.6.11
3) This does not apply to my case, because i'm using the integrated Coppermine bridge feature.

If you need any other information, i'm glad to provide them ;)
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 26, 2015, 07:06:19 pm

1) The bridge between MyBB and Coppermine has been setup using the integrated Bridge feature of Coppermine.
2) Coppermine version is 1.5.20 and MyBB version is 1.6.11
3) This does not apply to my case, because i'm using the integrated Coppermine bridge feature.

If you need any other information, i'm glad to provide them ;)

Thank you, this info is enough to reproduce your environment, find the problem and fix it. I'll come back to you in some days with a solution (I hope)  :)
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 27, 2015, 07:57:16 pm
Hello,
I'm using Coppermine as me gallery for many years. I decided to try that plugin in order to give my users the ability to upload photos from their mobile phone. I have set up a bridge with my forum (MyBB) in order not to require double registrations. Probably the plugin can't use the bridge in order to login to the gallery and displays the message "Wrong username or password!" . When i press "Test Host" it displays "Host is OK!" . I don't want to deactivate the bridge and request from my users to make a double registration in order to use both the gallery and the forum. What can i do for that?

I have implemented new functionality in order to support MyBB bridge. I tried in my test environment and looks like it works. Still, you can test it better before I release a new AndroidCPG version.

I attach a Zip file where you can find the APK (you'll need to uninstall your previous AndroidCPG version from your android device and install this one) and also inside the zip there is another zip for the server (androidcpg_coppermine_plugin_bridge_beta.zip), you need to install this zip file as a plugin or extract its contents to your gallery plugins sub-directory.

Once done, normal login in AndroidCPG should success. Also image/video/remote_video uploading should work.

You might see (from server's plugin code) that, at the moment, everything is tailored for MyBB bridge. No other bridge (except MyBB and the default_coppermine_bridge<meaning:no bridge>) will work with AndroidCPG in this beta version.

Please, give some feedback
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: dimangelid on March 28, 2015, 01:38:39 am
I have implemented new functionality in order to support MyBB bridge. I tried in my test environment and looks like it works. Still, you can test it better before I release a new AndroidCPG version.

I attach a Zip file where you can find the APK (you'll need to uninstall your previous AndroidCPG version from your android device and install this one) and also inside the zip there is another zip for the server (androidcpg_coppermine_plugin_bridge_beta.zip), you need to install this zip file as a plugin or extract its contents to your gallery plugins sub-directory.

Once done, normal login in AndroidCPG should success. Also image/video/remote_video uploading should work.

You might see (from server's plugin code) that, at the moment, everything is tailored for MyBB bridge. No other bridge (except MyBB and the default_coppermine_bridge<meaning:no bridge>) will work with AndroidCPG in this beta version.

Please, give some feedback

I just tried your fix. It connects perfectly to Coppermine but when i get the window that asks to select an album, none of the buttons do anything and the album list is not displayed. I tried to press them many times, change my screen orientation but nothing. My phone is a LG Optimus G Pro with Android 4.4.2 and it is rooted.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 28, 2015, 11:54:51 am
...none of the buttons do anything and the album list is not displayed...

Ok, I compiled an improved version for previous APK, this one will inform you what is the problem at ShareActivity. In your case, you are experiencing one of these problems:


In all these cases, a "Show Result" button will appear and when you hit it, a textbox with detailed information will appear.

If you got that "Show Result" button, please, hit it and try to figure out what is wrong. If it is too complicated to figure out, then press the "Copy Text" and write that output to this thread (deleting any information that you consider private: IPs...)

This is how I set up my test environment:


Then:


So, don't worry. It is going to work for you too  :)
[/list]
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 28, 2015, 11:58:49 am
.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: dimangelid on March 28, 2015, 01:50:51 pm
Ok, I compiled an improved version for previous APK, this one will inform you what is the problem at ShareActivity. In your case, you are experiencing one of these problems:

  • Login doesn't success at ShareActivity: you will see a Toast saying "Wrong username or password!". To solve this problem you can try enabling "Double login" preference.
  • Album fetch doesn't success at ShareActivity: you will see a Toast saying "Failed fetching albums!"
  • Coppermine plugin returns inconsistent data:
  • Category id or Category position not set.
  • Can't create albums and No albums. In this is the case, be sure that your coppermine account is album creation capable OR it has at least 1 album assigned for file uploads.

In all these cases, a "Show Result" button will appear and when you hit it, a textbox with detailed information will appear.

If you got that "Show Result" button, please, hit it and try to figure out what is wrong. If it is too complicated to figure out, then press the "Copy Text" and write that output to this thread (deleting any information that you consider private: IPs...)

This is how I set up my test environment:

  • Vanilla Coppermine 1.5.2 (at web server root)
  • Vanilla MyBB 1.6.16 (latest 1.6 series MyBB Forum version) (at web server root/BBForum)
  • Created both at Coppermine and MyBB same account: test/test
  • At Coppermine configured test account to have proper upload/album access rights/limits
  • Set up MyBB bridge, with cookies path "/" both at coppermine and MyBB

Then:

  • I logged in with AndroidCPG
  • I created an album with AndroidCPG's Share activity (checked at server side that album was created and linked to the coppermine's "test" account)
  • I Uploaded the file with AndroidCPG's Share activity (checked at server side that the file was uploaded and linked to the coppermine's "test" account under the previous created album)

So, don't worry. It is going to work for you too  :)
[/list]

I installed the attached .APK and it is working perfectly, only with Double Login. I noticed another problem: When i insert greek characters either at the image title or at image caption, these are not displayed in the added photo at the gallery. Latin characters or numbers are displayed perfectly. Here is the greek alphabet, in order to try it yourself if you want: αβγδεζηθικλμνξοπρσςτυφχψω . Also i would like to make a feature request: my gallery is a bus photos gallery and we have setup custom fields at coppermine in order our users to include the vehicle license plate, fleet number etc. Is it possible your application to retrieve these custom fields from coppermine, in order each user to be able to complete them?
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 28, 2015, 02:25:44 pm
I installed the attached .APK and it is working perfectly, only with Double Login. I noticed another problem: When i insert greek characters either at the image title or at image caption, these are not displayed in the added photo at the gallery. Latin characters or numbers are displayed perfectly. Here is the greek alphabet, in order to try it yourself if you want: αβγδεζηθικλμνξοπρσςτυφχψω . Also i would like to make a feature request: my gallery is a bus photos gallery and we have setup custom fields at coppermine in order our users to include the vehicle license plate, fleet number etc. Is it possible your application to retrieve these custom fields from coppermine, in order each user to be able to complete them?

Glad to hear that it worked for you!

About the Greek characters, I will investigate... Just one question, which "Collation" are your table fields? you can see this, as example, with phpmyadmin -> your coppermine database -> pictures table -> structure, see the title and  caption fields' collations. It would be nice to have them in a generic UTF8/UTF16 encoding, but well, don't change it if you are not completely sure what you are doing (you could damage/corrupt your database current data). As said, I will investigate if the problem comes at android encoding level.

About those vehicle extra fields, it would be better that you contact me privately (through this forum private message system) so we find out a way to implement and test this feature properly. It will be a pleasure to contribute, with my little piece of help, to Greece. From here my support to all of you and your fight for human rights and dignity. Long life to the Hellenic Republic! :)

BTW: Reading you came to my mind that AndroidCPG language support is limited right now to English and Spanish. Those of you who want to contribute to translations are very welcome. I attach the latest translation files, even the most appropriate would be to go to the repository ( https://code.google.com/p/androidcpg/source/browse/#git%2FAndroid%2Fres%2Fvalues ), fetch them (strings.xml and strings_activity_login.xml) directly from there, translate them and post them in this thread for me to handle them in a future version. Anyone doing this will be thanked and honored in the application credits :)
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: dimangelid on March 28, 2015, 03:46:02 pm
Glad to hear that it worked for you!

About the Greek characters, I will investigate... Just one question, which "Collation" are your table fields? you can see this, as example, with phpmyadmin -> your coppermine database -> pictures table -> structure, see the title and  caption fields' collations. It would be nice to have them in a generic UTF8/UTF16 encoding, but well, don't change it if you are not completely sure what you are doing (you could damage/corrupt your database current data). As said, I will investigate if the problem comes at android encoding level.

About those vehicle extra fields, it would be better that you contact me privately (through this forum private message system) so we find out a way to implement and test this feature properly. It will be a pleasure to contribute, with my little piece of help, to Greece. From here my support to all of you and your fight for human rights and dignity. Long life to the Hellenic Republic! :)

BTW: Reading you came to my mind that AndroidCPG language support is limited right now to English and Spanish. Those of you who want to contribute to translations are very welcome. I attach the latest translation files, even the most appropriate would be to go to the repository ( https://code.google.com/p/androidcpg/source/browse/#git%2FAndroid%2Fres%2Fvalues ), fetch them (strings.xml and strings_activity_login.xml) directly from there, translate them and post them in this thread for me to handle them in a future version. Anyone doing this will be thanked and honored in the application credits :)

I will contact you as soon as possible for my feature request. I thank you very much for your support to our country and wish you the best :) The Greek translation is ready from me ;)
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 28, 2015, 04:19:17 pm
The Greek translation is ready from me ;)

Here I attach the app (beta3) with your Greek translation and full UTF8 support. So, titles and captions should work correctly for Greek and other languages including non-ascii characters in their alphabets. Also album names, usernames and passwords go in UTF8.

Translations credits activity will be added in the official incoming version. Until that, receive this formal "thanks!"

PS: If you see any misspelling/grammar defect don't hesitate to contact for corrections.

Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: dimangelid on March 28, 2015, 04:56:29 pm
Here I attach the app (beta3) with your Greek translation and full UTF8 support. So, titles and captions should work correctly for Greek and other languages including non-ascii characters in their alphabets. Also album names, usernames and passwords go in UTF8.

Translations credits activity will be added in the official incoming version. Until that, receive this formal "thanks!"

PS: If you see any misspelling/grammar defect don't hesitate to contact for corrections.

I tried it now and both my translation and greek characters at title and caption work great! I also upload an edited version of strings_activity_login.xml because i detected a misspell. Thank you again very much for your help :) :) :)
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on March 29, 2015, 12:45:27 pm
Before I upload the changes to F-Droid I wanted to upload here the APK, plugin and sources for version 1.5

I moved the project sources from googlecode to github, since googlecode is about to shutdown. Github address for AndroidCPG is:

https://github.com/IsaNexusDev/androidcpg

Changelog:

* Bridge support (only MyBB at the moment)
* UTF8 support (title, description, username, password, album name)
* Show Result button is visible at ShareActivity when login or fetch albums fails
* Greek Translation
* Translator credits at preferences.

To dimangelid: please download latest https://github.com/IsaNexusDev/androidcpg/raw/master/androidcpg_coppermine_plugin.zip and overwrite your coppermine androidcpg plugin folder with the code in this version, since the code at db_input.php at AndroidCPG_bridgeBB_beta.zip had some code that will not work with your server, this code:

Code: [Select]
    $failurewritting = false;
    $picture_name_ori = null;
    if (in_array($matches[2], array('avi','mp4','3gp','m4v','flv','mpeg','mpg','mov','3pg','webm','wmv'))){
        $picture_name_ori = $uploaded_pic;
        if ($matches[2] == 'mp4'){
            $uploaded_pic_new = str_replace('.mp4','_ori.mp4',$uploaded_pic);
            if (!rename($uploaded_pic,$uploaded_pic_new)) {
                if (copy ($uploaded_pic,$uploaded_pic_new)) {
                    //chmod($dbfilename, 664);
                    unlink($uploaded_pic);
                } else {
                    $failurewritting = true;
                }
            }
            if (!$failurewritting){
                $uploaded_pic = $uploaded_pic_new;
            }
        } else {
            $picture_name = str_replace('.'. $matches[2],'.mp4' ,$picture_name);
        }
        $thumb_name = 'thumb_' . str_replace('.mp4','.jpg' ,$picture_name);
if (!$failurewritting){
    $cmd = 'nohup nice -n 10  encodevideo.sh "'.$uploaded_pic.'" "'.$dest_dir .$picture_name.'" "'.$dest_dir.$thumb_name.'" > encodelogs/encode_'.$picture_name.'.log & printf "%u" $!';
            $pid = shell_exec($cmd);
        }
    }

As seen, I use this code for automatic video encode when user uploads a video... but, if encodevideo.sh is missing from the server you will end up in not a very good situation :)

My encodevideo.sh code, if anyone interested is:

Code: [Select]
#!/bin/bash
#
# REQUIRED:
#
# Handbrake installation:
#
# sudo add-apt-repository  ppa:stebbins/handbrake-releases
# sudo apt-get update
# sudo apt-get install handbrake-gtk handbrake-cli
#
# FFMpeg installation:
#
# sudo apt-get install ffmpeg
#
# Imagemagik installation:
#
# sudo apt-get install imagemagick
#


# mp4 encoding supported by most android/Iphone devices
HandBrakeCLI --width 800 --aencoder aac --ab 160 -6 stereo --arate 44.1 -e x264 -q 20 -a 1 --modulus 2 --loose-anamorphic --rate 29.97 -x 8x8dct=0:ref=1:bframes=0:cabac=0:me=umh:mixed_ref=0:chroma_me=1:threads=3:lookahead_threads=1:sliced_threads=0:nr=0:decimate=1:interlaced=0:bluray_compat=0:constrained_intra=0:weightp=0:keyint=300:keyint_min=30:scenecut=40:intra_refresh=0:rc=crf:crf=20,0:qcomp=0,60:qpmin=0:qpmax=69:qpstep=4:ip_ratio=1,40:aq=1:1,00:chroma_qp_offset=-2:deadzone=21,11:fast_pskip=1:rc_lookahead=50 -i "$1" -o "$2"
echo video reencoded "$2"

if [ -f "$3" ]
then
    echo the thumb already exists "$3"
else
    #ffprobe and ffmpeg are part of ffmpeg package
    d=$(ffprobe -v quiet -print_format compact=print_section=0:nokey=1:escape=csv -show_entries format=duration "$2" 2>&1 | grep -o -P ".*?(?=\.)")
    d=$(( d / 3))

    ffmpeg -i "$2" -y -r 1 -vframes 1 -ss "$d" "$3"
   
    #convert and composite is part of imagemagick package
    convert "$3" -resize 120x120 "$3"
   
    echo composite -compose atop -gravity center video_watermark.png "$3" "$3.tmp.jpg"
    composite -compose atop -gravity center video_watermark.png "$3" "$3.tmp.jpg"
    mv -f "$3.tmp.jpg" "$3"
   
    echo created thumb "$3"
fi

As seen, video transcoding and image preview extraction is performed. If video_watermark.png exists, then It will be overlaid in the preview image
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Cynos on November 30, 2015, 11:20:52 am
Hello,

Thank you for this plug in, it looks great.

I have an issue, I can't use it.

- install both plug in and apk was easy
- I tested I can access to the plug in with its own adress path
- When I try to use Androidcpg onto the mobile, it returns "host doesn't contain a coppermine gallery".

* I use joomla 3 and last release of CPG vith the joomla CPG tunnel.
* I don't yet have a domain attached to the site, but I can access with the server adress with no problem
* I can access to coppermine with two adresses
server_adress.fr/index.php/cpg (joomla wrapper using tunnel)
server_adress.fr/galerie (direct access, not using joomla cpg tunnel)
Of course I tried both adresses in androidcpg config onto the mobile, with same result.

Do you think the problem is because I don't still have a domain name attached to CPG ?
Or could it be something else ?

Thanks for help.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on November 30, 2015, 08:29:08 pm
Hello,

Thank you for this plug in, it looks great.

I have an issue, I can't use it.

- install both plug in and apk was easy
- I tested I can access to the plug in with its own adress path
- When I try to use Androidcpg onto the mobile, it returns "host doesn't contain a coppermine gallery".

* I use joomla 3 and last release of CPG vith the joomla CPG tunnel.
* I don't yet have a domain attached to the site, but I can access with the server adress with no problem
* I can access to coppermine with two adresses
server_adress.fr/index.php/cpg (joomla wrapper using tunnel)
server_adress.fr/galerie (direct access, not using joomla cpg tunnel)
Of course I tried both adresses in androidcpg config onto the mobile, with same result.

Do you think the problem is because I don't still have a domain name attached to CPG ?
Or could it be something else ?

Thanks for help.

I think that the problem might be that you need to write an ending slash in the host address, something like this: h t t p://server_adress.fr/galerie/

Also, at h t t p://server_adress.fr/galerie/ should be at least these files: login.php, db_input.php, index.php and delete.php (as it should be in any Coppermine gallery installation folder).

If you are writing the host with the ending slash AND you are sure that the files (said before) are at that url AND still you are getting the same error then please poke me again. :-)

P.S. Most probably the address for joomla bridge to coppermine (h t t p://server_adress.fr/index.php/cpg/) won't work for AndroidCPG. But the direct access address to the gallery should be OK for AndroidCPG to work with no issues.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Cynos on December 01, 2015, 12:19:04 am
hello, thanks for reply.

It still don't work, but I understand why now because of your previous post.

- As I said I don't have a domain name for the moment, because the website is still on developpement.

- So androidcpg is trying to access to a "http://adress", but because I use a server adress there's no "http://".
Acces for coppermine is server_adress.fr/galerie (without http://)

Well I need to wait a domain name attached to the website to know if I could use androidcpg.

I want to thant you for the plugin and the time you spent to answer to me.
When I will have the domain name, I will let you know if it works.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: ISANexusDev on December 01, 2015, 02:49:57 am
hello, thanks for reply.

It still don't work, but I understand why now because of your previous post.

- As I said I don't have a domain name for the moment, because the website is still on developpement.

- So androidcpg is trying to access to a "http://adress", but because I use a server adress there's no "http://".
Acces for coppermine is server_adress.fr/galerie (without http://)

Well I need to wait a domain name attached to the website to know if I could use androidcpg.

I want to thant you for the plugin and the time you spent to answer to me.
When I will have the domain name, I will let you know if it works.

Uhmm, I see... AndroidCPG has this logic for hostnames:

If host is provided with prefix http:// or https:// it will be respected as it is, but if the protocol is not given then AndroidCPG will default to http://, in other words, http:// will be added as prefix to the provided hostname in the text field.

Anyway, I think it is possible to connect to your CPG gallery with AndroidCPG without a domain name:

AndroidCPG will work if you connect your phone to your local network (as example connecting with WIFI) and you provide the CPG gallery's IPaddress, as example: h t t p://192.168.43.6/galerie/ , or even from outside your local network (with your phone's own internet connection), if this is your need, by redirecting your router's port to the computer hosting the gallery and connecting to your public IP address with something like this: h t t p://92.48.43.66/galerie/ configured as Host in AndroidCPG.

BTW, and even is not helpful for your case, there are free dynamicDNS services keeping your hostname's IP address updated with the help of scripts, as example: https://freedns.afraid.org , this service in particular is also giving you a free subdomain name, in case you need it. Something like http://androidcpg.mine.bz  ;)
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Cynos on December 01, 2015, 11:24:50 am
thanks again for answer and for your help.

- well, I will just wait a couple of day, domain name is not still buy, need to be chosen.
and so I will let you know.

- what your explained about local network is interesting, as I have a server at home with his own domain name attached ... if I find time, I will replicate the distant site onto this server and make some tests.

thank you.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Cynos on December 08, 2015, 02:31:11 am
Hello, me again ...

So now the site is online and I have a domain name attached to it.

AndroidCPG plugin is installed on CPG config.
I tested AndroidCPG (androidcpg): v1.0 adress with the browser, and I can access to it:
http://domain_adress/galerie/plugins/androidcpg/login.php

I can access to my coppermine gallery with no problem on bot mobile browser or PC browser at; http://domain_adress/galerie/
All the files needed are ok (login.php, db_input.php, index.php,and delete.php).

I use the Theme switch (theme_switch): v1.0 plugin for mobile view.
I use Joomla_to_CPG_v1.2 plugin to synchronise joomla users to cpg users (Joomla 2x-3x to CPG Tunnel)

In the androidCPG app when I test the host (http://domain_adress/galerie/), it returns "host doesn't contain a coppermine gallery"

any advices please ?
thanks.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: Cynos on December 15, 2015, 10:46:01 am
Hello ISANexusDev,

Could you help me please ?

- is it possible that the error commes from the mobile device model ?
-> I use an old moto milestone 2 (2.2 froyo).

... thanks.
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: robast on February 07, 2016, 01:32:18 pm
Hey! I've just installed version 1.5 on a smartphone running Android 2.2.1 using the F-Droid repository.

Unfortunately the app crashes as soon as I run it.

I took a pic at the logs:

Code: [Select]
Could not find class 'java.net.CookieManager', referenced from method com.isanexusdev.androidcpg.AndroidCPG.onCreate (dalvikvm)
Is there anything I can do about it?

Cheers
Title: Re: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)
Post by: pacifico on September 02, 2016, 12:15:36 pm
Hello ISANexusDev

I've installed Coppermine many years ago and i’m very happy to find an Android app to upload my photos.
Great
Thank you for this plug in but i have an issue when i try to upload a photo

Bad response:
Parse error: syntax error, unexpected ‘[‘ in ….plugins/androidcpg/getAlbums.php in line 81

can you help me?

LG4 android 6.0
coppermine 1.5.24