android-6.0-marshmallow

Android (Write on external SD-Card): java.io.IOException: Permission denied

依然范特西╮ 提交于 2019-12-23 06:23:03
问题 I get a "Permission denied" error, when I want to create a file on my external SD-Card (named /storage/B9BE-18A6). I know that you have to ask for the write permission programmatically since Android M. So I inserted the solution from Arpit Patel (Android 6.0 Marshmallow. Cannot write to SD Card) I don't know why I still haven't the permissions to do it. Do you guys have another solution that I can create files on my SD-Card? Code for creating the file FloatingActionButton fab_new_file =

Image file is empty on return from activity on Android

若如初见. 提交于 2019-12-23 04:53:32
问题 Using code from this answer: https://stackoverflow.com/a/12347567/734687 I use the following code to let a user submit a picture to my Android application. private void openImageIntent() { File outputFile = null; try { outputFile = File.createTempFile("tmp", "face", getCacheDir()); } catch (IOException pE) { pE.printStackTrace(); } mOutputFileUri = Uri.fromFile(outputFile); // Camera. final List<Intent> cameraIntents = new ArrayList<Intent>(); final Intent captureIntent = new Intent(android

Intent Service not working in doze mode

落爺英雄遲暮 提交于 2019-12-23 04:08:08
问题 One of my peer developer has written an intent service that makes an API call and then sleeps for 2 mins. After waking up, it sends again. Below is the code: public class GpsTrackingService extends IntentService { .... @Override protected void onHandleIntent(Intent intent) { do{ try{ //make API call here //then go to sleep for 2 mins TimeUnit.SECONDS.sleep(120); } catch(InterruptedException ex){ ex.printStackTrace(); } } while (preferences.shouldSendGps()); //till the user can send gps. } ...

Alarm manager for background services

可紊 提交于 2019-12-23 03:35:28
问题 I have implemented the alarm manager to wake up the background services every 15 mins periodically. It is working fine, but since the inclusion of DOZE mode Android 6.0, the seems like behaving strange and not waking up in every 15 mins. Although, I am using the method alarm.setExactAndAllowWhileIdle(), but still not working in Idle state here is my method for implementing Alarm Manager private void serviceRunningBackground() { final Intent restartIntent = new Intent(this, service.class);

DatePickerDialog not working as expected

限于喜欢 提交于 2019-12-23 02:52:41
问题 I have an EditView in which I am trying to bind DatePickerDialog . Its working well with the api 19 . but when tested on api version 25 Marshmallow the calendar becomes white and when selected some date the EditView is not populated as well i.e I am unable to set date in Marshmallow . Code: warrantyExpEt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { new DatePickerDialog(getContext(), date, myCalendar .get(Calendar.YEAR), myCalendar.get(Calendar

Android M : How to open Permission Dialog even if user selects Never Ask Again ?

房东的猫 提交于 2019-12-22 10:23:28
问题 If not what is the workaround to prompt user to setting page or any other solution ? 回答1: You can't open the request permission dialog if user selects Never Ask Again. But you can show the information to user. @Override public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); switch (requestCode) { case REQUEST_CODE: if (grantResults.length > 0 && grantResults[0] ==

Where is adb in Android 6? Is it removed?

♀尐吖头ヾ 提交于 2019-12-22 07:05:06
问题 I use a terminal emulator on my mobile phone to connect to other Android devices via adb (Android Debug Bridge). The connect command is: /system/bin/adb connect 192.168.179.12 This works fine on Android 5 and below versions. But on Android 6 (Marshmallow) I get the following error: java.io.IOException: No such file or directory When I browse the file system on my Android 6 phone I cannot find adb at this path. On older Android versions I can find adb at this location. Did Google remove adb

dlopen failed: library “/system/lib64/libhwuibp.so” not found : Honor 4C 64-bit octa-core CPU

荒凉一梦 提交于 2019-12-22 06:56:35
问题 Whenever I try to open camera/gallery through intent, I am getting this error in my Honor 4C mobile, Android version 6.0 with 64-bit octa-core CPU. load: so=/system/lib64/libhwuibp.so dlopen failed: library "/system/lib64/libhwuibp.so" not found Basically I am trying to crop an image with help of OpenCV-2.4.13.1-android-sdk so file. But this error seems to be device related as in other mobiles the app is working totally fine, could anyone help me in this? 回答1: Have you tried this solution? Hi

onRequestPermissionsResult is not called back in an android activity

萝らか妹 提交于 2019-12-22 05:41:55
问题 I am trying to get the camera permission from the user before launching my camera activity. onRequestPermissionsResult is never called back after the user presses "Allow" from the permission dialog. Here is my Activity class: public class ImageCaptureActivity extends AppCompatActivity { public static final String TAG = ImageCaptureActivity.class.getSimpleName(); private static final int REQUEST_CAMERA = 0; private static final int REQUEST_CAMERA_PERMISSION = 1; private Point mSize; @Override

Android: register new PhoneAccount for telecom

和自甴很熟 提交于 2019-12-22 03:40:50
问题 I'm trying to make a new PhoneAccount to use my implementation of ConnectionService. In the documentation it says I need to register a new PhoneAccount with TelecomManager and then select it in my phone-app's settings. Here's my code: TelecomManager telecomManager = (TelecomManager) getSystemService(Context.TELECOM_SERVICE); ComponentName componentName = newComponentName("se.example.connectionservicestandalonetest", "se.example.connectionservicestandalonetest.MyConnectionService");