example of AlwaysOnHotwordDetector in Android

Unless I have a huge blind spot, I don’t think third-party applications can make use of this API. Its strange that AlwaysOnHotwordDetector (and related classes VoiceInteractionService etc.) have been granted public access. If you are building a privileged app, look through these test projects from AOSP: Voice Interaction – Basic AlwaysOnHotwordDetector usage/implementation http://androidxref.com/5.0.0_r2/xref/frameworks/base/tests/VoiceInteraction/ Voice Enrollment … Read more

Android 5.0 JobScheduler API on earlier versions?

Another option is this library: https://github.com/evernote/android-job It uses the JobScheduler and GcmNetworkManager if possible. Otherwise it fallbacks to the AlarmManager. It also handles different API levels with the AlarmManager properly. This blog post gives you an overview. (PS: I’m the main developer who worked on this library at Evernote. It’s useful for our projects, that’s … Read more

How to use RippleDrawable programmatically in code (not xml) with Android 5.0 Lollipop?

This is how I was able to achieve this. Note that this is Api 21+ only so you will have to fallback to a normal Drawable if you support lower versions. public static RippleDrawable getPressedColorRippleDrawable(int normalColor, int pressedColor) { return new RippleDrawable(getPressedColorSelector(normalColor, pressedColor), getColorDrawableFromColor(normalColor), null); } public static ColorStateList getPressedColorSelector(int normalColor, int pressedColor) { return … Read more

Indeterminate circle progress bar on android is white, despite colorAccent color

Note: This only works from Android 5.0 (Lollipop) and up, as per the original request. For older Android versions you’ll have to replace the ProgressBar’s progressDrawable. Expanding upon Liam’s answer, I managed to get this working on XML using the indeterminateTint flag. Apparently to get it to work, you need to set the indeterminate and … Read more

Dialog buttons with long text not wrapping / squeezed out – material theme on android 5.0 lollipop

This could be fixed with using stacked buttons instead of row buttons. Here my workaround how it could be achieved with using AppCompat lib : Code import android.support.v7.app.AlertDialog; AlertDialog.Builder builder; builder = new AlertDialog.Builder(context, R.style.StackedAlertDialogStyle); builder.setTitle(“Title”); builder.setMessage(“Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dignissim purus eget gravida mollis. Integer in auctor turpis. Morbi … Read more

HAXM and Lollipop

I had the same issue when creating a Nexus 6 AVD with an x86_64 image and it appears the HAXM does not support that on an old Core 2 Duo (Mac Book Pro late 2009 for example). This is specified in the Release note known issues in $ANDROID_SDK_HOME/extras/intel/Hardware_Accelerated_Execution_Manager. HAXM driver does not support emulating a … Read more

Android 4.4 translucent Status and Navigation bars style on Android 5.0

Set android:windowTranslucentStatus to false and set android:statusBarColor to @android:color/transparent. Then add code below: getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); If you also want the navigation bar to be translucent, set android:navigationBarColor to @android:color/transparent and combine the flag View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION as well. I didn’t experiment on the navigation bar but it will work.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)