[MOD][XPOSED][5.0+] Xperia Camera Enhancements

Search This thread

tryptophane

Senior Member
Dec 31, 2012
120
192
Freiburg
Various mods for the stock camera app of Sony Xperia devices.

For now, this module consists of 8 mods:

  • Let the user choose which gallery app gets opened by the camera
  • Use date-time naming-scheme
  • Force photo mode on start
  • Force manual mode on start
  • Keep Geo-Tags setting ON
  • Enable location setting in system on start
  • Choose location mode setting
  • Restore location setting in system on exit
  • Mod geo-tag icon

This module is meant to grow, therefore the rather generic name. Ideas are welcome!

Note: Tested on my Z1 Compact. Chances are good that it works well with other Xperia devices, as far as they have the same camera app. I would appreciate your feedback :)

Note 2: This module is for Lollipop on Xperia Z* devices only!

MOD #1: Let the user choose which gallery app gets opened by the camera

In the latest Lollipop releases for the Xperia Z1 Compact and other Xperia Z devices, it is not possible anymore to choose which gallery app is used when you tap on the small picture thumbnail in the camera UI. It will always open the Sony Album app. But some people, like me, dislike the Sony Album app and prefer to use alternatives like Quickpic or others.

With this mod, the camera app lets you choose again which gallery app to use when you tap on the thumbnail. Even better, it lets you choose different apps for normal JPEG photos and some special formats, like timeshift pictures or sound photos. For those kind of pictures, it is still advisable to use the Album app which supports the features of those formats (like playing sound on a picture).

The mod has been implemented to work in the following camera modes (each of them has a separate implementation for launching the gallery and had to be hacked separatedly:

  • Superior Auto
  • Manual
  • Background Defocus
  • AR-Effect
  • Panorama
  • Creative Effect
  • Sound Photo
  • Timeshift burst

In other camera modes, the camera will possibly still always use the Album app.

If it does not work and you do not get asked which app to use, try to clear the defaults of the gallery app that gets opened by default!

MOD #2: Use date-time naming-scheme
This will save pictures and movies according to a date-time-with-milliseconds naming scheme:
  • for pictures: DSC_yyyyMMdd_HHmmss_SSS.JPG (example: DSC_20151230_133825_423.JPG)
  • for movies: DSC_yyyyMMdd_HHmmss_SSS.JPG (example: MOV_20151230_134232_922.mp4)
It will apply to the modes Superior Auto, Manual and Creative Effects


MOD #3: Force photo mode on start
In manual mode, the camera will always start in photo mode, even if the last mode used was video.
This mod is disabled by default. Go to settings page to enable it.

MOD #4: Force manual mode on start
The camera will always start in manual mode, when started from menu, shortcut or history. This mod does not apply when the camera is started from the camera button or lockscreen. In this case, the default "Superior Auto" mode will be started.

MOD #5: Keep Geo-Tags setting ON

This mod prevents a very annoying behavior of the stock camera app. Whenever you switch the camera to another mode than superior auto or manual, it will set the Geo-Tags setting to OFF, if GPS has been disallowed in the system-wide android settings. It will stay OFF in all camera modes until you set it to ON manually again, even if GPS has been allowed again in the system settings. The result of this behavior is that most of the pictures I made with my phone lack the location tag, although I never disabled the geo tags intentionally in the camera settings.

This mod prevents this behavior, the Geo-Tags setting will stay set to ON until you deliberately disable it. Geo-Tag setting can be switched on or off independantly from the location settings in android.

MOD #6: Enable location setting in system on start
This will enable location in the android system settings on camera start/resume, to make sure that geo tags can always get recorded (see also MOD #8 to restore the previous location settings on camera exit.

This mod applies only to the camera modes "superior auto" and "manual". When starting other modes, the location setting will stay untouched. In combination with MOD #8, this means: if GPS gets activated by starting one of this 2 modes and MOD #8 is activated, switching to another mode will deactivate GPS again. To record geo-tags in the other modes, you will still have to activate GPS manually in the system settings if MOD #8 is activated. This restriction is due to technical limitations due to the fact that each camera mode is an independent app, and these apps cannot communicate without any time lag. But this would be necessary to make this mod work reliably across different modes.

MOD #7: Choose location mode setting
This mod enables to choose the mode for acquiring location to be set in system. It can be either GPS, networks or both.
This Xposed module will never disable a mode that was activated prior to camera start! E.g., if before camera start location was enabled in system and set to GPS, and you choose to enable location based on networks in this module, it will set the location mode to GPS and networks on camera start.

MOD #8: Restore location setting in system on exit
When exiting the camera, this mod will restore the location settings in system to their state before camera start. It applies only to the modes "superior auto" and "manual".

MOD #9: Mod geo-tag icon
Show a blue geo-tag icon when location is fixed by networks and a white one for GPS-fix.


Credits:
Many thanks to:

  • rovo89 for the magnific Xposed framework.
  • venkat kamesh for a tutorial on how to hack the camera UI on a smali basis, which led me to make my first steps in reverse engineering of android APKs.

Download:
Xposed Module Repository

License
This module is released under the Apache License Version 2.0
Here you can say Thank You if you like my work :) _____
|
V​
 
Last edited:

tryptophane

Senior Member
Dec 31, 2012
120
192
Freiburg
Changelog

Version 0.1
- initial release

Version 0.2
- added settings page

Version 0.3
- corrected a bug introduced with last version which caused the Geo-Tags mod not working properly anymore

Version 0.4
- added new mod: force photo mode on start

Version 0.5
- added new mod "enable location in system on camera start"
- corrected a bug that caused that the camera always started in manual mode when the mod "force photo mode on start" was enabled

Version 0.6
- added new mod "choose location mode in system"
- made the restoring of location setting in system on camera exit optional
- added a mod to show a different geo-tag icon when the camera got a location fix by networks or GPS
- Debugging message are sent to logcat instead of Xposed log
- various enhancements and bugfixes

Version 0.6.1
- restrict mods "Enable/disable location setting in system on start/stop" to camera modes "superior auto" and "manual" (see module description for an explanation)

Version 0.6.2
- Location mode defaults to GPS. This makes the mod "Enable location on start" work as expected without entering settings when upgrading from version 0.5

Version 0.7
- added new mod: Force manual mode on start

Version 0.8
- new mod: use date-time naming-scheme
 
Last edited:

Kocane

Senior Member
Apr 29, 2012
1,673
308
Nice mod.

I wonder, could you make it so it doesn't remember the last selected mode? So if I make a shortcut for "manual" camera mode it will always launch in photo mode despite last time I used it, it was for video.
 
  • Like
Reactions: tryptophane

tryptophane

Senior Member
Dec 31, 2012
120
192
Freiburg
I'm on Z2 5.1.1 and it seems to work fine as of now.
Using it for the geotag:good:

Thanks for your feedback, it's really appreciated!

Nice mod.

I wonder, could you make it so it doesn't remember the last selected mode? So if I make a shortcut for "manual" camera mode it will always launch in photo mode despite last time I used it, it was for video.

Why not, it would be a mod that makes sense. I'll have a look when I find some time...
 
  • Like
Reactions: Kocane

fjdifede

Senior Member
Apr 11, 2009
52
4
Various mods for the stock camera app of Sony Xperia devices.

For now, this module consists of two mods:

  • Let the user choose which gallery app gets opened by the camera
  • Keep Geo-Tags setting ON
  • Force photo mode on start

This module is meant to grow, therefore the rather generic name. Ideas are welcome!

Note: Tested on my Z1 Compact. Chances are good that it works well with other Xperia devices, as far as they have the same camera app. I would appreciate your feedback :)

MOD #1: Let the user choose which gallery app gets opened by the camera

In the latest Lollipop releases for the Xperia Z1 Compact and other Xperia Z devices, it is not possible anymore to choose which gallery app is used when you tap on the small picture thumbnail in the camera UI. It will always open the Sony Album app. But some people, like me, dislike the Sony Album app and prefer to use alternatives like Quickpic or others.

With this mod, the camera app lets you choose again which gallery app to use when you tap on the thumbnail. Even better, it lets you choose different apps for normal JPEG photos and some special formats, like timeshift pictures or sound photos. For those kind of pictures, it is still advisable to use the Album app which supports the features of those formats (like playing sound on a picture).

The mod has been implemented to work in the following camera modes (each of them has a separate implementation for launching the gallery and had to be hacked separatedly:

  • Superior Auto
  • Manual
  • Background Defocus
  • AR-Effect
  • Panorama
  • Creative Effect
  • Sound Photo
  • Timeshift burst

In other camera modes, the camera will possibly still always use the Album app.

If it does not work and you do not get asked which app to use, try to clear the defaults of the gallery app that gets opened by default!

MOD #2: Keep Geo-Tags setting ON

This mod prevents a very annoying behavior of the stock camera app. Whenever you switch the camera to another mode than superior auto or manual, it will set the Geo-Tags setting to OFF, if GPS has been disallowed in the system-wide android settings. It will stay OFF in all camera modes until you set it to ON manually again, even if GPS has been allowed again in the system settings. The result of this behavior is that most of the pictures I made with my phone lack the location tag, although I never disabled the geo tags intentionally in the camera settings.

This mod prevents this behavior, the Geo-Tags setting will stay set to ON until you deliberately disable it. Geo-Tag setting can be switched on or off independantly from the location settings in android.

MOD #3:Force photo mode on start

In manual mode, the camera will always start in photo mode, even if the last mode used was video.

Credits:

Many thanks to:

  • rovo89 for the magnific Xposed framework.
  • venkat kamesh for a tutorial on how to hack the camera UI on a smali basis, which led me to make my first steps in reverse engineering of android APKs.

Download:

Xposed Module Repository
Could you please make this mod for oneplus one.?
I have been looking for something like this.!!!
 

Kocane

Senior Member
Apr 29, 2012
1,673
308
Here you go! Released version 0.4 ;)

Works a charm! Thanks.

Great together with a intent shortcut that goes straight to the camcorder, along with a shortcut straight to the manual photo mode :D

EDIT: I've no idea why, but it seems like steadyshot keeps enabling itself? Could you maybe make a function to make it remember setting, like with the geo-tag thing? or just make it turn steadyshot off always, lol
 
Last edited:

tryptophane

Senior Member
Dec 31, 2012
120
192
Freiburg
EDIT: I've no idea why, but it seems like steadyshot keeps enabling itself? Could you maybe make a function to make it remember setting, like with the geo-tag thing? or just make it turn steadyshot off always, lol

I can't reproduce it on my phone, the previous setting is remembered here... When does it happen exactly? I guess it's not related to my module, or don't you have this problem when you deactivate it? I would be suprised about it... What is your phone model?
 
Last edited:

Kocane

Senior Member
Apr 29, 2012
1,673
308
I can't reproduce it on my phone, the previous setting is remembered here... When does it happen exactly? I guess it's not related to my module, or don't you have this problem when you deactivate it? I would be suprised about it... What is your phone model?

I doubt it's the module, yes. I got the Z2 with a rom that carries the new Z5 camera interface. Maybe it's related to that.
 

B8shT1m3

Member
Jun 2, 2014
43
16
Frankfurt
@tryptophane how about an option to enable GPS when launching the camera app (dissable it when closing camera app).
It would be a cool feature together with the geo-tag mod.
That way you don't have to remember to toggle it to get geo-tags.

(I know this could also be achieved using Tasker but if you have free time...:p)
 
  • Like
Reactions: tryptophane

tryptophane

Senior Member
Dec 31, 2012
120
192
Freiburg
@tryptophane how about an option to enable GPS when launching the camera app (dissable it when closing camera app).
It would be a cool feature together with the geo-tag mod.
That way you don't have to remember to toggle it to get geo-tags.

(I know this could also be achieved using Tasker but if you have free time...:p)

In fact I don't have free time at all, I reasonably shouldn't have begun with these things ;) Didn't have much sleep the last nights...

But your idea is really cool, it would be a nice feature! So I'll try to see if it's possible... But don't know when....
 
  • Like
Reactions: B8shT1m3

tryptophane

Senior Member
Dec 31, 2012
120
192
Freiburg
@tryptophane how about an option to enable GPS when launching the camera app (dissable it when closing camera app).
It would be a cool feature together with the geo-tag mod.
That way you don't have to remember to toggle it to get geo-tags.

(I know this could also be achieved using Tasker but if you have free time...:p)

It's done! :cowboy: :p Have a look version 0.5
 
  • Like
Reactions: B8shT1m3

tryptophane

Senior Member
Dec 31, 2012
120
192
Freiburg
I used an algorithm that I found in a forum to enable GPS programatically. In the current implementation, it will only enable location based on GPS satellites, but not on networks. It would be nice to have the possibility to let the user choose which method gets activated for location (GPS, networks or both). With networks allowed you get a much faster fix and can also determine location inside of buildings.

I know how how I can do it and will implement this feature in a future version. But it's a little bit of work to make this in a clean and consistent way. Maybe I'll find some time next week, I will only release it when I have a really clean solution. I think I published too frequent updates since the first version of this module, don't want to annoy people...

Stay tuned!
 
  • Like
Reactions: Kocane

Kocane

Senior Member
Apr 29, 2012
1,673
308
Can you do so that when quick-launch is used (shortcut on lockscreen or holding camera button) it'll use manual mode rather than superior auto?
 

B8shT1m3

Member
Jun 2, 2014
43
16
Frankfurt
It's done! :cowboy: :p Have a look version 0.5

Works great:good:
The only problem I encounter is that I can't open my notification panel after I start the camera app (even after going back to the homescreen).
By locking the device I am able to open it again. But when opening the camera it happens again.
At first I thought it may be another app causing this but I am kinda confused because it never happend before :eek:
But hey, after I took a photo it worked normal again:silly:

I wanted to see if it happens again when rebooting and... yes. And now I can't reproduce my "solution" with taking a photo.
I always have to lock the device :(

Any idea what may cause this or would a logcat be helpfull?
edit: ok, it works again how it should without me doing anything... I'll report if I can somehow reproduce this behavior.

Another little thing: In Xposed your module doesn't show "update available" like others do
FkX33Ag3-PbMZ1o_BET7BQJVeqsT5Ns2Bl_xwIR6N9GZWQf-qHNRJlwXgkiTCwu2ZKzA69Oc5Yi8dkMU3o5alV-mYVfk=s853
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 15
    Various mods for the stock camera app of Sony Xperia devices.

    For now, this module consists of 8 mods:

    • Let the user choose which gallery app gets opened by the camera
    • Use date-time naming-scheme
    • Force photo mode on start
    • Force manual mode on start
    • Keep Geo-Tags setting ON
    • Enable location setting in system on start
    • Choose location mode setting
    • Restore location setting in system on exit
    • Mod geo-tag icon

    This module is meant to grow, therefore the rather generic name. Ideas are welcome!

    Note: Tested on my Z1 Compact. Chances are good that it works well with other Xperia devices, as far as they have the same camera app. I would appreciate your feedback :)

    Note 2: This module is for Lollipop on Xperia Z* devices only!

    MOD #1: Let the user choose which gallery app gets opened by the camera

    In the latest Lollipop releases for the Xperia Z1 Compact and other Xperia Z devices, it is not possible anymore to choose which gallery app is used when you tap on the small picture thumbnail in the camera UI. It will always open the Sony Album app. But some people, like me, dislike the Sony Album app and prefer to use alternatives like Quickpic or others.

    With this mod, the camera app lets you choose again which gallery app to use when you tap on the thumbnail. Even better, it lets you choose different apps for normal JPEG photos and some special formats, like timeshift pictures or sound photos. For those kind of pictures, it is still advisable to use the Album app which supports the features of those formats (like playing sound on a picture).

    The mod has been implemented to work in the following camera modes (each of them has a separate implementation for launching the gallery and had to be hacked separatedly:

    • Superior Auto
    • Manual
    • Background Defocus
    • AR-Effect
    • Panorama
    • Creative Effect
    • Sound Photo
    • Timeshift burst

    In other camera modes, the camera will possibly still always use the Album app.

    If it does not work and you do not get asked which app to use, try to clear the defaults of the gallery app that gets opened by default!

    MOD #2: Use date-time naming-scheme
    This will save pictures and movies according to a date-time-with-milliseconds naming scheme:
    • for pictures: DSC_yyyyMMdd_HHmmss_SSS.JPG (example: DSC_20151230_133825_423.JPG)
    • for movies: DSC_yyyyMMdd_HHmmss_SSS.JPG (example: MOV_20151230_134232_922.mp4)
    It will apply to the modes Superior Auto, Manual and Creative Effects


    MOD #3: Force photo mode on start
    In manual mode, the camera will always start in photo mode, even if the last mode used was video.
    This mod is disabled by default. Go to settings page to enable it.

    MOD #4: Force manual mode on start
    The camera will always start in manual mode, when started from menu, shortcut or history. This mod does not apply when the camera is started from the camera button or lockscreen. In this case, the default "Superior Auto" mode will be started.

    MOD #5: Keep Geo-Tags setting ON

    This mod prevents a very annoying behavior of the stock camera app. Whenever you switch the camera to another mode than superior auto or manual, it will set the Geo-Tags setting to OFF, if GPS has been disallowed in the system-wide android settings. It will stay OFF in all camera modes until you set it to ON manually again, even if GPS has been allowed again in the system settings. The result of this behavior is that most of the pictures I made with my phone lack the location tag, although I never disabled the geo tags intentionally in the camera settings.

    This mod prevents this behavior, the Geo-Tags setting will stay set to ON until you deliberately disable it. Geo-Tag setting can be switched on or off independantly from the location settings in android.

    MOD #6: Enable location setting in system on start
    This will enable location in the android system settings on camera start/resume, to make sure that geo tags can always get recorded (see also MOD #8 to restore the previous location settings on camera exit.

    This mod applies only to the camera modes "superior auto" and "manual". When starting other modes, the location setting will stay untouched. In combination with MOD #8, this means: if GPS gets activated by starting one of this 2 modes and MOD #8 is activated, switching to another mode will deactivate GPS again. To record geo-tags in the other modes, you will still have to activate GPS manually in the system settings if MOD #8 is activated. This restriction is due to technical limitations due to the fact that each camera mode is an independent app, and these apps cannot communicate without any time lag. But this would be necessary to make this mod work reliably across different modes.

    MOD #7: Choose location mode setting
    This mod enables to choose the mode for acquiring location to be set in system. It can be either GPS, networks or both.
    This Xposed module will never disable a mode that was activated prior to camera start! E.g., if before camera start location was enabled in system and set to GPS, and you choose to enable location based on networks in this module, it will set the location mode to GPS and networks on camera start.

    MOD #8: Restore location setting in system on exit
    When exiting the camera, this mod will restore the location settings in system to their state before camera start. It applies only to the modes "superior auto" and "manual".

    MOD #9: Mod geo-tag icon
    Show a blue geo-tag icon when location is fixed by networks and a white one for GPS-fix.


    Credits:
    Many thanks to:

    • rovo89 for the magnific Xposed framework.
    • venkat kamesh for a tutorial on how to hack the camera UI on a smali basis, which led me to make my first steps in reverse engineering of android APKs.

    Download:
    Xposed Module Repository

    License
    This module is released under the Apache License Version 2.0
    Here you can say Thank You if you like my work :) _____
    |
    V​
    3
    I really liked the bug starting the camera in Manual mode and have wished for this functionality ever since I got my Z1C - and have seen this requested elsewhere by people who don't have the developer skills to make it happen.
    Is it possible to make this a permanent option in your xposed module to force camera starting in Manual mode please?

    The bug is back and is now a feature :) Of course it's configurable in settings...

    Can you do so that when quick-launch is used (shortcut on lockscreen or holding camera button) it'll use manual mode rather than superior auto?

    I tried very hard to do this, spent two evenings on it. But I don't get it to work. The camera always crashes when I try to make it start in manual mode with quick-launch. The problem is that with quick-launch, a completely independent activity is started, not the same as for normal start of the camera. I think it is designed like this mainly for security reasons, because this activity has to prevent that someone can bypass the lock screen security options by starting the camera. This activity is not meant to be started in manual mode, even if I managed it, it would probably break the security of the lock screen... So I give it up... Anyway, I think that superior mode makes sense when started by quick-launch, because it's often used for quick snapshots...

    I understand why you wouldn't do this but couldn't you perhaps give this "mod" a temporary spin in order to reproduce the steadyshot issue and maybe fix it, which it doesn't seem like whoever ported it will do?

    http://forum.xda-developers.com/crossdevice-dev/sony-themes-apps/mod-cyberian-camera-t3267271

    I'd appreciate it alot, i rather like that new Z5 camera ui but I cant deal with steadyshot video.

    I don't want to install this camera, but if I find the time I'll will have a look at the apk and see if I can easily make a little mod for you... No promise at all ;)
    2
    Changelog

    Version 0.1
    - initial release

    Version 0.2
    - added settings page

    Version 0.3
    - corrected a bug introduced with last version which caused the Geo-Tags mod not working properly anymore

    Version 0.4
    - added new mod: force photo mode on start

    Version 0.5
    - added new mod "enable location in system on camera start"
    - corrected a bug that caused that the camera always started in manual mode when the mod "force photo mode on start" was enabled

    Version 0.6
    - added new mod "choose location mode in system"
    - made the restoring of location setting in system on camera exit optional
    - added a mod to show a different geo-tag icon when the camera got a location fix by networks or GPS
    - Debugging message are sent to logcat instead of Xposed log
    - various enhancements and bugfixes

    Version 0.6.1
    - restrict mods "Enable/disable location setting in system on start/stop" to camera modes "superior auto" and "manual" (see module description for an explanation)

    Version 0.6.2
    - Location mode defaults to GPS. This makes the mod "Enable location on start" work as expected without entering settings when upgrading from version 0.5

    Version 0.7
    - added new mod: Force manual mode on start

    Version 0.8
    - new mod: use date-time naming-scheme
    2
    Man, am I glad I found this module! Thank you, @tryptophane!

    I was wondering if you could/would add one more feature? I desperately want to be able to force the camera to use a file-naming scheme that uses the date (like Google Camera's simple "IMG_YYYYMMDD_SECOND.jpg") instead of the incremental DSC numbering thing that it does.

    Yes! Now that you say it, this primitive naming scheme was one of the first things that annoyed me with the sony cam. It's easy to mod, will be done soon :)
    1
    this module is amazing but we need the MM version