Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,736,126 Members 42,731 Now Online
XDA Developers Android and Mobile Development Forum

[APP][4.0+][2014/07/6 2.83]Photo Frame&Grid Widget

Tip us?
 
itandy
Old
(Last edited by itandy; 8th July 2014 at 10:38 AM.)
#1  
itandy's Avatar
Senior Member - OP
Thanks Meter 1025
Posts: 1,642
Join Date: Apr 2010
Location: Hong Kong
Default [APP][4.0+][2014/07/6 2.83]Photo Frame&Grid Widget

** Formerly known as Photo Grid/Frame Widget. Due to complaint of infringement for the trademark "PHOTOGRID", I had to rename it to Photo Frame&Grid Widget. Hopefully, it doesn't infringe any other trademarks. **

Besides, please uninstall any versions older than 2.83 before installing the new version (2.83) because a new package name is assigned and your Android device will treat it as a separate app.


This is my first Android app. Basically I want to replicate the grid-style photo widget from HTC so it can be used by other phones or in AOSP ROM.

I developed the widget and tested it on my HTC Incredible S. If you're interested, please install it in other phones of different brand and screen size. If you encounter any issues, please feel free to report here or give me a PM. Or if you have any request for new features, I'll also consider in future versions.

Features:
  • Resizable & scrollable grid view / photo frame mode / stack mode
  • Support lockscreen widget in JellyBean (Android 4.2 and up)
  • Configurable slideshow interval for frame mode
  • Supports JPG, GIF, PNG, BMP, MPO, JPS for image files
  • Support 3GP, MP4, TS, WEBM, MKV for video files (http://developer.android.com/guide/a...a-formats.html)
  • Configurable file types & filename filter
  • Selectable photo album from internal/external storage
  • Individual file selection
  • Can choose a specific installed app to launch for full screen image view or video playback
  • Image file details in preview mode (Filename, image dimension, file size and video duration)
  • Tween animation in frame mode (fade / slide) ** even better slide effect if navigation arrows are hidden **
  • Support different settings in multiple widget instances
  • Two different image styles - Scale whole image / Crop to fit
  • User define image border width and color
  • Thumbnail size options
  • Display order options
  • App to change widget settings on the fly
  • Tasker integration
  • Requires ICS (Android 4.0) or above

Permissions
  • WRITE_EXTERNAL_STORAGE - store thumbnails for grid view to improve performance
  • READ_EXTERNAL_STORAGE - read thumbnails for grid view
  • RECEIVE_BOOT_COMPLETED - restart services for auto refresh and register alarm manager for slideshow
  • WAKE_LOCK - keep phone awake during background thumbnail generation
  • VIBRATE - vibrate when thumbnail is selected

Outstanding issues:
  • Due to a bug in Android 4.2.1 SDK, if you remove the widget in lockscreen, you need to remove its settings in the app as well manually. Fixed in 4.2.2 SDK.

https://play.google.com/store/apps/d...ramegridwidget

Attached Thumbnails
Click image for larger version

Name:	Screenshot_gridview_x1_1.31.jpg
Views:	7495
Size:	54.4 KB
ID:	1666981   Click image for larger version

Name:	Screenshot_preview.jpg
Views:	6910
Size:	43.7 KB
ID:	1666982   Click image for larger version

Name:	Screenshot_framemode.jpg
Views:	6124
Size:	36.0 KB
ID:	1666984   Click image for larger version

Name:	Screenshot_widgetlist.jpg
Views:	5330
Size:	17.4 KB
ID:	1702921   Click image for larger version

Name:	Screenshot_config2_1.70.jpg
Views:	3624
Size:	31.1 KB
ID:	1786833  

Click image for larger version

Name:	Screenshot_config3_1.70.jpg
Views:	3429
Size:	20.0 KB
ID:	1786834   Click image for larger version

Name:	Screenshot_config4_1.70.jpg
Views:	3355
Size:	31.8 KB
ID:	1786835   Click image for larger version

Name:	Screenshot_config5_1.70.jpg
Views:	3284
Size:	24.6 KB
ID:	1786837   Click image for larger version

Name:	Screenshot_config6_1.70.jpg
Views:	3249
Size:	24.7 KB
ID:	1786838   Click image for larger version

Name:	Screenshot_config7_1.70.jpg
Views:	3226
Size:	17.6 KB
ID:	1786839  

Click image for larger version

Name:	Screenshot_config1_1.80.jpg
Views:	2487
Size:	29.4 KB
ID:	1858049   Click image for larger version

Name:	Screenshot_stackmode.jpg
Views:	2353
Size:	38.2 KB
ID:	1942007   Click image for larger version

Name:	Screenshot_dirpicker_2.20.jpg
Views:	923
Size:	45.8 KB
ID:	2180299  
My phone
Sony Xperia ZR | Rooted Stock ROM 4.4.2 | Stock kernel | Dual CWM/TWRP recovery | Samsung 32GB UHS-I

HTC Incredible S | Blackrose 2.02 HBOOT | 4EXT Touch | CM11 VivoKat | TESCO Kernel 3.0.101 | 3831.18.00.28 radio | SanDisk Ultra UHS-I 32GB

My work
Photo Frame&Grid Widget | Android Phone Vibrator - Xposed | Ringer & Notification Volume Unlink in ICS/JB - Xposed | Notification Direct Launcher - Xposed | Xperia Stamina LED - Xposed | Xperia/AOSP NavBar Buttons - Xposed
The Following 60 Users Say Thank You to itandy For This Useful Post: [ Click to Expand ]
 
itandy
Old
(Last edited by itandy; 6th July 2014 at 07:14 AM.)
#2  
itandy's Avatar
Senior Member - OP
Thanks Meter 1025
Posts: 1,642
Join Date: Apr 2010
Location: Hong Kong
Change log
Code:
2.83
- Change package name to com.gzplanet.photoframegridwidget. Please uninstall any previous version. Otherwise, you'll end up having 2 separate apps on your device.

2.82
- Fix issue that external SD/OTG cannot be found in Samsung S5

2.81
- Fix issue that external storage not available in some Huawei (4.2.2) devices

2.80
- Improve Auto Refresh on File Change function to make it much more reliable

2.72
- Fix issue that external SD/OTG cannot be found in some Android 4.4 devices

2.71
- Always show Apply buttons in action bar which might be hidden in menu for some devices

2.70
- New option to adjust thumbnail rotation in stack mode

2.60
- Photo in preview/frame mode will be automatically re-rendered to correct size on phone orientation change.

2.50
- New option to auto hide frame/preview mode UI components (filename, dimension, file size...) in 5s. Auto hide feature currently doesn't work with animation.

2.40
- New option to show hidden folder (action bar menu) in Album Folders.
- Allow manual input of border color by hex code or color name in frame/stack mode.
- New option to skip to next photo in frame mode when screen is turned on.

2.32
- Add support for exFAT SD card in Android 4.3

2.31
- Improve animation performance in album folder selection

2.30
- Fix the issue that external storage is not available in Android 2.3
- Bug fixes

2.22
- Fix the issue that widget cannot show images after a reboot for Samsung Galaxy S4

2.21
- Improve mount/unmount event for devices with multiple external storages

2.20
- Add support for individual file seletion

2.14
- Add support for Android 2.3 FEATURE_APP_WIDGETS permission and restricted profile environment

2.13
- New grid thumbnail size for Sony Xperia
- Bug fix

2.12
- New Slide animation (Vertical)

2.11
- Bug fix that the widget is not refreshed when a new video is added

2.10
- Tasker integration
  * Change settings (album folder / display order)
  * Skip to next/previous photo (frame mode only)

** Changing Album Folder action does not trigger the cache files generation. Thumbnails will be generated on-the-fly when they're displayed and once all thumbnails are generated for the first time, the performance will be the same. However, if you have previously generated thumbnail files, they will be used so there'll be no performance impact. **

2.00
- Now supports video files
- Supports core Android video formats (3GP,MP4,TS,WEBM,MKV). http://developer.android.com/guide/appendix/media-formats.html
- New option to select video player app

** Please use the new Reset file types function (under Album photo files section) first. Otherwise, video files will not be shown **

1.91
- Improve widget list and album picker performance
- Improve photo preview performance in album picker
- Stack mode now supports auto refresh
- Reduce auto refresh performance impact on JB
- Improve preview/frame image scaling (now supports stock launcher and Nova 2.1 and Apex 2.0.1)
- Other optimizations and bug fixes

1.90
- New stack mode!
  - select stack mode in display mode and find more customization options in thumbnail section
  - reduce max dimension if widget/launcher crash especially in tablet
- New options to select image border width & color
- New tween animation in frame mode (fade / slide)
  - even better slide effect if navigation arrows are hidden
- Bug fixes

1.81
- New set of thumbnail sizes for Samsung Galaxy Note2
- Fix FC when selected album folder has no photo files

1.80
- New background thumbnail generation - if the selected album folders contain more than 30 photo files, system will generate the thumbnails in the background so you can continue using the phone. Check the progress on the status bar.
- You can now also use Auto Refresh for photo frame mode
- Several improvements on photo album selection UI
- You can now choose to retain existing album folder selections before changing album folders
- Further fine-tuned preview/frame photo dimension calculation on JB

1.75
- Bug fix for preview/frame photo crashes on JB for some devices

1.74
- Slideshow interval can now be set to 0 to disable slideshow

1.73
- Better support for screen off triggered by 3rd party apps

1.72
- Properly handle slideshow interval after screen on
- Restart services when package is upgraded

1.71
- Fix navigation arrows not responding in frame mode
- Generate thumbnails only for grid mode
- Fine tune preview/frame image dimension calculation for ICS

1.70
- Dynamically scale preview/frame image when widget is resized (JB only)
- New preview/frame image style option (crop/scale)
- New preview/frame image maximum dimension option (reduce it if the widget or your launcher crash, ICS only since JB has better memory management, at least it doesn't crash on me)
- New option to disable EXIF orientation detection for preview/frame image
- New option to force filtering for thumbnail
- New option to set thumbnail JPEG quality
- Reduce battery drain in frame mode (slideshow) when screen is off (service is required and thus needs more memory)
- Re-organize config menu
- Bug fixes

1.61
- Fix FC when no external viewer app is found

1.60
- JB 4.2 lockscreen support
- New set of layouts for lockscreen
- New option to show next photo instead of launching viewer app when tapping preview/frame photo
* Due to a bug in Android 4.2 SDK, if you remove the widget in  lockscreen. You need to remove its settings in the app manually.

1.50
- Multiple folder support
- Implemented fragment animation
- Option to toggle preview items individually
- Bug fixes

1.41
- Fix FC for some users upgrading from old versions 

1.40
- New photo frame mode (configurable slideshow interval)
- Configurable file types to include
- Configurable filename filter with wildcard support
- Random order (useful for photo frame slideshow)
- New option to hide information in preview mode (File info and prev/next buttons will be hidden)
- Bug fixes

1.32
- Fix problem with Android 4.1 (Jelly Bean)

1.31
- New option to set background opacity of appwidget
- Spacing between grid items is now aligned evenly for a more tidy look

1.30
- New config application to change widget settings on the fly. (Find the new app shortcut in app drawer)
- UI revamp to make use of ICS features. (Click the icon on upper right corner to confirm instead of pressing the Back button when adding new widgets)
- Reduced package size

1.20
- Photo preview in album selection screen
- New option to refresh widget automatically when there is a change of image files in the selected folder (service is required)
- Widget now behaves properly when external storage is unmounted
- Bug fixes

1.12
- Add support for MPO and JPS image files
- Images with EXIF orientation tag will be rotated properly

1.10 (Please re-add your widgets)
- New option to choose thumbnail sizes (some optimized for HTC launcher)
- Changed thumbnail dimension to square instead of portrait
- New option to choose display order
- You can now use different thumbnail style, size and other settings for different widget instances independently
- Bug fixes and performance optimization

1.01
- New option to skip preview image and launch external viewer directly
- Unified external storage and album folder selections into a single option
- Adjust preview image size for large screen devices

1.0
- Published to Play store

Beta 4 (build 09040937)
- Correct typo "Chop to fix" to "Crop to fit"
- Fixed issues that thumbnail files are not closed properly during creation

Beta 3 (build 09021624)
- Fixed thumbnail for images of some aspect ratio cannot be generated
- Show file position in preview mode
- New prev/next buttons in preview mode
- New app icon
- Automatically apply filter to preview image if it's upscaled to reduce pixelation

Beta 2 (build 08301200)
- Support devices with non standard external storage
- Support devices with multiple external storage
- Support devices with un-mountable internal storage (e.g. Asus Transformer internal SD)
- Fixed thumbnail generation issue for square size images
- Proper exception handling during thumbnail generation so issue of individual file will not crash the whole widget
My phone
Sony Xperia ZR | Rooted Stock ROM 4.4.2 | Stock kernel | Dual CWM/TWRP recovery | Samsung 32GB UHS-I

HTC Incredible S | Blackrose 2.02 HBOOT | 4EXT Touch | CM11 VivoKat | TESCO Kernel 3.0.101 | 3831.18.00.28 radio | SanDisk Ultra UHS-I 32GB

My work
Photo Frame&Grid Widget | Android Phone Vibrator - Xposed | Ringer & Notification Volume Unlink in ICS/JB - Xposed | Notification Direct Launcher - Xposed | Xperia Stamina LED - Xposed | Xperia/AOSP NavBar Buttons - Xposed
The Following 2 Users Say Thank You to itandy For This Useful Post: [ Click to Expand ]
 
Nezys
Old
(Last edited by Nezys; 28th August 2012 at 09:04 AM.)
#3  
Nezys's Avatar
Senior Member
Thanks Meter 179
Posts: 417
Join Date: Sep 2011
Location: Catania

 
DONATE TO ME
Very nice widget,it works great on my Galaxy S with JB 4.1.1
The only problem(which not depends on your widget) is that external storage on CM10 where I have most of my pictures is located in a folder that I can't select with this widget
If you(in a next release) can allow users to do a manual selection of the folder my "problem" will be solved xD
However,it's really a beautiful photo widget man,thanks

Inviato dal mio GT-I9000 con Tapatalk 2
Device: Samsung Galaxy S i9000 8GB
Device: LG G2 D802 32 GB


If I helped you, please hit THANKS



* * *


J U V E N T U S
 
TheMorpheus
Old
#4  
TheMorpheus's Avatar
Senior Member
Thanks Meter 405
Posts: 988
Join Date: Jan 2009
Location: Marche_Marotta (PU)

 
DONATE TO ME
Works good Galaxy Nexus, Cm10, Nova Launcher!
OmniRom N8000: XDA link - AFH link
OmniRom D802: AFH link
CarbonRom D802 AFH link
G+: +FrancescoTonelli
Twitter: @TheMorpheus81
 
itandy
Old
#5  
itandy's Avatar
Senior Member - OP
Thanks Meter 1025
Posts: 1,642
Join Date: Apr 2010
Location: Hong Kong
Quote:
Originally Posted by Nezys View Post
Very nice widget,it works great on my Galaxy S with JB 4.1.1
The only problem(which not depends on your widget) is that external storage on CM10 where I have most of my pictures is located in a folder that I can't select with this widget
If you(in a next release) can allow users to do a manual selection of the folder my "problem" will be solved xD
However,it's really a beautiful photo widget man,thanks

Inviato dal mio GT-I9000 con Tapatalk 2
Do you mean Galaxy S has multiple external storage? Can you give me the complete paths of these storage. (e.g. /mnt/sdcard/) I'll see what I can do.
My phone
Sony Xperia ZR | Rooted Stock ROM 4.4.2 | Stock kernel | Dual CWM/TWRP recovery | Samsung 32GB UHS-I

HTC Incredible S | Blackrose 2.02 HBOOT | 4EXT Touch | CM11 VivoKat | TESCO Kernel 3.0.101 | 3831.18.00.28 radio | SanDisk Ultra UHS-I 32GB

My work
Photo Frame&Grid Widget | Android Phone Vibrator - Xposed | Ringer & Notification Volume Unlink in ICS/JB - Xposed | Notification Direct Launcher - Xposed | Xperia Stamina LED - Xposed | Xperia/AOSP NavBar Buttons - Xposed
The Following User Says Thank You to itandy For This Useful Post: [ Click to Expand ]
 
MiDiANx360
Old
#6  
Junior Member
Thanks Meter 4
Posts: 27
Join Date: Feb 2009
I tried your widget, but unfortunately i can't get it to work on my phone (Galaxy Nexus). I can install it, and get to the settings screen.
After pressing back the Thumbnail-Generation starts and during that, the app just closes. With some folders it closes right away, with others it closes later on. But it always stops at the same time if i select the same folder. I.e. when i choose folder A it will always close at 15/30 Images. If i select Folder B it always closes at 1/34. So i guess it might be an issue with certain pictures.

Update:
I finally found one folder with 6 pictures that does work and would like to suggest two additional settings:I would like to be able to change the spacing between the pictures (in fact i would like to be able to remove the spacing). Which would give the widget the same look as the one from HTC and i would like to be able to access the settings of the widget so i don't have to remove and add it back to change the settings.

Thank you for your work!
 
itandy
Old
#7  
itandy's Avatar
Senior Member - OP
Thanks Meter 1025
Posts: 1,642
Join Date: Apr 2010
Location: Hong Kong
Quote:
Originally Posted by MiDiANx360 View Post
I tried your widget, but unfortunately i can't get it to work on my phone (Galaxy Nexus). I can install it, and get to the settings screen.
After pressing back the Thumbnail-Generation starts and during that, the app just closes. With some folders it closes right away, with others it closes later on. But it always stops at the same time if i select the same folder. I.e. when i choose folder A it will always close at 15/30 Images. If i select Folder B it always closes at 1/34. So i guess it might be an issue with certain pictures.

Update:
I finally found one folder with 6 pictures that does work and would like to suggest two additional settings:I would like to be able to change the spacing between the pictures (in fact i would like to be able to remove the spacing). Which would give the widget the same look as the one from HTC and i would like to be able to access the settings of the widget so i don't have to remove and add it back to change the settings.

Thank you for your work!
Thanks for testing my widget!

Can you give me a logcat so I can locate the source of the issue? I believe the widget is unable to generate a thumbnail for some of your images. It might be a program bug or a corrupted image. You can create a logcat using aLogcat app or adb command as below (let me know if you need more instructions):

Code:
adb logcat > logcat.txt
I'll add the spacing issue to my todo list. But currently I cannot think of a solution since unlike HTC widget, my widget is resizable and target for different devices so these spacing is added automatically to fill up the entire area of the widget as well as to handle devices of different screen density and launchers (they actually display widgets differently!).

Also, I'll see if I can add the setting button in this version.
My phone
Sony Xperia ZR | Rooted Stock ROM 4.4.2 | Stock kernel | Dual CWM/TWRP recovery | Samsung 32GB UHS-I

HTC Incredible S | Blackrose 2.02 HBOOT | 4EXT Touch | CM11 VivoKat | TESCO Kernel 3.0.101 | 3831.18.00.28 radio | SanDisk Ultra UHS-I 32GB

My work
Photo Frame&Grid Widget | Android Phone Vibrator - Xposed | Ringer & Notification Volume Unlink in ICS/JB - Xposed | Notification Direct Launcher - Xposed | Xperia Stamina LED - Xposed | Xperia/AOSP NavBar Buttons - Xposed
 
Nezys
Old
#8  
Nezys's Avatar
Senior Member
Thanks Meter 179
Posts: 417
Join Date: Sep 2011
Location: Catania

 
DONATE TO ME
Quote:
Originally Posted by itandy View Post
Do you mean Galaxy S has multiple external storage? Can you give me the complete paths of these storage. (e.g. /mnt/sdcard/) I'll see what I can do.
Galaxy S with stock rom has these paths:

mnt/sdcard (internal storage)
mnt/sdcard/external sd (ext-sd card)

With AOSP roms(CM7-CM9-CM10-AOKP-MIUI) these paths change in:

mnt/sdcard
mnt/emmc (ext-sd card)

As you can see,I can't access external sd card from mnt/sdcard with a NON-samsung rom..this is why I can't use pictures on ext- sd

I hope is clear!



Inviato dal mio GT-I9000 con Tapatalk 2
Device: Samsung Galaxy S i9000 8GB
Device: LG G2 D802 32 GB


If I helped you, please hit THANKS



* * *


J U V E N T U S
 
MiDiANx360
Old
#9  
Junior Member
Thanks Meter 4
Posts: 27
Join Date: Feb 2009
Quote:
Originally Posted by itandy View Post
Thanks for testing my widget!

Can you give me a logcat so I can locate the source of the issue? I believe the widget is unable to generate a thumbnail for some of your images. It might be a program bug or a corrupted image. You can create a logcat using aLogcat app or adb command as below (let me know if you need more instructions):

Code:
adb logcat > logcat.txt
I'll add the spacing issue to my todo list. But currently I cannot think of a solution since unlike HTC widget, my widget is resizable and target for different devices so these spacing is added automatically to fill up the entire area of the widget as well as to handle devices of different screen density and launchers (they actually display widgets differently!).

Also, I'll see if I can add the setting button in this version.
I never used alogcat but i gave it a try, either i'm doing it wrong or there is nothing happening that gets logged. I started aLogCat, cleared everything that was in it, and pressed the Play-button. I then forced the widget to "crash" and went back into aLogCat, and there is nothing new in there. Do I have to change any settings?
 
itandy
Old
#10  
itandy's Avatar
Senior Member - OP
Thanks Meter 1025
Posts: 1,642
Join Date: Apr 2010
Location: Hong Kong
Quote:
Originally Posted by MiDiANx360 View Post
I never used alogcat but i gave it a try, either i'm doing it wrong or there is nothing happening that gets logged. I started aLogCat, cleared everything that was in it, and pressed the Play-button. I then forced the widget to "crash" and went back into aLogCat, and there is nothing new in there. Do I have to change any settings?
Can you check in the preference, the value for Level is Verbose? If running correctly, you should see new entries coming in constantly even if you do nothing.

Sent from my HTC Incredible S using Tapatalk 2
My phone
Sony Xperia ZR | Rooted Stock ROM 4.4.2 | Stock kernel | Dual CWM/TWRP recovery | Samsung 32GB UHS-I

HTC Incredible S | Blackrose 2.02 HBOOT | 4EXT Touch | CM11 VivoKat | TESCO Kernel 3.0.101 | 3831.18.00.28 radio | SanDisk Ultra UHS-I 32GB

My work
Photo Frame&Grid Widget | Android Phone Vibrator - Xposed | Ringer & Notification Volume Unlink in ICS/JB - Xposed | Notification Direct Launcher - Xposed | Xperia Stamina LED - Xposed | Xperia/AOSP NavBar Buttons - Xposed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes