Digipom | 4 Mar 21:22 2015
Picon

When recording from a Bluetooth mic, the recording is silently switched to the main mic when switching apps.

On a Nexus 5 running Android 5.0.1, when recording from the bluetooth mic with startBluetoothSco(), the recording switches to the phone mic if the app is switched. Please see below:

The recording is silently switched to the main input mic. SCO_AUDIO_STATE_DISCONNECTED is never received. 03-04 15:13:26.026 1453-2016/? D/audio_hw_primary﹕ out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2 03-04 15:13:26.049 1453-1997/? D/audio_hw_primary﹕ select_devices: out_snd_device(0: none) in_snd_device(32: speaker-mic) 03-04 15:13:26.049 1453-1997/? D/audio_hw_primary﹕ disable_audio_route: reset and update mixer path: audio-record bt-sco 03-04 15:13:26.061 1453-1997/? D/audio_hw_primary﹕ disable_snd_device: snd_device(44: bt-sco-mic) 03-04 15:13:26.061 1453-1997/? D/msm8974_platform﹕ platform_send_audio_calibration: sending audio calibration for snd_device(32) acdb_id(11) 03-04 15:13:26.061 1453-1997/? D/﹕ Failed to fetch the lookup information of the device 0000000B 03-04 15:13:26.061 1453-1997/? E/ACDB-LOADER﹕ Error: ACDB AudProc vol returned = -19 03-04 15:13:26.061 1453-1997/? D/audio_hw_primary﹕ enable_snd_device: snd_device(32: speaker-mic) 03-04 15:13:26.065 1453-1997/? D/audio_hw_primary﹕ enable_audio_route: apply and update mixer path: audio-record

This will also happen if the screen is switched off. Wondering if anyone has any ideas about this and preventing it, if possible?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan | 4 Mar 00:42 2015
Picon

Is Android Wear Compass Sensor reliable?

I implemented code that finds the compass direction.

It uses Sensor.TYPE_ROTATION_VECTOR.

The same code works fine (or at least, as usual) on the phone using Android 4.4.

I've tried it out on my Sony Smartwatch 3 and it works - a small minority of the time. 

I have found that if I look at the compass needle I placed on North,
Sometimes it points North.
Sometimes it points West
Sometimes it points East.
Sometimes it points South
Sometimes it points some other
Sometimes it moves When I rotate the watch. Sometimes it doesn't feel like it.

Calibrating (in other words, twisting my arm around violently), did not consistently help.

Is my experience typical?

Before I spend a lot of time trying to figure out if there is something weird with the code, I wanted to know how many have tried and are there any secrets.
Maybe I should drop the idea of apps using compass sensors if they are just going to annoy end users who will send me hate mail.
I've read things on the internet that indicate the Moto360 does not have the right sensors for compass rotation but it guesses anyway.

Besides this device, I only have experience with the Gear Live. It had some funny compass directions sometimes too. The funniest part (ha ha) was once in a while, the compass sensor, plus all other motion sensors, just stopped working at all for a week or two.
Sometimes they came back, but it happened enough that I returned that unit.
 
Nathan

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
DragonFlyJones | 3 Mar 00:21 2015
Picon

Chromium WebView not as fast as Chrome

I'm developing an HTML5 canvas app that runs well in a Chrome browser but not so well in a WebView. First, I just want to make sure that the only thing I need to do to take advantage of the Chromium WebView is set the minimum SDK to 19 (4.4)? I did that and it did improve performance of the app but it still doesn't run as fast as it does in the Chrome browser on the same device. Is this consistent with what others have seen?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
杨辉 | 1 Mar 07:51 2015
Picon

Exclude BuildConfig.class and R.class from Android library jar in Gradle

Hello, everybody:
I want to Exclude BuildConfig.class and R.class from Android library jar in Gradle,What can i do?

as i know from http://stackoverflow.com/questions/24931126/exclude-buildconfig-class-from-android-library-jar-in-gradle, android.packageBuildConfig = false is useful,but ,it was depreated in 1.0.




--
杨辉
Impossible is nothing!



------------------------------------------------------------------------------------
HDExplorer APK (A Nice File Manager,Simplicity but not simple.

Google Market:
https://market.android.com/details?id=com.hd.explorer

Google Code:
http://code.google.com/p/hdexplorer/

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tez | 27 Feb 20:54 2015
Picon

Android Accessbility, get activity name

In an accessibility service, how can I get the name of the current activity the user is interacting with?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Digipom | 26 Feb 15:24 2015
Picon

startBluetoothSco() not routing input audio through Bluetooth on Android Lollipop 5.0.1

I've been having some issues with startBluetoothSco() on my Nexus 5 on Android Lollipop 5.0.1, where startBluetoothSco() will work and my broadcast receiver will be called with an intent indicating that a Bluetooth mic is connected, but when a recording is started, the audio is recorded from the device's main input mic rather than the Bluetooth mic. This issue is also reproducible on the Nexus 7 and may affect other devices running 5.0.1 as well.

Here is some example test code:

http://pastebin.com/aEbEUhfy

Does anyone know why this is happening? The same code works fine on earlier versions of Android, and I can record from the Bluetooth mic there. On 5.0.1, I still get an intent indicating that the mic is connected, but the device will record from the on-device mic rather than the Bluetooth mic.

The sample code requires these permissions in the manifest:

    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />

The layout needs one button with android:id=" <at> +id/recordStopButton".

I also opened up this bug report: https://code.google.com/p/android/issues/detail?id=156264

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Leo | 26 Feb 03:16 2015
Picon

ImageView's setImageMatrix doesn't work properly on some devices (maybe older than Android 4.4)

I tried to move an ImageView on touch events by this code:


At first, everything worked well on Nexus 5 (Android 4.4.4 and Lollipop). But then I tried on older versions of Android like 4.0.4(Galaxy S2) or Nexus S(4.1.1)... and none of them worked.

Then after struggling for a while, I came up with this solution and it worked well on all devices:

(Notice that now, I keep track of the ImageView's matrix object by a local object instead of getting it via ImageView's getImageMatrix())

http://pastebin.com/UyrwivAh

I got the solution but I still couldn't get why my former code didn't work?!

I tried to research but the only thing made sense was the documentation of ImageView's getImageMatrix():

Return the view's optional matrix. This is applied to the view's drawable when it is drawn. If there is no matrix, this method will return an identity matrix. Do not change this matrix in place but make a copy. If you want a different matrix applied to the drawable, be sure to call setImageMatrix().

Then it made me more confused by saying Do not change this matrix in place but make a copy, what's the point of doing so? why can't I just do like I did in the former code? (get the current matrix of the ImageView then apply translation, then set it back via setImageMatrix() as the documentation says)

Someone please shed me some light, this is too much confusion for me.


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan | 25 Feb 20:54 2015
Picon

Android Wear Data Layer: Effect on Battery Life

I wanted to know if I can figure out how the usage of Data on Android Wear influences battery life.

I'm not a hardware guy, just want to know it from a software developers. I do believe Android Wear uses Bluetooth LE. (The rest is a hardware problem ;)

Are there some articles I can read on the subject?

For example, there has been some great stuff written about internet use and how it affects the power drain on an Android phone.
http://developer.android.com/training/efficient-downloads/efficient-network-access.html

For instance, I would love to know whether its better to send 5 megabytes of stuff all at once, whether it is bad to send 5K every second all day long, and so on and so forth.

I'm working on a presentation on Android Wear and battery life, and this could be part of it. But at the moment, I don't know enough on the subject, and would instead solicit feedback from the audience.

Nathan
Speaker at Wearables Tech Con.
http://www.wearablestechcon.com/
(Note use discount code 'Mellor' to save $200).

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Kristopher Micinski | 19 Feb 21:03 2015
Picon

Which pattern is most common for apps that involve communication with servers?

I am trying to get an idea of what most developers use to interact
with web services.

The two main patterns I see in apps is to either create:
  - Create an AsyncTask to make restful requests, and then do
something with `onPostExecute`, or to
  - Create a service, and then have some API between the app and the
service, perhaps backed by a database.

I would suspect that for simple cases, the first thing would suffice,
and for more advanced cases, the second might be necessary.  I was
wondering if there were any other patterns that app developers used
that I hadn't thought about,

Kris

--

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

smichak | 19 Feb 15:12 2015
Picon

VoiceInteractionService - Is there Voice Interaction support in Lollipop (21) SDK?

Hi,

I have noticed that in Android Lollipop (API Level 21) there's a VoiceInteractionService class (http://developer.android.com/reference/android/service/voice/VoiceInteractionService.html) which apparently allows an app to setup Hotword Detectors which fire a callback when a certain hotword is recognized by the VR module. Although the class is available in the SDK I don't see any guide or detailed documentation on how to use it. Digging in the AOSP code I found out that there's a system service for VR but this service is not available for arbitrary apps, just system or platform signed apps. I guess this service is used by Google Services for servicing Google Now's voice activation (a.k.a "OK Google"). If so, I can't understand why this service is available in the SDK.

Can someone from Google provide some information about this? Is there a way to add Voice Interaction the apps now or in the future? Also, if someone knows about an alternative Voice Interaction package that may be used I would be glad to hear about it.


Micha

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Miha | 19 Feb 08:49 2015
Picon

System app can not open /dev/inputX using O_RDWR

Hi!

I'm reposting this from android-platform, as there was no response. Perhaps someone here knows how to fix this?

I have a system app (signed with platform keys), and this app is injecting events. It is using uinput and tries to use /dev/input/eventN (where N is a number) as well.

If I run the code as root (i.e. with su), the code can obviously open /dev/input/eventN and can inject events in there. If the code is run from the system app, I get permission denied when opening /dev/input/eventN with open("/dev/input/event1", O_RDWR). Uinput works fine, however, even in system app.

The permissions requested by the system app are:
<uses-permission android:name="android.permission.READ_FRAME_BUFFER" tools:ignore="ProtectedPermissions"/>
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" tools:ignore="ProtectedPermissions"/>
<uses-permission android:name="android.permission.INJECT_EVENTS" tools:ignore="ProtectedPermissions"/>
<uses-permission android:name="android.permission.BIND_INPUT_METHOD" tools:ignore="ProtectedPermissions"/>


For what it's worth, this system app also reads screen (using screencap binary), and is able to do so. So it is very strange it is not able to open with r/w /dev/input/eventN.

You might wonder what's wrong with uinput if that works. The problem with uinput is that I have problems injecting touch events. Specifically, I can not "click" (tap). 
I can drag, swipe, inject keyboard events, but clicking (tapping) just does not work. It seems as if it is stuck with long press. It does not register the final event, where ABS_MT_TRACKING_ID is set to 0xffffffff.

The code I'm using for "click" (tap) is:
// pointer down 
send_event(EV_ABS, ABS_MT_SLOT, 0); 
send_event(EV_ABS, ABS_MT_TRACKING_ID, 
m_tracking_id++ % 65535); 
send_event(EV_ABS, ABS_MT_TOOL_TYPE, MT_TOOL_PEN); 

 // pointer coordinates 
send_event(EV_ABS, ABS_MT_POSITION_X, x); 
send_event(EV_ABS, ABS_MT_POSITION_Y, y); 
send_event(EV_ABS, ABS_MT_TOUCH_MAJOR, m_tracking_id % 2 ? 0x3c : 0x30); 
send_event(EV_ABS, ABS_MT_PRESSURE, m_tracking_id % 2 ? 20 : 25); 
send_event(EV_SYN, SYN_REPORT); 

 // pointer up 
send_event(EV_ABS, ABS_MT_TRACKING_ID, -1); 
send_event(EV_SYN, SYN_REPORT);

Any help or pointers greatly appreaciated.

Regards,
 Miha.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers <at> googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe <at> googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane