android-hardware

How to simulate hardware media control buttons on an Android emulator

别说谁变了你拦得住时间么 提交于 2019-12-05 16:47:09
问题 Android supports hardware play / pause buttons on headsets and attached devices. I am trying to find a way to test support for those devices on an emulator. The Android documentation talks about how to add support for hardware playback controls, but, unfortunately, I can't find documentation of how to emulate them. Thanks! 回答1: You can send keyevents using adb adb shell input keyevent <keycode> keycode for play - 126, pause - 85 (see KeyEvent) 回答2: There is another way to do this, from an

Retrieve Android Device Manufactured date Programmatically?

我们两清 提交于 2019-12-05 12:02:41
I need to find the Android Device manufactured Date through my code I have gone through the android.os.Build API But Didn't find such a method is possible to get Android Device Manufactured Date or Not? RussVirtuoso You can use Log.i("ManuFacturer :", Build.MANUFACTURER); Log.i("Board : ", Build.BOARD); Log.i("Diaply : ", Build.DISPLAY); Here is the documentations of that: http://developer.android.com/reference/android/os/Build.html You can get the date the OS was installed. Date osInstalledDate = new Date(Build.TIME); Log.i("MW", "time from Build.TIME = " + osInstalledDate .toString());

Android O HIDL not available

徘徊边缘 提交于 2019-12-05 07:24:33
I have problem with Android O HIDL. The failure log shows it can't find out the service. However I can see it by adb shell ps -A | grep fingerprint system 18758 1 17408 3276 pipe_wait 7c79e93e08 R android.hardware.biometrics.fingerprint@2.1-service` Could anyone give me a hint how to solve the problem? I checked https://source.android.com/devices/architecture/hidl/ but could not get the solution. Error log: 08-21 06:00:35.864 1890 2264 V FingerprintService: mDeamon was null, reconnect to fingerprint 08-21 06:00:35.864 1890 2264 I system_server: Looking for service android.hardware.biometrics

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

心不动则不痛 提交于 2019-12-05 04:34:35
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? Wei WANG 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 disabled in imageView in your case, while setting android:hardwareAccelerated="false" will disable hw

Phone light Turn On when incoming call come

不羁岁月 提交于 2019-12-04 15:28:59
I got incoming call and working well. But when my screen is turn off and an incoming call is come. Then my screen light is not on . I am using this code in onCreate():- getWindow().addFlags( WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED ); PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "My Tag"); wl.acquire(); Also when my screen light ON and an incoming call come then my connection with server is successful. But when my screen light OFF and

Set mouse position in software

百般思念 提交于 2019-12-03 12:22:46
I am using an Android Stick ( http://www.geekbuying.com/item/Uhost-2-Dual-Core-TV-Box-Mini-PC-Android-4-0-4-RK3066-Cortex-A9-1-6GHZ-1GB-RAM-4G-ROM-with-Bluetooth-WIFI-Skype-XBMC---Black-312467.html ) for building an application. The application uses an attached USB webcam for some of it's functionality. Additionally, I connect a mouse to this device which the user can use to navigate through various pages in the application. A left/right movement of the mouse results in navigation to previous/next page. While the mouse works with the Android device, I additionally require to reset the position

Turn on hardware acceleration if available (such Android 3+) with Android APK 2.2

情到浓时终转凉″ 提交于 2019-12-03 07:06:28
问题 I developed a application for Android 3.0, and it's runs perfectly well, but the client insist on compatibility with 2.2 devices. Disabling hardware acceleration, using Android Compatibility Package, a NIO-backport support (For tasks and executors) and some reimplementation of View methods I was able to port my app for Android 2.2 and works really good, but if I run this apk into a newer device the performance is extremely slowly, so I want to know how to turn on hardware acceleration if

Camera.PreviewCallback equivalent in Camera2 API

独自空忆成欢 提交于 2019-12-03 00:17:08
Is there any equivalent for Camera.PreviewCallback in Camera2 from API 21,better than mapping to a SurfaceTexture and pulling a Bitmap ? I need to be able to pull preview data off of the camera as YUV? EmcLIFT You can start from the Camera2Basic sample code from Google. You need to add the surface of the ImageReader as a target to the preview capture request: //set up a CaptureRequest.Builder with the output Surface mPreviewRequestBuilder = mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); mPreviewRequestBuilder.addTarget(surface); mPreviewRequestBuilder.addTarget(mImageReader

Turn on hardware acceleration if available (such Android 3+) with Android APK 2.2

随声附和 提交于 2019-12-02 21:51:15
I developed a application for Android 3.0, and it's runs perfectly well, but the client insist on compatibility with 2.2 devices. Disabling hardware acceleration, using Android Compatibility Package, a NIO-backport support (For tasks and executors) and some reimplementation of View methods I was able to port my app for Android 2.2 and works really good, but if I run this apk into a newer device the performance is extremely slowly, so I want to know how to turn on hardware acceleration if available but still uses my 2.2 APK. Add android:hardwareAccelerated="true" to your manifest, either for

How to make android phone flashlight blink?

风格不统一 提交于 2019-12-02 07:51:00
问题 I am trying to make the LED flashlight of android phone blink based on binary code like if char = 1 turn LED light on else if char = 0 turn LED off. if ( char == '1'){ params.setFlashMode(Parameters.FLASH_MODE_ON); } if ( char == '0'){ params.setFlashMode(Parameters.FLASH_MODE_OFF);} So I get the char from a String str ="101010101" the char gets the values 1, 0, 1 and so on, which is supposed to make the flashlight blink, however it blinks ones and that's it. How should I fix this problem?.