android-4.2-jelly-bean
Android OS bug with some devices running Jelly Bean/4.2.1 – TextView.setError(CharSequence error) Missing icon
Temporary Solution! EditTextErrorFixed.java While this is indeed an SDK bug, I’ve managed to use reflection methods to get the icon to work as intended. I checked that it works with both 4.2 and 4.2.1 and verified that it works on my updated Galaxy Nexus. The source can be found here. The screenshot shows that the … Read more
java.lang.SecurityException: Requires VIBRATE permission on Jelly Bean 4.2
I got the same Exception in Jelly Bean 4.1.2, then following changes I made to resolve this 1.added permission in manifest file. <uses-permission android:name=”android.permission.VIBRATE”></uses-permission> 2.Notification Composing covered by Try-Catch try { mNotificationManager = (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder( this) .setSmallIcon(R.drawable.ic_notif_alert) .setContentTitle(getResources().getString(R.string.app_name)) .setStyle(new NotificationCompat.BigTextStyle().bigText(msg)) .setContentText(msg) .setStyle(bigTextStyle) .setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE); mBuilder.setAutoCancel(true); mBuilder.setContentIntent(contentIntent); mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build()); Log.d(TAG, … Read more
How to encode Bitmaps into a video using MediaCodec?
I have modified the code provided by abalta to accept bitmaps in realtime (ie you don’t already need to have the bitmaps saved to disc). It also has a performance improvement since you don’t need to write then read the bitmaps from disc. I also increased the TIMEOUT_USEC from the original example which fixed some … Read more
How to hide the soft-key bar on Android phone?
I know its late but it is the right answer so what you are trying to do is what called immersive mode. for (API 19) check out: https://developer.android.com/training/system-ui/immersive.html The code that you were asking for is: @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); if (hasFocus) { 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 | … Read more
Handling the missing MENU button in new versions of Android (3.x and up)
Let me share another scenario where Menu Button becomes critical even though it is not a game. I have app implement its own tool bars which behave to some extent like ActionBar. Well I did that coz my app was released with 1.5 sdk. At that time there is no such concept. And to accomodate … Read more
Questions about Google Play application assets encryption
(Mumble, mumble, shrug, /me just sayin’ …) Personally (a-n-d… from the point-of-view of someone who has somehow managed to make money from a commercial application for 23 years and counting …), I would be FAR(!) more concerned about this: Users who have previously installed problematic apps will need to uninstall and then re-download them … … Read more
Android WebView JellyBean -> Should not happen: no rect-based-test nodes found
The issue occurs because in some scenarios WebView fails to notice that its visible rect has changed, so as far as webkit is concerned the page is still not visible. Thus all touches fall outside of the window, and get rejected. The cleanest fix is when you know the visibility of your WebView has changed … Read more
Apply effect to video frame captured by camera
you can make the parameter of camera, and then apply colorfilter to the parameter to get the different effect, but first you have to check the supported colorfilter for your device, basically it is device dependent. Camera.Parameters p = camera.getParameters(); camera.Parameters parameters = camera.getParameters(); //this will provide the supporting parameter for your device. p.setSceneMode(Camera.Parameters.FLASH_MODE_AUTO); //it … Read more
Android Speech Recognition as a service on Android 4.1 & 4.2
This is a work around for android version 4.1.1. public class MyService extends Service { protected AudioManager mAudioManager; protected SpeechRecognizer mSpeechRecognizer; protected Intent mSpeechRecognizerIntent; protected final Messenger mServerMessenger = new Messenger(new IncomingHandler(this)); protected boolean mIsListening; protected volatile boolean mIsCountDownOn; private boolean mIsStreamSolo; static final int MSG_RECOGNIZER_START_LISTENING = 1; static final int MSG_RECOGNIZER_CANCEL = 2; @Override … Read more