android-4.2-jelly-bean

How to know multiple users configured in device?

邮差的信 提交于 2021-02-19 05:57:22
问题 Android 4.2 & above supports Multiple Users as described at below link... http://developer.android.com/about/versions/android-4.2.html#MultipleUsers Now, my questions are.. Is it possible to know multiple user configured in device programmatically ? If yes, then how to get number of user configured in device ? Is it possible to get list of users ? if yes then how ? 回答1: There is a public API to get user details but it is restricted to apps which have the "android.permission.MANAGE_USERS"

how to use “Select debug app” and “wait for debugger” new feature in jelly bean?

不想你离开。 提交于 2021-02-07 11:17:22
问题 "Select debug app" and "Wait for debugger" are new feature in Jelly Bean, does someone know how to use these new features? 回答1: I found the answer here: http://developer.android.com/tools/debugging/debugging-devtools.html Lets you select the application to debug. You do not need to set this to attach a debugger, but setting this value has two effects: It will prevent Android from throwing an error if you pause on a breakpoint for a long time while debugging. It will enable you to select the

how to use “Select debug app” and “wait for debugger” new feature in jelly bean?

匆匆过客 提交于 2021-02-07 11:16:48
问题 "Select debug app" and "Wait for debugger" are new feature in Jelly Bean, does someone know how to use these new features? 回答1: I found the answer here: http://developer.android.com/tools/debugging/debugging-devtools.html Lets you select the application to debug. You do not need to set this to attach a debugger, but setting this value has two effects: It will prevent Android from throwing an error if you pause on a breakpoint for a long time while debugging. It will enable you to select the

Using Android 4.1 Keychain

孤人 提交于 2020-01-12 03:52:09
问题 I am using the Android 4.1 Keychain and the following code worked fine under 4.0 but now gives me a Nullpointer exception (Cipher can't read some internal attribute) privateKey = KeyChain.getPrivateKey(context,mAlias); byte[] data = // some biary data Cipher rsasinger = javax.crypto.Cipher.getInstance("RSA/ECB/PKCS1PADDING"); rsasinger.init(Cipher.ENCRYPT_MODE, privkey); byte[] signed_bytes = rsasinger.doFinal(data); I am handling the private key from the KeyChain as opaque and simply use it

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

蓝咒 提交于 2020-01-11 12:44:28
问题 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: [

Google Maps Api v2 Android Error

落爺英雄遲暮 提交于 2020-01-07 09:45:43
问题 only Android 5.0 work. Error by Android 5.0 lower I have installed all SDK package. Manifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.allegretti.triestebus" > <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19" /> <permission android:name="com.allegretti.triestebus.permission.MAPS_RECEIVE" android:protectionLevel="signature" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE

Overlay Status bar on android 4.2.2+

故事扮演 提交于 2020-01-01 06:33:07
问题 I want to overlay android status bar. In my case it is on top. I do not want to overlay or hide navigation bar. Note : Solution must work on android 4.2.2+. I prefer answers for non-rooted device. I have searched many SO questions and answers, but none works on 4.2.2. Below is my code, but it does not consume touch events. That's why status bar opens its panel. And I do not want this. @Override public void onCreate() { super.onCreate(); windowManager = (WindowManager) getSystemService(WINDOW

wifiLock and wakeLock not working correctly on Android

安稳与你 提交于 2019-12-29 08:48:07
问题 I am developing an app that needs to use both wifiLock and wakeLock so the audio streaming when the screen is off does not get disturbed. I have tried my app on Android 2.3 and wakeLock and looks like wifiLock work as expected so there is no difference between when the screen is on or off, but the same app on Android 4.2 (Jelly-bean) when the screen goes off is not working as well and the audio gets choppy which shows either wakeLock or wifiLock are not working correctly. Is there any reason

Failed to use systrace in Jelly Bean

試著忘記壹切 提交于 2019-12-29 08:29:08
问题 I've tried to use new systrace from jelly bean release, but with no luck. I enabled graphics and views traces in development settings like on I/O session, and tried to call systrace, and all i get is this. $ ./systrace.py error opening /sys/kernel/debug/tracing/options/overwrite: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_switch/enable: No such file or directory (2) error opening /sys/kernel/debug/tracing/events/sched/sched_wakeup/enable: No such

onConfigurationchanged is not called over jellybean(4.2.1)

情到浓时终转凉″ 提交于 2019-12-28 16:04:06
问题 I really suffer from this issue. I already set the flag android:configChanges="keyboardHidden|orientation|locale" But when I changed configuration of language, onconfigurationchanged function isn't called. The strange thing is that my codes work fine over other android platform. I searched this issue here. Someone said that I need to set sdk version lower. But it didn't work. Please give me some tips. 回答1: Add the layoutDirection attribute, such as android:configChanges="keyboardHidden