autofocus does not work in own app - AT&T HTC One (M8)

Hey there,
I hope this question is not to special fro this forum and this place, but i don't know where i could ask elsewhere..
To the topic: for my BA i'm writing a camera app. The basic is an object detection. I tested my App with diffrent Smartphones, S2, S4, One, Tablets, the Focus was never a big problem. I just used a button which in short does a
mCamera.autoFocus(new AutoFocusCallback() {
@Override
public void onAutoFocus(boolean success, Camera camera) {
Log.i(TAG, "Focus finish " + success);
}
});
Click to expand...
Click to collapse
Thats all. But with my new One M8 that does not work. the light, the focus, I don't get the Camera to adjust itself, not in one Focus Mode, not with an Area in the middle neither with a touch area. i also tried to figure out the problem with the open source app 'open camera', which can focus and everything perfectly. I really don't have a clue what the problem is.
And the Code i mentioned above, i get no Log message at all, it seems, the camera just does not do a focus so it does not stop and triggers the callback. embedded in an try box i get no exception likewise, there does not seems to be a problem, but the camera does not focus -.-
I tried to open the front camera, but that does not support focus and i get immediately the "Focus finish" message..
And I recognize htc published a sdk for the dual camera, if that is the problem, but my app has to be available for as much devices as possible, so i can't use a 'custom sdk'..
So, does anybody know what parameters i have to set or how i can trigger the focus the right way for the M8? Thanks for every hint.
Edit:
I could not really 'fix' the problem, but i installed cyanogenmod. Now the focus works like it should. Seems to be another strange HTC software behaviour..

Related

[Q] Advanced Camera Controls

Does anyone know if there's a program that lets you take more control over the HD2s camera?
I'm not even asking for shutter speed and aperture settings (although that would be awesome ;-).....I just sometimes wish I had some simple controls like exposure value (EV) to control the...well...exposure of the image. And I'm not talking about the "brightness"-setting which is just digital....
Am I the only one there?
I don't expect my HD2 to replace my SLR but it would certainly make many pictures better to have this kind of control...
Hope you guys know something!!!
cheers,
borg
The problem is HTC haven't publicly (i.e. accessible to programmers) made available any way of interacting with their camera driver libraries. All you have access to in programming code is the ability to 'ask' it to prompt the user to take a picture (and then do something with the taken pic afterwards). There's no way of interacting with the way the camera takes the picture.
This is also why we've not got any augmented reality apps etc. on the hd2 as there is no straight-forward way of accessing the camera live feed from code (without some serious hacking) all you can access is pictures taken by it.
Thanks for the info!
That's a real pity....do you think there's any chance, they're gonna release an api or something anytime in the future???

[APP] Instagram for android

Description:
Instagram – A beautiful way to share your world. It's fast, free and fun! 

Pick from one of several gorgeous filtered effects to breathe a new life into your mobile photos. Transform everyday moments into works of art you'll want to share with friends and family.

Share your photos in a simple photo stream with friends to see - and follow your friends' photos with the click of a single button. Every day you open up Instagram, you'll see new photos from your closest friends, and creative people from around the world.

Features
:
☆ 100% free custom designed filters and borders
☆ Lux works its magic by making your photos more vibrant and brings out details in your photos you couldn't see before
☆ Instant sharing to Facebook, Twitter, Tumblr, and Foursquare (Flickr coming very soon)

☆ Interact with friends through giving & receiving likes and comments

☆ Works with Android versions 2.2 and above that support OpenGL ES 2
☆ Full front & back camera support
☆ And much much more...
APK is avalible here since the app isn't avalible on the market for us. Haven't tested it yet, though so I'm not sure whether it'll work at all. Will update this thread/post to confirm if it does or doesn't work.
first time i had a fc,then i reloaded and it worked,but when i loaded a photo,again fc :/
dreamkill3r said:
first time i had a fc,then i reloaded and it worked,but when i loaded a photo,again fc :/
Click to expand...
Click to collapse
Yeah, I'm getting FCs too. Looks like I'll have to keep using picplz for now, untill they add a direct upload feature.
you happen to know the path for its processed images? i want to upload one to FB but not using instagram itsel, cant find the path (is not DCIM)
arana1 said:
you happen to know the path for its processed images? i want to upload one to FB but not using instagram itsel, cant find the path (is not DCIM)
Click to expand...
Click to collapse
Not sure. In a instagram folder on your SD card possibly? I'll look in a bit.
Sent from my HTC Wildfire using xda premium
Unfortunately me too.. Getting FC when uploading a picture. This sucks.. Been waiting for this app to be available for android and yet i can not fully use it on my phone..
Yeah, mine has it too, sadly
I have those Forcing closes after choosing an image or making one, so Instagram doesn't work completely at the Wildfire
I hope some updates for the app will come with better Support for the Wildfire, so we can use it like others can.
I've been waiting so long for this, so I hope it'll be fixed soon..
tobirocker51 said:
Yeah, mine has it too, sadly
I have those Forcing closes after choosing an image or making one, so Instagram doesn't work completely at the Wildfire
I hope some updates for the app will come with better Support for the Wildfire, so we can use it like others can.
I've been waiting so long for this, so I hope it'll be fixed soon..
Click to expand...
Click to collapse
Turns out its very buggy on many lower-end android phones. I hope they work on it more to have better compatability with lower-end android phones.
Instagram have updated app,
Instagram 1.0.1 can be found HERE
GlennBrownie said:
Instagram have updated app,
Instagram 1.0.1 can be found HERE
Click to expand...
Click to collapse
Tried it on oxygen, didn't work. Can anyone try it on stock or stock-based roms?
that does not look good - I can't remember having seen this yesterday:
"Phones without OpenGL ES 2, such as the Galaxy Y or first generation HTC Wildfire, do not have the technology required to power Instagram's filters, and therefore cannot be supported."
Click to expand...
Click to collapse
Phones without OpenGL ES 2, such as the Galaxy Y or first generation HTC Wildfire, do not have the technology required to power Instagram's filters, and therefore cannot be supported.
Click to expand...
Click to collapse
Source: sorry can't post this because I am a noob user xD google for "INSTAGRAM | Supported OS & Devices" should be the first result.
I would say - no GPU, graphical processing unit - no OpenGL ES 2 right!?
greetz
scarfur said:
Source: sorry can't post this because I am a noob user xD google for "INSTAGRAM | Supported OS & Devices" should be the first result.
I would say - no GPU, graphical processing unit - no OpenGL ES 2 right!?
greetz
Click to expand...
Click to collapse
hm, don't know if I understand you right - but isn't that exactly what I've posted above (from the Instagram website).
Regarding the missing GPU I'm not absolutely sure if v. 2 is not supported at least partly because OpenGL ES-CM 1.0 is - but the missing GPU of course wouldn't produce nice results in image editing anyway (and cause too many negative side effects).
Due to the fact that our buzz is a pretty old low end device (in smartphone terms) I wouldn't expect any special treatment by Instagram.
I have no idea if that's any help, but I poked around in the .apk with dex2jar and jd-gui and don't really get why OpenGL ES 2.0 should be necessary. The only place I found references to 2.0 was in /com/instagram/android/gl/GLHelper and there we have:
Code:
int i = GLES20.glGetError();
GLES20.glBindTexture(3553, i);
GLES20.glTexParameterf(3553, 10241, 9729.0F);
GLES20.glTexParameterf(3553, 10240, 9729.0F);
GLES20.glTexParameteri(3553, 10242, 33071);
GLES20.glTexParameteri(3553, 10243, 33071);
GLES20.glTexParameterf(3553, 10241, 9729.0F);
GLES20.glTexParameterf(3553, 10240, 9729.0F);
The method signatures for these are (according to developer.android.com/reference/android/opengl/GLES20.html):
Code:
public static int glGetError ()
public static void glBindTexture (int target, int texture)
public static void glTexParameterf (int target, int pname, float param)
public static void glTexParameteri (int target, int pname, int param)
Compared to the GLES10 signatures (developer.android.com/reference/android/opengl/GLES10.html) there's no difference:
Code:
public static int glGetError ()
public static void glBindTexture (int target, int texture)
public static void glTexParameterf (int target, int pname, float param)
they seem the same, except for the missing glTexParameteri, but there's a:
Code:
public static void glTexParameterx (int target, int pname, int param)
and in GLES11 (developer.android.com/reference/android/opengl/GLES11.html) we would also have glTexParameteri:
Code:
public static void glTexParameteri (int target, int pname, int param)
I tried to modify the .apk, swapping GLES20 to GLES11, like described on code.google.com/p/dex2jar/wiki/ModifyApkWithDexTool but I got errors on the verification (even before modyfing) and I don't have much experience with android development, but maybe someone else could give it a shot.
I have no clue if that could work anyway, but if it doesn't really need GLES20 and just crashes because it tries to call things that aren't there, why wouldn't it?
Due to the fact that I haven't had any look into the instagram iPhone app I've really been curious to test it on my Wildfire. Feeling left out with GPU-less phones is not nice but I have noticed that not everyone with a more sophisticated device seems to be satisfied ​
http://news.sky.com/skynews/Article/201204216205464
Another one swept up by a major power.
Sent from my HTC Wildfire using xda premium
Picsart nice alternative.
MANCHESTER together UNITED forever
Well at least upload is now available, someone is bound to make an app that is more compatible.
Sent from my HTC Wildfire using Tapatalk
I use MyTubo... Nice replacement..
https://play.google.com/store/apps/details?id=com.redwolfama.pictwitter&feature=search_result&hl=en
Why settle for replacement?
Just grabbed from galaxy 3 forums, as far as I can tell works fine but at work so can't test it properly xD
Well anyway, here's the download link :
http://db.tt/yuq3rPhs
Let us know how it goes!
EDIT :
Just taken a quick snap, still FC
Sent from my HTC Wildfire using Tapatalk 2

[App Request] Gyroscope Emulator/Virtual Gyroscope

I recently bought a cardboard. But cant taste many apps because my Android smartphone doesn't have a Gyroscope sensor. So i searched for an app that can mimic the gyroscope functionality by pressing keys or something.
I got these...
1. https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/wiki/Virtual Gyro
2. http://www.mcubemems.com/products/igyro/
These aren't any app, but proof that Virtual Gyroscope exists. Some lenoveo phones(Like K3 note) use them. So plz let me know, is there any app that can do the same effect in any android device with Accelerometer & Compass sensor. Or, any app that can mimic the effect pressing volume/headphone key.
only look left/right action is required , Accelerometer does look up/down.
Yes by this i wont get a head tracking experience, but at least I can look around and select files to watch videos. Developers can make app(if doesn't exist already) following this idea. I think, it will help many.
Thanks in advance
Hi, I'm also looking for some app that fakes gyro sensor as I have the same problem. In theory a dev could interpret those algorithms from that Github repo and make an emulator, unfortunately this is out of my knowledge.
So I hope someone could help us poor ungyroscoped people.
Yeah, it's big problem with most phones to use VR apps/games that require gyroscope. I have the same problem.
Google should think about gyro pseudo emulation with accelerometers in their Cardboard API or at least implement there something like this lib: https://code.google.com/p/openintents/wiki/SensorSimulator
so anyone could use different phone (with gyro) as remote gyro for phone in cardboard glasses or write gyro emulators much more easily (as this lib can open TCP port for remote sensors data).
Technically, yes, it should be possible, using Xposed.
I am working on a module that eliminate the jitter in unreliable phone's gyroscopes. It does so by hooking to the function that distpaches the various sensors' data to every apps that require them, and it fakes the values before these data get sent.
Since you can easily access any sensor's data, you can do any sensor fusion you want by using the accelerometer and magnetometer, or even just the touch screen, and then fake the gyroscope's values.
If you are interested, here is the Xposed module I'm working on, which shows how to hook to the gyroscope and fake the values:
On github: lrq3000/JitteryGyroFixForCardboard
And to implement sensor fusion, you can either use the new virtual sensors of Android 4, or code it yourself, there's a very good open source app that shows it all here:
On github: KEOpenSource/GyroscopeExplorer
Hey thank you for that info! I'll be taking a look at that as soon as I can, although I'm not an avid dev I hope we can get something for our phones.
shafiaszad said:
I recently bought a cardboard. But cant taste many apps because my Android smartphone doesn't have a Gyroscope sensor. So i searched for an app that can mimic the gyroscope functionality by pressing keys or something.
I got these...
1. https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/wiki/Virtual Gyro
2. http://www.mcubemems.com/products/igyro/
These aren't any app, but proof that Virtual Gyroscope exists. Some lenoveo phones(Like K3 note) use them. So plz let me know, is there any app that can do the same effect in any android device with Accelerometer & Compass sensor. Or, any app that can mimic the effect pressing volume/headphone key.
only look left/right action is required , Accelerometer does look up/down.
Yes by this i wont get a head tracking experience, but at least I can look around and select files to watch videos. Developers can make app(if doesn't exist already) following this idea. I think, it will help many.
Thanks in advance
Click to expand...
Click to collapse
Yes, same problem here. The facts, med-low or med or med-high device not attached by gyro, except xiaomi. Some people on quorra debated, they have idea to make an app which can do headtracking with camera by detecting pixel shift. Yes i like that idea and the idea sounds possible, but it out of my knowledge. Can anyone make app like that? Or maybe we can ask google to make the app?
Thanks
What about emulating gyro using accelerometer and compass? In the Google Play is app for phones without gyroscope, (we are in space: LINK) so it is possible
I would love to see something like this too. This dev has several VR apps and the head tracking all works perfectly on my Moto G 3rd gen which has no Gyro, so I know it is possible. I've played House of Terror and the head tracking works extremely well and pretty smooth too, I wonder what their method is, I assume compass + accelerometer. https://play.google.com/store/apps/developer?id=Lakento
shafiaszad said:
I recently bought a cardboard. But cant taste many apps because my Android smartphone doesn't have a Gyroscope sensor. So i searched for an app that can mimic the gyroscope functionality by pressing keys or something.
I got these...
1. https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/wiki/Virtual Gyro
2. http://www.mcubemems.com/products/igyro/
These aren't any app, but proof that Virtual Gyroscope exists. Some lenoveo phones(Like K3 note) use them. So plz let me know, is there any app that can do the same effect in any android device with Accelerometer & Compass sensor. Or, any app that can mimic the effect pressing volume/headphone key.
only look left/right action is required , Accelerometer does look up/down.
Yes by this i wont get a head tracking experience, but at least I can look around and select files to watch videos. Developers can make app(if doesn't exist already) following this idea. I think, it will help many.
Thanks in advance
Click to expand...
Click to collapse
Same problem. I also have a k3 note and it has a virtual gyro. i think there must be something that uses accelateometer and magnetometer to detect direction and angle.(and i think this is possible)
Guys try vr player from play store then goto settings and there would be orientation detector set it to accelerometer +compass and you are donw
Same Problem
lrq3000 said:
Technically, yes, it should be possible, using Xposed.
I am working on a module that eliminate the jitter in unreliable phone's gyroscopes. It does so by hooking to the function that distpaches the various sensors' data to every apps that require them, and it fakes the values before these data get sent.
Since you can easily access any sensor's data, you can do any sensor fusion you want by using the accelerometer and magnetometer, or even just the touch screen, and then fake the gyroscope's values.
If you are interested, here is the Xposed module I'm working on, which shows how to hook to the gyroscope and fake the values:
On github: lrq3000/JitteryGyroFixForCardboard
And to implement sensor fusion, you can either use the new virtual sensors of Android 4, or code it yourself, there's a very good open source app that shows it all here:
On github: KEOpenSource/GyroscopeExplorer
Click to expand...
Click to collapse
I bought a vr case and have the same problem my galaxy sm a510m (A5 2016) doesnt have gyro! When i saw that i couldnt believe it.... it opens with my fingerprint for the love of crist!!! :crying:
Any solutions?
I have a moto g 3 and can't experience Pokemon go neither vr visor from one plus
Sent from my MotoG3 using XDA-Developers mobile app
Is there still hope?
If there is no way (for whatever reason) to emulate a gyro...is there a method to add a gyroscope sensor to an android?
Sent from a Samsung Galaxy J7 user
Same here, i too need an APP that simulate the gyro functions.
Hope that someone could implement that using compass and accelerometer!
Thanks
Some app like this would be so cool...
I was a bit dissapointed after buying the Moto X Play and noticing it doesn't have gyroscope so no Augmented Reality on Pokemon GO.
Im so sad, i had a moto g2 and bought motog3 1 month ago, this thing doesnt have a gyroscope while motog2 had one. Is there no solution for this? I mean, with something like a virtual gyroscope
pokulan said:
What about emulating gyro using accelerometer and compass? In the Google Play is app for phones without gyroscope, (we are in space: LINK) so it is possible
Click to expand...
Click to collapse
I've tested with my Moto G 3rd and works well. I hope somebody develop some hook in Xposed to work with accelerometer and compass...
or lests just hope the pokemon go app support accelerometer + compass it in the future.
I feel where you all are coming from. I agree there needs to be an app, an xposed module, or something to get this functionality. I'm gonna try and figure this out, there's a post on stackoverflow about this. A guy was talking about how in order to do it you'd need to recreate files similar to the ones that poll the actual hardware. He's basically saying you need to create some sort of mock gyroscope polling code right above the hardware level. I don't think that's the best approach, we gotta go top down not bottom up on this. I don't know much about the inner workings of android but I know this, looking at how to grab sensor data just using a plain app uses the classes sensor and sensor manager. As far as i can tell these are fed with information by the sensor event listener. That is fed by the object sensor event. It states right on the documentation "This class represents a Sensor event and holds information such as the sensor's type, the time-stamp, accuracy and of course the sensor's data." Its a generic sensor class which means we could possibly give it a fake gyroscope right?
Now, back to the sensor event listener, on the documentation it says "The application doesn't own the event object passed as a parameter and therefore cannot hold on to it. The object may be part of an internal pool and may be reused by the framework.". That means sensor event listener is literally just the messenger and should take whatever it finds as long as its valid. It seems like it will take whatever is passed to it correctly if we can make an event that it hears.
Now, amazingly on the sensor event page shows some fantastic stuff. Sensor event class is literally a 4 field class and I believe gets its values from that "hardware polling code" that sits above the hardware level. (the code that other guy was talking about.). If we can just make up some sensor events that mimic a gyroscope using accelerometer + compass and hope that the sensor event listener is configured to pick it up (I don't see why not) then I think this could be a possible solution. With all that being said, I'm just a beginner when it comes to android. I'm a college kid with a background in c and java just trying to piece the puzzle pieces together and play some pokemon lol.
Edit: So I may have been way off the mark, I'm not sure anymore. I found this though, a way to use actual custom sensors with android http : // riansanderson.blogspot . com/2012/03/integrating-sensors-into-android . html . Sorry for the spaces, I can't post links. After more java delving it seems it is not possible to create your own spoofed sensor or sensor event if your code is not in the same package as android.hardware.Sensor or SensorEvent
Edit2: So I guess unless you can get code to run in that android.hardware package, you'd have to do something like that link above and make like a fake driver for fake hardware.. I suppose if you could modify android.hardware.sensor to just make a gyroscope sensor and take the values from the accelerometer and modify those on the fly.
Try this solution
hello all from Egypt
this tutorial isn't mine or my invention you can say it's information sharing
I am Waleed and i have Huawei honor 4x which has no gyroscope at all, but i found some solution to this problem which is:
1- you must have ROOT (without root you can't do anything at all)
2- install root explorer if it isn't installed in your mobile and be sure to allow root permission to it
3- download the attached xml file which activate soft gyroscope in your mobile and place this file in your SD card
4- open root explorer and copy the xml file you downloaded and go to this path "/system/etc/permissions" and paste the file there and be sure the file exists in this place
5- reboot the phone then install any app from Google play to check the gyroscope i suggest sensor box
6- I hope this information is valuable and useful for you
thanks

Cm 12.1 on z ultra, camera issue anyone?

Hi there,
I have moved away from stock rom and installed cm 12.1
All seems to be working smoothly except for the camera which seems to not allow me to focus manually. Pretty much everything is in focus and I can't get any control over the shallowness of the depth of field (not that I expect a whole lot form a smartphone but here: if I focus on a far away object or an object which is right next to the lens I get the same result).
Anything I could do to make the camera work better (implement manual focus would be a good start) ?
Is there a way to get the phone to be ok with all the settings from "manual camera"? (apparently lollipop implements new protocols for camera so that we can use more manual settings.
Thanks!

Using Silvercrest selfie remote button for other purposes

I got my hands on Silvercrest selfie remote button. I cannot post the link (yet), but it is easily googleable.
I was hoping that I could use it outside the native app, e.g. with Tasker. No such luck... First of all, I cannot even detect the button outside the app... I was hoping it would register as a Bluetooth keyboard or something, but it is not seen at all. In fact, I can have BT switched off completely (as well as NFC) and it still works in the native app an nowhere else...
Any idea how I could capture the button presses? The app itself is freely available on Google Play, but it is beyond my skills to reverse engineer it...
Does anyone even have an idea _how_ it works?
I am also interested in an answer to this. Just got one ran a few tests, only works inside there app, would like to use it for other tasks as well.
The secret is rather simple: it produces a specific tone that is recognized by the app.

Categories

Resources