Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {}
}
134 changes: 134 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# **CameraIDs**
# **CameraHW**

###### A simple app to display all *Camera IDs* on an Android device and share that info as text.
###### A simple app to display all *Camera IDs* on an Android device, check compatibility with advanced camera apps and share that info as text.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ android {
buildToolsVersion "30.0.1"

defaultConfig {
applicationId "com.vibhorsrv.cameraids"
minSdkVersion 28
applicationId 'com.rakin.vibhorcameraids'
minSdkVersion 20
targetSdkVersion 30
versionCode 11
versionName "1.1"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vibhorsrv.cameraids">
package="com.rakin.vibhorcameraids">

<application
android:allowBackup="true"
Expand Down
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vibhorsrv.cameraids;
package com.rakin.vibhorcameraids;

import android.util.Size;
import android.util.SizeF;
Expand All @@ -19,6 +19,8 @@ public class Camera {
private final float aperture;
private final int[] aeModes;
private final Size[] rawSizes;
private final Size[] jpegSizes;
private final Size[] yuvSizes;
private final SizeF sensorSize;
private final Double angleOfView;
private final boolean flashSupported;
Expand All @@ -27,7 +29,7 @@ public class Camera {
private String type = "";
private String name = "";

public Camera(String id, boolean isFront, float focalLength, float aperture, SizeF sensorSize, double angleOfView, int[] aeModes, boolean flashSupported, Size[] rawSizes, String supportedHardwareLevel, Set<String> physicalIds) {
public Camera(String id, boolean isFront, float focalLength, float aperture, SizeF sensorSize, double angleOfView, int[] aeModes, boolean flashSupported, Size[] rawSizes, Size[] jpegSizes, Size[] yuvSizes, String supportedHardwareLevel, Set<String> physicalIds) {
this.id = id;
this.focalLength = focalLength;
this.aperture = aperture;
Expand All @@ -36,6 +38,8 @@ public Camera(String id, boolean isFront, float focalLength, float aperture, Siz
this.aeModes = aeModes;
this.flashSupported = flashSupported;
this.rawSizes = rawSizes;
this.jpegSizes = jpegSizes;
this.yuvSizes = yuvSizes;
this.supportedHardwareLevel = supportedHardwareLevel;
this.isFront = isFront;
this.physicalIds = physicalIds;
Expand Down Expand Up @@ -96,6 +100,14 @@ public Size[] getRawSizes() {
return rawSizes;
}

public Size[] getJpegSizes() {
return jpegSizes;
}

public Size[] getYUVSizes() {
return yuvSizes;
}

public SizeF getSensorSize() {
return sensorSize;
}
Expand All @@ -115,6 +127,8 @@ public boolean isTypeNotSet() {
@NonNull
public String toString() {
return "" + type + (isFront ? "FRONT" : "BACK") + " " + "ID" + '[' + id + "] " + name + (physicalIds.isEmpty() ? "" : " = ID" + '[' + physicalIds.toString().replace(", ", " + ") + ']') +
"\n\t\t\t" +
"SupportedHardwareLevel = " + supportedHardwareLevel +
"\n\t\t\t" +
"FocalLength = " + focalLength +
"\n\t\t\t" +
Expand All @@ -130,7 +144,16 @@ public String toString() {
"\n\t\t\t" +
"RAW_SENSOR sizes = " + Arrays.toString(rawSizes) +
"\n\t\t\t" +
"SupportedHardwareLevel = " + supportedHardwareLevel +
"\n_______________\n" +
"YUV_420_888 sizes = " + Arrays.deepToString(yuvSizes) +
"\n\t\t\t" +
"\n_______________\n" +
"JPEG sizes = " + Arrays.toString(jpegSizes) +
"\n\n" +
"\n\t\t\t" +
"\n\t\t\t" +
"\n===============\n" +
"\n\t\t\t" +
"\n\n"
;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vibhorsrv.cameraids;
package com.rakin.vibhorcameraids;

import android.graphics.ImageFormat;
import android.hardware.camera2.CameraAccessException;
Expand All @@ -13,6 +13,7 @@

/**
* Created by Vibhor on 23/09/2020
* Modified by Rakin on 27/09/2020
*/
public class CamerasFinder {
private final Map<String, Camera> map = new LinkedHashMap<>();
Expand Down Expand Up @@ -42,6 +43,8 @@ private void scanAllCameras(CameraManager cameraManager) {
cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES),
cameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE),
getRawSizes(cameraCharacteristics),
getJpegSizes(cameraCharacteristics),
getYUVSizes(cameraCharacteristics),
getSupportedHWlevel(cameraCharacteristics),
cameraCharacteristics.getPhysicalCameraIds()
);
Expand Down Expand Up @@ -160,15 +163,27 @@ private Size[] getRawSizes(CameraCharacteristics cameraCharacteristics) {

}

private Size[] getYUVSizes(CameraCharacteristics cameraCharacteristics) {
StreamConfigurationMap streamConfigurationMap = cameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
return streamConfigurationMap.getOutputSizes(ImageFormat.YUV_420_888);

}

private Size[] getJpegSizes(CameraCharacteristics cameraCharacteristics) {
StreamConfigurationMap streamConfigurationMap = cameraCharacteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
return streamConfigurationMap.getOutputSizes(ImageFormat.JPEG);

}

private String getSupportedHWlevel(CameraCharacteristics cameraCharacteristics) {
return hwLevelName(cameraCharacteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL));
}

private String hwLevelName(int level) {
return level == 0 ? "LIMITED"
: level == 1 ? "FULL"
: level == 2 ? "LEGACY"
: level == 3 ? "3"
return level == 0 ? "LIMITED COMPATIBILITY"
: level == 1 ? "FULL\n\t\t\t (GCAM COMPATIBLE)"
: level == 2 ? "LEGACY \n\t\t\t (GCAM INCOMPATIBLE)"
: level == 3 ? "LEVEL3 \n\t\t\t (BEST GCAM COMPATIBILITY)"
: level == 4 ? "EXTERNAL"
: "";
}
Expand All @@ -192,15 +207,15 @@ private void setFileName(String mFileName) {
public String getResultString() {
StringBuilder sb = new StringBuilder();
sb.append(Build.BRAND).append(", ").append(Build.MODEL).append(", ").append(Build.MANUFACTURER).append(", ").append(Build.DEVICE);
setFileName("CameraIDs-".concat(sb.toString().replace(", ", "-")));
setFileName("CameraHW-".concat(sb.toString().replace(", ", "-")));
sb.append("\n\n");
sb.append("Android ").append(Build.VERSION.RELEASE).append(" - ").append(System.getProperty("os.version"));
sb.append("\n");

scanAllCameras(mCameraManager);
try {
sb.append("\n===============\n");
sb.append("\nCamera IDs visible to Apps = ");
sb.append("\nCamera IDs visible to Normal Apps = ");
sb.append(Arrays.toString(mCameraManager.getCameraIdList()));
sb.append("\n\n===============\n");
sb.append("All Cameras IDs = ").append(map.keySet()).append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vibhorsrv.cameraids;
package com.rakin.vibhorcameraids;

import android.content.Context;
import android.content.Intent;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_baseline_info_24.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<vector android:height="24dp" android:tint="#FFFFFF"
<vector android:height="24dp" android:tint="#212121"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_baseline_share_24.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="20dp"
android:tint="#FFFFFF"
android:tint="#212121"
android:viewportHeight="24"
android:viewportWidth="24"
android:width="20dp">
Expand Down
21 changes: 13 additions & 8 deletions app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group android:scaleX="0.2109375"
android:scaleY="0.2109375"
android:translateX="27"
android:translateY="27">
android:viewportHeight="108"
android:tint="#D8DCD9">
<group android:scaleX="2.2707"
android:scaleY="2.2707"
android:translateX="26.7516"
android:translateY="26.7516">
<path
android:pathData="M102.818,246.937C-19.326,218.191 -22.939,42.203 97.961,10.332 195.625,-15.413 278.187,89.578 233.156,182.257 209.669,230.597 152.962,258.738 102.818,246.937ZM150.879,235.858c22.15,-4.764 50.976,-21.523 53.277,-30.975 1.212,-4.977 1.212,-4.977 -7.294,1.715 -41.626,32.75 -96.516,32.644 -137.642,-0.266 -11.873,-9.501 -13.972,-6.762 -3.752,4.897 18.231,20.799 61.403,31.943 95.412,24.629zM197.048,185.488C236.387,178.063 250.336,141.021 233.165,89.58 201.254,-6.02 70.638,-14.52 27.329,76.184 18.296,95.102 16.109,106.39 23.848,94.149 54.285,46.01 123.826,66.448 129.055,125.069c3.336,37.41 22.348,58.681 55.595,62.202 1.039,0.11 6.618,-0.693 12.398,-1.784zM176.561,144.185c-14.444,-7.611 -12.781,-29.515 2.657,-34.987 10.026,-3.554 19.368,0.509 23.262,10.117 7.086,17.479 -9.586,33.477 -25.919,24.871zM83.131,140.385c10.999,-10.643 3.122,-29.816 -12.422,-30.236 -14.052,-0.38 -22.694,12.134 -17.399,25.196 4.96,12.236 19.794,14.743 29.821,5.04z"
android:strokeWidth="1.79818451"
android:fillColor="#ffffff"/>
android:fillColor="@android:color/white"
android:pathData="M14.12,4H9.88L8.05,6H4v12h16V6h-4.05l-1.83,-2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"
android:strokeAlpha="0.3"
android:fillAlpha="0.3"/>
<path
android:fillColor="@android:color/white"
android:pathData="M20,4h-3.17L15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,6h4.05l1.83,-2h4.24l1.83,2L20,6v12zM12,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5 5,-2.24 5,-5 -2.24,-5 -5,-5zM12,15c-1.65,0 -3,-1.35 -3,-3s1.35,-3 3,-3 3,1.35 3,3 -1.35,3 -3,3z"/>
</group>
</vector>
Loading