2017년 8월 22일 화요일

Help with project fix - Front camera


it's been reported in the forum that the front camera property has
stopped working. We are looking for help on fixing this and we've put
together the following document explaining the work needed: App Inventor 2 - Front Camera Project

Please have a look and let us know if you are interested in coming up
with a solution!

We are also interested in knowing if this is a good model to get
contributions from you guys; do you like the idea of having this kind
of 'mentored' projects? If so, we will spend a bit of time documenting
more of these and will add a section to the OSS site with a list of
potential projects to work on.

--
The front-camera option depends on an undocumented feature of android that is included for "testing." Not using a real api means there was never a google promise of it working for any amount of time in the future, and the feature of app inventor carried that uncertainty. 

It not working on a per-phone basis is new to me, but I totally don't doubt it. 

When it fails, it fails cleanly, and the default camera opens up.

I wrote this feature, and that's my line of code in the doc.

So what do we want to do?

--
Mark, it was working on my phone when I used it in the past, but it's
not working anymore. There's a proposed solution in the doc, but I'm
sure it's not the only one possible.

--
Just tested, and it's exactly as i thought: no longer works on my 4.4.2 Nexus4, but does still work on my 4.3 samsung.

It worked as of 4.4.whateverTheFirstVersionPushedWas

I re-checked the documentation, and it appears the correct answer is to build a camera feature proper, using the android Camera API, rather than an intent off to the camera app. 
The barcode reader is already embedded, which uses the raw camera api, so it's not terribly far-fetched. 

Multiple camera support starts at API level 9, and would, if done well, also allow the App Inventor component to query what cameras are available on the device. 

This solution is not something i'm ready to devote time to doing. I see no way to get around it, with or without intents, now that google has closed that door. 

So yes, José, your proposal is basically right, to use the Camera API to query the abilities of the device, but it can't simply be added to the current intent-based mechanism, as the intents don't support camera choice (as of right now, officially as of never). The whole core of the camera AI component would need to be rewritten.

But, as is always said, I could be wrong.

---
The camera and video component were 2 component on my to do list for my own mods. A few months ago I created a experimental app to control the camera and preview the image in a surfaceView and switch between the front and rear camera which was pretty easy to do. My plan was to redevelop/redesign both components from the ground up and also include a surface view to give live feed back rather than using the built in camera app.
The only issue as Mark has already stated is the to access the front camera with the Camera API you have to set the targetSDK level to 9 and I know for MIT App Inventor this would not work as you are running on API 3.

I have done a lot of searching on the net today to check if there is an alternate way to check for a front camera on API 3 and so far haven't found a solution as yet. I will keep search and try to think of a way to solve the issue but I have the feeling the only way to do this will be if the targetSDK is 9 unfortunately

--
Gareth, level 9 functionality is fine as long as we provide less
functionality or proper handling of older devices: Supporting older and newer devices in App Inventor

--
Setting target to 9 will drastically affect all layouts

--
I am not proposing changing the min or target SDK. There are plenty of examples in AppInventor that allow functionality for higher level APIs still handling non supported devices. One such example is nfc. Please read the doc I linked to.

--

댓글 없음:

댓글 쓰기