[FP4] Gallery Proxy for FPCamera (stock camera app)

Hi folks!

I’m using FPCamera, the stock camera app, on my FP4. Since I don’t want to use Google Photos, I cannot open the image preview in the stock camera app. Instead of calling the system action to open a preview, it directly calls Google Photos for image preview.
I wrote a simple proxy app pretending to be Google Photos. It simple re-directs the preview request to the system gallery app.
Feel free to give it a try: GitHub - flipreverse/FPCameraPhotoProxy

Any comments, and suggestions are welcome!



Thanks for this :blush:

Might be a dumb question: does it work differently to this

i.e. deactivating Google apps is enough?

And being not familiar with github and I only checked the link on the FP4 a maybe 2nd dumb question: What would I have to do to download/install?


Sry. I’ll have to upload an apk… :roll_eyes:

I didn’t know about that app. I’ll give it a try. Hence, I don’t know what’s the difference.

Dont worry will be patient :wink:

I’m mainly referring to this discussion

So using your apk, do I need to remove the Google Foto apk first completly, i.e. needing a rooted phone or use shelter?

1 Like

I haven’t tried that, because my rom does not offer Google Photos as a built-in app. Since I use the same package name, I assume it is necessary.

@yvmuell I’ve tried GCam Photo Preview. As far as I understand, that app offers a gallery for image preview. Mine simply relays the intent sent by FPCamera to the system. Hence, the image preview is performed by what ever your default gallery app is.
One benefit of their approach is that one can go through previous images. In my approach it depends on the gallery app you choose.


I’m not familiar with building apk but I’m really interested in your app so I’m trying to build it :smiley:

There are no instructions so here are my steps:

  1. On my Windows laptop computer:
  • Open Cmd
  • cd to the directory then gradlew.bat
  • ERROR: JAVA_HOME is not set and no ‘java’ command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

As this is my work computer, I have no admin rights and I don’t want to go further…

  1. On my Linux raspberrypi4
  • git clone https://github.com/flipreverse/FPCameraPhotoProxy
  • ./gradlew
    > BUILD SUCCESSFUL in 10m 24s
    > 1 actionable task: 1 executed
    But… I don’t see any apk file in the directory… :sweat_smile: where could it be?

EDIT: the correct command is ./gradlew build

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ‘:FPCameraPhotoProxy:compileDebugJavaWithJavac’.

SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project’s local properties file at ‘/home/oli/Desktop/FPCameraPhotoProxy/local.properties’.

  • sudo apt install android-sdk
  • create a file local.properties with the sdk path: sdk.dir = /usr/lib/android-sdk

Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-32 Android SDK Platform 32
build-tools;30.0.3 Android SDK Build-Tools 30.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
All licenses can be accepted using the sdkmanager command line tool:
sdkmanager.bat --licenses

  • the way to accept the licenses is through sdkmanager, however this one is no longer included in ‘android-sdk’. So the next step is to download it [1]: wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip
  • it should be unzipped in a directory named cmdline-tools: unzip commandlinetools-linux-6609375_latest.zip -d cmdline-tools
  • then moved inside the ‘android-sdk’ directory: sudo mv cmdline-tools/ /usr/lib/android-sdk/
  • I needed to change permissions of that folder sudo chmod -R 777 /usr/lib/android-sdk/ otherwise sdkmanager will not write the licences.
  • cd /usr/lib/android-sdk/cmdline-tools/tools/bin/
  • y | ./sdkmanager --licenses. y is basically the same as yes, it just outputs y to accept until there is no more input requested and the process stops [2]

AAPT2 aapt2-7.4.2-8841542-linux Daemon #0: Unexpected error output: /home/oli/.gradle/caches/transforms-3/29fe0f65c3b33e4d87edc0ad412f408a/transformed/aapt2-7.4.2-8841542-linux/aapt2: 1: ELF: not found
AAPT2 aapt2-7.4.2-8841542-linux Daemon #0: Unexpected error output: /home/oli/.gradle/caches/transforms-3/29fe0f65c3b33e4d87edc0ad412f408a/transformed/aapt2-7.4.2-8841542-linux/aapt2: 2: P�: not found
AAPT2 aapt2-7.4.2-8841542-linux Daemon #0: Unexpected error output: /home/oli/.gradle/caches/transforms-3/29fe0f65c3b33e4d87edc0ad412f408a/transformed/aapt2-7.4.2-8841542-linux/aapt2: 3: Syntax error: “(” unexpected

Task :FPCameraPhotoProxy:processDebugResources FAILED

FAILURE: Build failed with an exception.

From [3]:

You’re trying to run Android Studio on Linux 32 bit, but that system is not supported. Android Studio only works on Windows (both 32 and 64 bit), MacOS (64 bit) and Linux (64 bit).

My RPi4 is ARM64 architecture, it seems not compatible for this process.

  1. On my Linux 64bit laptop:
  • According to [2], since Ubuntu 22 (Jammy) simply install via apt install sdkmanager
  • build failed with the following message

Task :FPCameraPhotoProxy:lintDebug FAILED
Lint found 1 errors, 13 warnings. First failure:

/home/oli/FPCameraPhotoProxy/FPCameraPhotoProxy/src/main/AndroidManifest.xml:28: Error: android:scheme cannot be empty [AppLinkUrlError]


Explanation for issues of type “AppLinkUrlError”:
Ensure the URL is supported by your app, to get installs and traffic to
your app from Google Search.

  • This link [4] hint me to have a look in the FPCameraPhotoProxy/src/main/AndroidManifest.xml file, and I removed the first line of this block, leaving intact the others 4 scheme:
            <data android:scheme="" />
            <data android:scheme="http" />
            <data android:scheme="https" />
            <data android:scheme="content" />
            <data android:scheme="file" /> 
  • Now the build is successful :partying_face:
    Found two apk files:

I’m trying the first one :slight_smile:

1 Like

I guess you have to remove it completely…
My google photo is disabled, and I cannot update it with the freshly build apk… Signature error?

1 Like

Before connecting to adb in order to uninstall the google photo package (adb shell pm uninstall etc.), I read again from the beginning the post about “GCam Photos Preview”:

With what Hirnsushi explained, it is even more complicated that what I imagined, as he is claiming that pm uninstall is not enough to get rid of Google Photos…

@flipreverse What is your strategy to install it? Shelter? Magisk? Did you already successfully installed your own apk or not? :slight_smile:


That partially answered my question → you are not on Stock FPOS :+1: . Which OS are you using?

Currently, my plan is using adb. I installed the app via AndroidStudio. Since I’m not using Stock FPOS, I do not have to replace Google Photos.
Do you have any suggestions for a better way of installing it?

I’m using a self-built version of LineageOS 20.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.

Continuing the discussion from [FP4] Gallery Proxy for FPCamera (stock camera app):
I finally got some time to publish an APK.

@oli.sax In the meantime: Have you managed to make my app work?

1 Like

Hello, I’m just reading this post and wondering if this workaround is still necessary with the latest stock camera software update by Fairphone? the update of February 2024. I don’t have a Fairphone 4 (yet).

Since the big camera update you can just click the last image preview disc/button and it will prompt you to pick an app to use if Google Photos is disabled. Unfortunately it doesn’t seem to remember the choice though.