android-4.4-kitkat

Bluetooth HCI snoop log not generated

六月ゝ 毕业季﹏ 提交于 2019-11-29 00:39:30
问题 I'm running Android 4.4.2 and I enabled the "Bluetooth HCI snoop log" as described here Sniffing/logging your own Android Bluetooth traffic After turning bluetooth on and off I rebooted the phone. I could not find the log file in the expected location: $ adb pull /sdcard/btsnoop_hci.log remote object '/sdcard/btsnoop_hci.log' does not exist How can I get to the btsnoop_hci.log? 回答1: According to my experience the Bluetooth HCI snooping feature requires your device to be rooted. On my rooted

Toggle mobile data programmatically on Android 4.4.2

梦想的初衷 提交于 2019-11-28 23:19:03
问题 I've always used this code to enable mobile data programmatically: ConnectivityManager conman = (ConnectivityManager) context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE); @SuppressWarnings("rawtypes") final Class conmanClass = Class.forName(conman.getClass().getName()); final Field iConnectivityManagerField = conmanClass.getDeclaredField("mService"); iConnectivityManagerField.setAccessible(true); final Object iConnectivityManager = iConnectivityManagerField.get

Detecting when system buttons are visible while using 'immersive mode'

浪子不回头ぞ 提交于 2019-11-28 22:54:12
问题 I'm currently using immersive mode (API 19) for one of my Activities as follows: getWindow().getDecorView() .setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.INVISIBLE); This hides the system buttons and notification bar until the user swipes for them back. This works fine, however I

How To Add Media To MediaStore on Android 4.4 KitKat SD Card With Metadata

六眼飞鱼酱① 提交于 2019-11-28 22:01:51
Background: In Android 4.4, Google decided that apps should not have write access to SD cards . However, apps can write to /SDCard/Android/data/App Package Name. So this is what I've done. I have written an MP3 file to /Android/data/. I then want this MP3 file to show up in Android music players. I've tried the following... sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + filePath))); and.... MediaScannerConnection.scanFile(this, new String[] { file.toString() }, new String[] {"audio/*"}, new MediaScannerConnection.OnScanCompletedListener() { public void

Transparent GIF in Android ImageView

房东的猫 提交于 2019-11-28 21:30:08
I am trying to display the transparent GIF image in my app with no success. I can get to download and display the icon in an ImageView but with white background instead of transparent. I have already tried these solutions with no sucess: Convert GIF to PNG programatically Has anyone figured out how to display the GIF image with transparency? I am using the Android 18 SDK. Here is a workaround that has worked for me. It is not a good solution. It may not work in all cases and there is significant overhead in image processing. Hopefully someone else will find a better solution. In my testing,

How does Android determine if an app has “High Battery Use” under “Recent Location Requests”?

北慕城南 提交于 2019-11-28 20:36:22
问题 As of Kitkat (4.4) Android reports that my app is "High battery use". I use Network Location as well GPS. If I disable GPS, then it seems the app gets marked as "Low battery use". I'm wondering if there are any tips to using GPS while keeping the "Low battery use" label. Perhaps if you poll infrequently enough - or is it hardcoded to GPS = battery killer? EDIT: I understand that changing those parameters will conserve battery life. My question was more of whether Android will recognize these

Using new IMMERSIVE mode in android kitkat

最后都变了- 提交于 2019-11-28 20:26:39
I want to make an activity to go into IMMERSIVE mode and hide top and buttom system bars as soon as it starts. In developers site of android they say I should use setSystemUiVisibility() and provide SYSTEM_UI_FLAG_IMMERSIVE and SYSTEM_UI_FLAG_HIDE_NAVIGATION . How can I do this in the OnCreate() method of the activity? I think the setSystemUiVisibility is not provided in the Activity class and it should happen in a view. Is there a workaround? UPDATE ok According to doorstuck I added the following lines but I dont see any changes, navigation bar and buttom buttons are still visible : public

Android 4.4 WebView file chooser not opening?

落爺英雄遲暮 提交于 2019-11-28 20:21:44
We are creating an app which uses the webview and will access a page where the user needs to upload a file. We are experiencing problems with Android 4.4 where the file chooser does not open and clicking the upload button causes nothing to happen. This functionality works with earlier versions using the openFileChooser method like so: webview.setWebChromeClient(new WebChromeClient() { //The undocumented magic method override //Eclipse will swear at you if you try to put @Override here // For Android 3.0+ public void openFileChooser(ValueCallback<Uri> uploadMsg) { mUploadMessage = uploadMsg;

Keyboard hiding EditText when android:windowTranslucentStatus=true

馋奶兔 提交于 2019-11-28 20:11:27
We're applying the new Android KitKat translucent theme in our apps, and we're getting a weird issue when the keyboard appears. If we don't use the new android:windowTranslucentStatus attribute, all works as usual: The screen is resized, and all remains visible. But when we're using android:windowTranslucentStatus , the screen isn't resized and our EditText becomes hidden by the keyboard. A sample of the issue: The only difference between the screens is in the attribute in the style: First screen: <item name="android:windowTranslucentStatus">false</item> Second screen: <item name="android

KitKat: How to route APDUs to the SIM

。_饼干妹妹 提交于 2019-11-28 19:54:13
I want to route APDUs I get from an NFC Reader to the SIM Card. According to the HCE documentation I thought it would be possible simply by creating an OffHostApduService with the according routing-entries (which I did). Sadly, the SIM does not seem to get any APDUs. SELECT-Commands that work when the SIM is directly attached to my workstation by a SIM-Reader return with 6a82 (File not found). In LogCat I found two interesting bits of information: Every time I shoot a select command which should be routed to the SIM, I get these entries: 01-14 10:44:18.501: D/BrcmNfcJni(1009): RoutingManager: