android-4.4-kitkat

Making successful Bluetooth connections in Android

我的梦境 提交于 2019-12-05 18:37:04
I am mystified by two approaches to making BT connections in Android. This is what I have done for as long as I can remember, and it has worked from 2.3+ devices to early 4.x. This what the Android docs describe as well. private static final UUID sppUUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"); bluetoothSocket = bluetoothDevice.createRfcommSocketToServiceRecord(sppUUID); bluetoothSocket.connect(); This has ceased to work on some newer Androids (Nexus 7 running 4.4), Cyanogenmod with this result (or similar): java.io.IOException: read failed, socket might closed or timeout,

Receive MMS messages in Android KitKat

拥有回忆 提交于 2019-12-05 16:39:47
So this video Android 4.4 SMS APIs from #DevBytes explains the recent changes to the SMS APIs in KitKat. They also provide a link with a sample project. http://goo.gl/uQ3Nih They suggest that you handle the receive of an MMS in a service. Which all looks fine, except they neglect to mention the most undocumented piece. How to actually handle an incoming MMS. Here is the sample from the project https://gist.github.com/lawloretienne/8970938 I have tried to "handle the MMS" https://gist.github.com/lawloretienne/8971050 I can get the extras from the intent but the only meaningful thing that I can

How to completely exit from Immersive full screen mode?

梦想的初衷 提交于 2019-12-05 16:09:23
问题 I would like to implement a button to enable/disable the immersive full screen mode. I'm using those methods but the showSystemUI only shows quickly and hide again... How to completely exit from immersive mode? My methods: // This snippet hides the system bars. @SuppressLint("NewApi") private void hideSystemUI() { try{ // Set the IMMERSIVE flag. // Set the content to appear under the system bars so that the content // doesn't resize when the system bars hide and show. mDecorView

Any way to disable/override the mutitask button on Galaxy Tab 4? [duplicate]

戏子无情 提交于 2019-12-05 14:14:09
This question already has answers here : How to disable the Recent Tasks/Apps button (5 answers) Closed 3 years ago . We have an industrial control app we write and ship pre-loaded on Samsung Galaxy Tablets with our manufacturing products. The tablets we were using were Tab 10's which ran Honeycomb, but we can't get enough of those to OEM anymore so we're switching to Tab 4's which run KitKat. The new tablets have a button which looks like the old menu button - two overlapping rectangles - but it's different functionality - it's called the "multi-task" button and it brings up a task-switcher

Unable to execute initial Android Wear Hello World App in eclipse

做~自己de王妃 提交于 2019-12-05 10:50:52
After intial Eclipse Luna setup when I try to run the intial Hello World app in the Android Wear emulator, its getting stopped showing "You cannot combine swipe dismissal and the action bar" error in logcat.Please help me to solve this issue. I had the same problem yesterday. I solved it by running the application in full screen mode, I do not think this is the best solution, but it worked, although this does not have the action bar. In you onCreate method add this before the setContentView. requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG

Stop SMS from moving to Inbox

倖福魔咒の 提交于 2019-12-05 10:49:55
Before Android 4.4 I was able to stop messages from moving to inbox by setting the priority like this <receiver android:name="com.serviceschedular.helperClasses.SmsReceiver" > <intent-filter android:priority="1000"> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> and then abortBroadcast() in onRecieve() messages. However in Android 4.4 we need to define SMS_DELIVER_ACTION in order to make our messaging app as default : Getting Your SMS Apps Ready for KitKat By doing this I can receive messages first and they don't move to any other messaging app

How can one use ViewPropertyAnimator to set Width to a specific value

别说谁变了你拦得住时间么 提交于 2019-12-05 10:33:46
How can I use ViewPropertyAnimator to set my view width? I can scale or translate (see below) but I can't set to a specific width. frame_1.animate().scaleX(5).scaleY(5).start(); but there is no frame_1.animate().width(1024).height(768).start(); Try this, support even from Android 2.3: ValueAnimatorCompat exitAnimator = AnimatorCompatHelper.emptyValueAnimator(); exitAnimator.setDuration(TransitCompat.ANIM_DURATION * 4); exitAnimator.addUpdateListener(new AnimatorUpdateListenerCompat() { private float oldWidth = view.getWidth(); private float endWidth = 0; private float oldHeight = view

Power button click now calls onStop in Activity on Android KitKat, previously was just onPause?

早过忘川 提交于 2019-12-05 09:18:04
So I just realized that onStop is getting called in my Activity when the power button is clicked to turn off the screen. Previously only onPause was called. Was this a KitKat change and are there notes about it anywhere (was it intentional)? Is this a KitKat change or something that specific manufacturers implemented? EDIT: I'll be updating this soon with more info . I think the change was more subtle than I first realized, possibly due to me holding a partial wake lock or listening for GPS updates. Regardless, all I know is that in my code, prior to KitKat, onStop was not called when the

Bug with Android 4.3 ImageView method getImageMatrix()

时光总嘲笑我的痴心妄想 提交于 2019-12-05 06:48:20
I recently upgraded to Android 4.4 and someone of the features of my app have surprisingly stopped working. I have this code for initializing and then drawing my custom view. The basic idea is it adjusts the zoom level so the entire view fits on the screen. private void initAtZoomLevel(float zoomLevel){ .... Matrix transformMatrix = new Matrix(); transformMatrix.setScale(initialZoomLevel, initialZoomLevel); float yTransCenter = (screenHeight - mapHeight)/2.0f; setImageMatrix(transformMatrix); } protected void onDraw(Canvas canvas){ super.onDraw(canvas); float[] values = new float[9];

android camera and gallery not working in nexus 5

[亡魂溺海] 提交于 2019-12-05 06:09:29
问题 In my application I use camera and gallery to upload the selected image to server. it's working fine till 4.4.2, but in 4.4.4 nexus5 both camera and gallery don't work. my camera part is in a Fragment .If I try to take a photo using the camera or pick a photo using the gallery I get "please retry" message as per my code. camera action code: String path = Environment.getExternalStorageDirectory() + "/appname"; File photopath = new File(path); if (!photopath.exists()) { photopath.mkdir(); } try