Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate useFront camera property #335

Closed
wants to merge 15 commits into from

Conversation

marksherman
Copy link
Member

Deprecates the code relating to the property and removes it from the designer.

Fixes #180 (at least in the short term, by taking the feature away)

@josmas @jisqyv

Change-Id: I2520d79c928697939f7deb298a63bcf66b2e5833
Change-Id: I6b88bfc81d7d3468bd0bb45dd7ea609be93dea54
Change-Id: I65a6067cb64f6494e54ae9938bf3750bfcfe76da
@josmas
Copy link
Member

josmas commented Mar 24, 2015

Please hold on doing anything with this at least until applications for GSoC15 are over. One of the challenges involves this property and people can get confused if it disappears right now. cc/ @jisqyv @halatmit

@osmidy
Copy link

osmidy commented Mar 26, 2015

I was looking into #180 yesterday. Apparently there exists no intent to specify which camera to use (other than the unofficial) non-working one; the user should decide what camera to use. Unless we want to deal directly with android.hardware.camera, dropping the property is best. For what it's worth, Camcorder currently lacks the property. @halatmit @josmas

@halatmit
Copy link
Contributor

How does the android camera app let the user pick which camera to use?

== Hal Abelson
hal@mit.edu
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty

On Thu, Mar 26, 2015 at 3:20 PM, osmidy notifications@github.com wrote:

I was looking into #180
#180 yesterday.
Apparently there exists no intent to specify which camera to use (other
than the unofficial) non-working one; the user should decide what camera to
use. Unless we want to deal directly with android.hardware.camera, dropping
the property is best. For what it's worth, Camcorder currently lacks the
property. @halatmit https://github.com/halatmit @josmas
https://github.com/josmas


Reply to this email directly or view it on GitHub
#335 (comment)
.

@osmidy
Copy link

osmidy commented Mar 26, 2015

Whatever camera app is used by default on the phone should have a button to switch between the front- and back-facing cameras.

@marksherman
Copy link
Member Author

The system camera app, like most camera-using apps, accesses the camera
system directly, through which it can query available cameras and select
which to use. (I've looked at this api)

App Inventor has always used an intent to launch the external camera app,
and that intent does not have any way of specifying, and it definitely
cannot query device state.

Building in direct camera access into app inventor (and no longer launch an
external app) is the inevitable solution. osmidy's assessment is correct-
until we're ready to do that, we should deprecate the feature.

I have the deprecation ready to pull, and am waiting for GSoC15 to conclude
before submitting (as instructed by José).

On Thu, Mar 26, 2015, 3:25 PM hal notifications@github.com wrote:

How does the android camera app let the user pick which camera to use?

== Hal Abelson
hal@mit.edu
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty

On Thu, Mar 26, 2015 at 3:20 PM, osmidy notifications@github.com wrote:

I was looking into #180
#180 yesterday.
Apparently there exists no intent to specify which camera to use (other
than the unofficial) non-working one; the user should decide what camera
to
use. Unless we want to deal directly with android.hardware.camera,
dropping
the property is best. For what it's worth, Camcorder currently lacks the
property. @halatmit https://github.com/halatmit @josmas
https://github.com/josmas


Reply to this email directly or view it on GitHub
<
#335 (comment)

.


Reply to this email directly or view it on GitHub
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mit-2Dcml_appinventor-2Dsources_pull_335-23issuecomment-2D86680977&d=AwMFaQ&c=TqceLeU8_c9CVUat-eLTFu19-lyGiWSvB_skZXlxt8Q&r=k-tN9RiDS5X8a15wxR_FMzWjUtK1yw-seWE6tKapqes&m=DUPKdN574xP1jai3p-7hyhda6Gy1KT4g_mAVIqe_rWM&s=dUMfOKVEaAnQxRq-SFl1vW89BkrQ5bcqGXmUT2bo7RY&e=
.

@halatmit
Copy link
Contributor

If we could implement the chooser button, then couldn't we implement that
same chooser as a property of the camera component? Or am I just
confused?

== Hal Abelson
hal@mit.edu
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty

On Thu, Mar 26, 2015 at 3:30 PM, osmidy notifications@github.com wrote:

Whatever camera app is used by default on the phone should have a button
to switch between the front- and back-facing cameras.


Reply to this email directly or view it on GitHub
#335 (comment)
.

@marksherman
Copy link
Member Author

If we rewrite the camera component completely with the camera API, we will
be able to have lots of good stuff, including a switch button. Also, we'd
be able to query the cameras available from the blocks, and choose cameras
from the blocks.

But we don't use the camera API. we simply open the default camera on the
device, and that app (which varies device to device) typically has a switch
button. But we have no control over it.

A less-critical problem with our current solution is we can't write
consistent instructions on what to do when the camera is open, and our
users can't predict the experience for their users. The camera apps
interfaces vary. Samsung's camera, beyond the big button to take the
picture, looks nothing like the nexus camera, etc.

On Thu, Mar 26, 2015, 3:33 PM hal notifications@github.com wrote:

If we could implement the chooser button, then couldn't we implement that
same chooser as a property of the camera component? Or am I just
confused?

== Hal Abelson
hal@mit.edu
Prof. of Comp. Sci. and Eng.
MIT Dept. of Elec. Eng. and Comp. Sci.
MIT Media Lab, Second Class Faculty

On Thu, Mar 26, 2015 at 3:30 PM, osmidy notifications@github.com wrote:

Whatever camera app is used by default on the phone should have a button
to switch between the front- and back-facing cameras.


Reply to this email directly or view it on GitHub
<
#335 (comment)

.


Reply to this email directly or view it on GitHub
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mit-2Dcml_appinventor-2Dsources_pull_335-23issuecomment-2D86684513&d=AwMFaQ&c=TqceLeU8_c9CVUat-eLTFu19-lyGiWSvB_skZXlxt8Q&r=k-tN9RiDS5X8a15wxR_FMzWjUtK1yw-seWE6tKapqes&m=l_fj0Zy27sG4HLaaP74AIXfXGn7KLkyONGpIZICcmjU&s=joSLozyobJ8xoAbsgP7Cijfv-5hBJx6AEXK23HgS5YA&e=
.

@halatmit
Copy link
Contributor

also see issue #338
also issue #180

@marksherman
Copy link
Member Author

@josmas is GSoC15 sufficiently over yet? This trigger awaits to be pulled.

Change-Id: I2520d79c928697939f7deb298a63bcf66b2e5833
Change-Id: I6b88bfc81d7d3468bd0bb45dd7ea609be93dea54
Change-Id: I65a6067cb64f6494e54ae9938bf3750bfcfe76da
@thequixotic
Copy link
Contributor

Rewriting the Camera Component is tricky because of the vast types of devices out there. There is a standard way of doing things neatly that should work on all devices, but it requires a SurfaceView (http://developer.android.com/reference/android/view/SurfaceView.html) with a size of at least 1x1 px . SurfaceView can be achieved by upgrading the Canvas Component.

However if you ignore older devices (<API 11) we can use SurfaceTexture (http://developer.android.com/reference/android/graphics/SurfaceTexture.html) to use camera and take pictures without a preview.

Again the Camera api has so many settings which are different for different camera sensors. So images taken on some devices with improper settings can give you too dark images (due to very low exposure setting). To fix this there seems to something called AutoFocus(http://developer.android.com/reference/android/hardware/Camera.html#autoFocus(android.hardware.Camera.AutoFocusCallback)).
Maybe we can get default camera preferences.

Not to mention the deprecated status of android.hardware.Camera.. The newer one is android.hardware.camera2 (android.hardware.http://developer.android.com/reference/android/hardware/camera2/package-summary.html). This might not be a problem though.

Obviously depracating useFront is easy, but I think we should wait till the Canvas Component can be upgraded to show live Camera preview. As of right now it doesnt crash the app if UseFront is checked, it simply ignores because the Camera App doesnt even know the extra intent data being passed) ..

One camera App that does accept the UseFront intent data is Camera KK (https://play.google.com/store/apps/details?id=com.moblynx.camerakk&hl=en) .. So UseFront does work with this Camera App linked.

@josmas
Copy link
Member

josmas commented Apr 18, 2015

@marksherman yes, GSoC applications are over (results are not out yet, though) so taking the tag off now.

@halatmit
Copy link
Contributor

halatmit commented May 1, 2015

@afmckinney @jisqyv
This should be ready to merge.
PTAL

@jisqyv jisqyv self-assigned this May 1, 2015
@jisqyv
Copy link
Member

jisqyv commented May 1, 2015

@marksherman Because you are deprecating a block, you have to update YOUNG_ANDROID_VERSION and the version of the Camerca Component. Make sure the upgrader does the right thing with projects that have the block in use AND have set the useFront property in the designer.

The code as written causes projects which set useFront in the designer to fail to load.

Change-Id: I2520d79c928697939f7deb298a63bcf66b2e5833
Change-Id: I6b88bfc81d7d3468bd0bb45dd7ea609be93dea54
Change-Id: I65a6067cb64f6494e54ae9938bf3750bfcfe76da
Change-Id: I6431eab491527573dbca9c798c402a5c28cc9b10
@marksherman
Copy link
Member Author

You know what's funny? The existing useFront currently works perfectly on my OnePlus One (Cyanogen 12s).

So current status is that this feature sometimes works, depending on the device and camera app.

@halatmit
Copy link
Contributor

I'll do this as soon as we fix the deprecation code.

Change-Id: I2d3d0d7938841211b568a576b19b3a5503788e6e
@jisqyv
Copy link
Member

jisqyv commented Jan 10, 2016

Implemented in 27a5823 Closing this one.

@jisqyv jisqyv closed this Jan 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useFront property of camera no longer works
6 participants