android-hardware

Get Android Phone Specs Programmatically

你。 提交于 2021-01-29 03:58:38
问题 I am trying to classify Android phones Running my Apps by something related to the performance. I want to cut out all low quality devices to look at performance/crash rates on good quality phones. I have the Device Model. For example, on the Samsung Galaxy S6 the value of Build.MODEL could be "SM-G920F", "SM-G920I", or "SM-G920W8". There is a related post about how to convert these into something human readable. Get Android Phone Model Programmatically I would like to just group phones by

Background Access to Microphone in Android

邮差的信 提交于 2020-01-14 19:05:20
问题 Is it possible to be constantly monitoring the microphone from a background application (service?) on an Android phone? Some idea of what I want to do: Listen constantly for an audible signal in the background. Upon receipt of 'interesting' audio signal, perform some network operation. The background application must be able to intelligently relinquish access to the microphone should a foreground application require it (unless it can be shared?) - e.g. to make a call. Is this possible? 回答1:

Using Android Voice Control launch my Activity

天涯浪子 提交于 2020-01-03 06:41:14
问题 I have read this post on SO and I have tried the code to launch my own speech recognition activity. It worked!. So my question is that how can I customize the action of the built in voice command button(hardware) to launch the activity which I have written instead of the built in voice search? I have thoroughly searched the net including this website. But I could not find a solution. I know that someone on SO has it!!! 回答1: You must use SpeechRecognizer instead of RecognizerIntent . It's a

Why imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); and <application android:hardwareAccelerated=“false” have different effect?

自作多情 提交于 2020-01-02 03:10:28
问题 I wonder why if I set <application android:hardwareAccelerated="false" using svg-android i see no image (due to hw acceleration problem?), but if I set imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); I can get it to work. Does View.LAYER_TYPE_SOFTWARE disables the hw acceleration or not? 回答1: The direct answer to your question (Does View.LAYER_TYPE_SOFTWARE disables the hw acceleration or not?) is YES. It actually disable hw acceleration, but only at a view level, i.e. hw accl is

How to make sure an android device application supports hardware feature

陌路散爱 提交于 2019-12-23 17:46:07
问题 I am developing an application which uses camera extensively. What I wish to do is that if a device or tablet does not have camera it my application should not get installed on it. Checked the <uses-feature> in android manifest but only checks when application is installed via android marketplace. What if I intend it to be also available my site. So is there a way I can handle this so that application should not get installed in case device does not have a camera hardware? Thanks, ~nil 回答1:

How to disable all hardware keys programatically in android?

99封情书 提交于 2019-12-23 02:40:50
问题 I am developing android application with lock functionality. please suggest me how to disable all the hard keys programatically. here i am using beleow code to disable back button. i want like this functionality for all hard keys like home,search,camera, shortcut keys here is my code: @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_SEARCH) { Log.d("KeyPress", "search"); return true; } return false; } Thanks in advance. 回答1: Modify your

HDMI out programming for dual screen

一个人想着一个人 提交于 2019-12-21 15:24:12
问题 In my search I found that, the Android SDK provides no support for controlling HDMI port activities and handling HDMI output, as of now. Though certain device manufacturers like Motorola (don't know if any other does that too) provide API's for a little better control. Below are the links to two of them, out of which the dual screen one (which suits my requirement pretty close) is deprecated. motorola hdmi status api motorola hdmi dual screen api Mirroring is the default behavior on

Android camera2 Lens intrinsic calibration

青春壹個敷衍的年華 提交于 2019-12-20 03:56:11
问题 I downloaded an Android camera2 demo, it ran well. Now I want to get the intrinsic matrix of the camera by querying the CameraCharacteristics. My code is private void setUpCameraOutputs(int width, int height) { Activity activity = getActivity(); CameraManager manager = (CameraManager) activity.getSystemService(Context.CAMERA_SERVICE); try { for (String cameraId : manager.getCameraIdList()) { CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraId); float[] intrinsic

Getting QualComm encoders to work via MediaCodec API

会有一股神秘感。 提交于 2019-12-18 11:43:13
问题 I am trying to do hardware encoding (avc) of NV12 stream using Android MediaCodec API. When using OMX.qcom.video.encoder.avc, resolutions 1280x720 and 640x480 work fine, while the others (i.e. 640x360, 320x240, 800x480) produce output where chroma component seems shifted (please see snapshot). I have double-checked that the input image is correct by saving it to a jpeg file. This problem only occurs on QualComm devices (i.e. Samsung Galaxy S4). Anyone has this working properly? Any additional

Android camera android.hardware.Camera deprecated

时光总嘲笑我的痴心妄想 提交于 2019-12-17 04:44:12
问题 if android.hardware.Camera is deprecated and you cannot use the variable Camera , then what would be the alternative to this? 回答1: API Documentation According to the Android developers guide for android.hardware.Camera , they state: We recommend using the new android.hardware.camera2 API for new applications. On the information page about android.hardware.camera2 , (linked above), it is stated: The android.hardware.camera2 package provides an interface to individual camera devices connected