android-developer-api

Install Apps from unknown sources inside work profile in Android Lollipop 5.0.1

孤街浪徒 提交于 2019-12-06 04:38:34
Question is related to Work Profile in " Android for work " . I have written a sample app that creates a managed work profile and sets itself as the profile owner . I will need to push some enterprise applications through the profile owner . So when i try to install , it says "Install blocked" , Cannot install from unknown sources . If i toggle the button ( Setting->security->Unknown Source ) on and off , settings are not getting reflected in the work profile. Is there a way to install the apps in work profile from unknown sources ? Perhaps it could be resolved with future updates, but as of

App crashes with SecurityException on Android M [duplicate]

≯℡__Kan透↙ 提交于 2019-12-06 03:36:07
This question already has answers here : Android 6.0 Permission Error (5 answers) Closed 4 years ago . Yesterday I set upped target and compile sdk to 23 API level. When I launched the app on Nexus 9 with Preview Android M (MPA441) the app crashes with following SecurityException : FATAL EXCEPTION: main Process: com.grouplogic.mobilecho, PID: 22554 java.lang.RuntimeException: Unable to create application com.mypackage.MyApplication: java.lang.SecurityException: getDeviceId: Neither user 10098 nor current process has android.permission.READ_PHONE_STATE. at android.app.ActivityThread

Android Lollipop becoming device admininistrator doesn't work

旧时模样 提交于 2019-12-05 09:09:54
I'm following this guide on how to have my app request to become a device administrator. This works great on any 4.x android versions with any phone, but doesn't work on Lollipop (I've tried on a Nexus 5 and on a Nexus 7). Logcat shoes the following error: *11-02 07:37:09.649: W/DeviceAdminAdd(10020): Cannot start ADD_DEVICE_ADMIN as a new task* Has anyone else come across this problem with Lollipop? What can be the cause? I've gone over all parts of the guide and made sure my XML, menifest, receiver, etc. are all as they should be (and again, it does work on any other version of OS or phone I

How to enable Non market application in Managed Profile (Android 5.0) programmatically

自闭症网瘾萝莉.ら 提交于 2019-12-05 01:24:23
问题 Hello I was checking Android 5.0 samples there was sample BasicManagedProfile. Using that I have created managed profile successfully. But it was managing only Market applications (Downloaded from Google Play) as managed application. But I tried with custom say it HelloWOrld application that is not available on Market. It gave me the error " java.lang.IllegalArgumentException: Only system apps can be enabled this way ." devicePolicyManager.enableSystemApp( BasicDeviceAdminReceiver

How do I display a list of all MIME types supported by a given Android device?

放肆的年华 提交于 2019-12-04 20:15:00
I'm trying to displaying a device supported format programmatically. i have found this on the internet. the question is, how to display those ? please help me, im newbie in Android development. Here is the code for checking file format of the device. package com.android.mmscommon; import java.util.ArrayList; public class ContentType { public static final String MMS_MESSAGE = "application/vnd.wap.mms-message"; // The phony content type for generic PDUs (e.g. ReadOrig.ind, // Notification.ind, Delivery.ind). public static final String MMS_GENERIC = "application/vnd.wap.mms-generic"; public

Phone Selector API fails to get phone numbers

安稳与你 提交于 2019-12-03 21:48:24
I need help in phone selector API (Eg. Tez/PhonePe/Bhim) . Referred this blog https://android-developers.googleblog.com/2017/10/effective-phone-number-verification.html . When am I trying to get phone numbers, which results empty dialog and disabled immediately. Please suggest me like how to get phone number without permissions. I implemented this feature in my android application. Check this: First, Open build.gradle inside your app module and add: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0' implementation

How to enable Non market application in Managed Profile (Android 5.0) programmatically

六月ゝ 毕业季﹏ 提交于 2019-12-03 15:39:09
Hello I was checking Android 5.0 samples there was sample BasicManagedProfile. Using that I have created managed profile successfully. But it was managing only Market applications (Downloaded from Google Play) as managed application. But I tried with custom say it HelloWOrld application that is not available on Market. It gave me the error " java.lang.IllegalArgumentException: Only system apps can be enabled this way ." devicePolicyManager.enableSystemApp( BasicDeviceAdminReceiver.getComponentName(activity), packageName); code that i was using to enable application. Is there any way or API to

Android application crash immediately after starting

一个人想着一个人 提交于 2019-12-02 23:35:48
问题 Here is the stack trace: 06/26 15:42:08: Launching app $ adb shell am start -n "com.virtual.ai/com.virtual.ai.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Waiting for process to come online Connected to process 19346 on device oneplus-oneplus_a6010-eb048141 Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. I/m.Karbi.chonan: The

Unable to resolve all dependencies in android studio 3.0.1

只谈情不闲聊 提交于 2019-12-02 08:53:07
Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0. Could not resolve com.android.support:appcompat-v7:26.1.0. Required by: project :app No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode. Error:Could not resolve all files for configuration ':app:debugCompileClasspath'. Could not resolve com.android.support:appcompat-v7:26.1.0. Required by: project :app No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode. No cached version of com.android.support

Android application crash immediately after starting

倾然丶 夕夏残阳落幕 提交于 2019-12-02 07:29:49
Here is the stack trace: 06/26 15:42:08: Launching app $ adb shell am start -n "com.virtual.ai/com.virtual.ai.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Waiting for process to come online Connected to process 19346 on device oneplus-oneplus_a6010-eb048141 Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. I/m.Karbi.chonan: The ClassLoaderContext is a special shared library. W/ActivityThread: Application com.virtual.ai can be debugged