android-4.4-kitkat

android KitKat image Crop

末鹿安然 提交于 2019-12-02 17:35:34
问题 I am passing image url to the following method private void performCrop(Uri imageUri){ try { Intent intent = new Intent("com.android.camera.action.CROP"); // intent.setType("image/*"); intent.setDataAndType(imageUri, "image/*"); List<ResolveInfo> list = getActivity().getPackageManager().queryIntentActivities( intent, 0 ); int size = list.size(); if (size >= 0) { intent.setData(imageUri); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 0); intent.putExtra("aspectY", 0); intent

How can I detect the Android runtime (Dalvik or ART)?

和自甴很熟 提交于 2019-12-02 15:31:04
Google added a new ART runtime with Android 4.4. How can I determine whether ART or Dalvik is the current runtime? Update At least, as early as June 2014 Google has released an official documentation on how to correctly verify the current runtime in use : You can verify which runtime is in use by calling System.getProperty("java.vm.version"). If ART is in use, the property's value is "2.0.0" or higher. With that, now there is no need to go through reflection and simply check the corresponding system property: private boolean getIsArtInUse() { final String vmVersion = System.getProperty("java

Android 4.4 — Translucent status/navigation bars — fitsSystemWindows/clipToPadding don't work through fragment transactions

落爺英雄遲暮 提交于 2019-12-02 15:12:39
When using the translucent status and navigation bars from the new Android 4.4 KitKat APIs, setting fitsSystemWindows="true" and clipToPadding="false" to a ListView works initially. fitsSystemWindows="true" keeps the list under the action bar and above the navigation bar, clipToPadding="false" allows the list to scroll under the transparent navigation bar and makes the last item in the list scroll up just far enough to pass the navigation bar. However, when you replace the content with another Fragment through a FragmentTransaction the effect of fitsSystemWindows goes away and the fragment

Android 4.4 KitKat not receiving cookies

瘦欲@ 提交于 2019-12-02 14:32:53
问题 In my application I send a POST request to a server, and receive a response from the server. And from the response I gather different cookies, user information specifically. So, I send a login request and receive the cookies after the server responds, to persist the login. In Android 4.3 and below, I receive the cookies just fine and user logs in successfully. But in Android 4.4, the user logs successfully, but no cookies are being received. Has Android changed something significant for this

Java Card Applet and Host-based Card Emulation of Android Kitkat 4.4

强颜欢笑 提交于 2019-12-02 13:31:51
问题 I would like to create NFC Payment Application based on Android Kitkat 4.4 which now support the NFC Card Emulation Mode for both not involving secure element and involving secure element. I would like to let My Application involve a secure element. So, I have a question. The Android KitKat can let my application access to the java card applet which is installed into a secure element? 回答1: No, while the Android HCE documentation lists the possibility to use secure element-based card emulation

Issue with Sharedpreferences in kitkat version in android

你说的曾经没有我的故事 提交于 2019-12-02 11:45:47
Hi in my application I am accepting pass code from user and storing it in shared preferences. And, I have provided pass code on/off functionality. If user checked on , app will ask user to enter pass code at the time of launch every time and will be off on checked of Off button. Everything is working fine on android's ICS, Jellybean version and below. But it never works on Kitkat. Unfortunately, I don't have a Kitkat device to debug my app. Below is the my code I am using for shared preferences:- SharedPreferences sharedPreferences; //sharedPreferences = getActivity().getSharedPreferences(

Saving to SD card in KitKat

谁都会走 提交于 2019-12-02 11:09:06
I am working on an Android tablet application that is being used by law enforcement. I had the tablet backup all the data to an external SD card. I wanted to be able to recover data from the card in case the tablet got destroyed while the police officers were fighting crime. I used this code to store the backup: File file = new File("/mnt/extSdCard/" + NewOrLoad.directoryName + "settings.dat"); try { bW = new BufferedWriter(new FileWriter(file)); Gson gson = new Gson(); String json = gson.toJson(dreform); bW.write(json); bW.close(); } catch (IOException e) { e.printStackTrace(); }

android KitKat image Crop

允我心安 提交于 2019-12-02 08:40:10
I am passing image url to the following method private void performCrop(Uri imageUri){ try { Intent intent = new Intent("com.android.camera.action.CROP"); // intent.setType("image/*"); intent.setDataAndType(imageUri, "image/*"); List<ResolveInfo> list = getActivity().getPackageManager().queryIntentActivities( intent, 0 ); int size = list.size(); if (size >= 0) { intent.setData(imageUri); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 0); intent.putExtra("aspectY", 0); intent.putExtra("outputX", 150); intent.putExtra("outputY", 150); intent.putExtra("scale", true); intent.putExtra(

Working Directory : null environment when running Process.Builder on android

痴心易碎 提交于 2019-12-02 04:51:48
I am using two phones, Galaxy Nexus(JellyBean) and Nexus 5(KitKat). I am trying to execute a script which exists in /data/folder/scripts/run.sh I use Process.Builder to build the command. This command is built by getting Environment.getDataDirectory().toString() + "/folder/scripts/run.sh" There are no issues running this on the Galaxy Nexus but when I run it on the Nexus 5, I catch an exception when I run the process.start(). The output which I get contains: Error running exec(). Command: [/data/folder/scripts/run.sh, "param"]. Working directory: null Environment: [ADNROID_ROOT=/system ... ]

Java Card Applet and Host-based Card Emulation of Android Kitkat 4.4

送分小仙女□ 提交于 2019-12-02 04:13:43
I would like to create NFC Payment Application based on Android Kitkat 4.4 which now support the NFC Card Emulation Mode for both not involving secure element and involving secure element. I would like to let My Application involve a secure element. So, I have a question. The Android KitKat can let my application access to the java card applet which is installed into a secure element? No, while the Android HCE documentation lists the possibility to use secure element-based card emulation, there are several problems hindering the use of a secure element in current devices: Nexus devices have a