Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3   Go Down

Author Topic: Android Coppermine Gallery Plugin and application (Upload Photos and Videos)  (Read 25892 times)

0 Members and 1 Guest are viewing this topic.

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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
« Last Edit: March 30, 2015, 11:44:25 am by ISANexusDev »
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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)

« Last Edit: October 03, 2014, 03:34:18 pm by ISANexusDev »
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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.
« Last Edit: February 01, 2015, 01:12:18 pm by ISANexusDev »
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4455
    • Windsurf.me

Excellent work.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369

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.
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

I'll update search pattern accordingly as soon as possible.

Thank you for that! :)
« Last Edit: February 01, 2015, 01:13:03 pm by ISANexusDev »
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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!
« Last Edit: October 03, 2014, 03:34:55 pm by ISANexusDev »
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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
Logged

MrMister247

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

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
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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
Logged

MrMister247

  • Coppermine newbie
  • Offline Offline
  • Posts: 2

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



Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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
« Last Edit: October 30, 2014, 01:35:44 pm by ISANexusDev »
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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.
Logged

Buster452

  • Coppermine newbie
  • Offline Offline
  • Posts: 1

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
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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!!
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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.
« Last Edit: January 03, 2015, 06:47:18 pm by ISANexusDev »
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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.
« Last Edit: February 01, 2015, 01:10:23 pm by ISANexusDev »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369

Vine support has been added to version 1.9 of the Remote Videos plugin.
Logged

ISANexusDev

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 31

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
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.045 seconds with 21 queries.