Can't Debug in Android Studio - Xiaomi Redmi Note 4 Questions & Answers

Hi,I have a Redmi note 4X (Qualcomm) running ANdroid 7.0 with MIUI 8.5.4.0.
The problem is I cant Debug APPLICATIONS in Android Studio. It just doesn't show critical information in LOGCAT.
I have already Enable DEVELOPER OPTION.
I have turned OFF "MIUI OPTIMIZATION"
also turned on "USB debugging", "Install via USB" and 'USB debugging(security settings)"
please help me to solve my problem.
My problem is when I am debugging Applications in Android Studio it just clears the LOGCAT without any info when Facing Exceptions and Errors.

Hello!
I had the same problem with logging. Found this solution:
1. Developer options -> Logging buffer size
2. Choose any option exept "OFF"
Hope this 'll help.

had the same problem, but i actually switched to aosp based roms so as to get a wider support base for the apps i devlop. (whats this do you ask? miui has many modified elements of aosp, and many times many features or functions i wanted to execute were not performed, like many times executing shell commands with su from code resulted in lag and device being unresponsive) So from a fellow devloper, i request you to make a switch to some aosp rom, if possbile so as to get a better experience [and less bullsh*ttry] while executing debugging tasks.

Related

[Q] MK812 - how enable multiple users switching

I bought this nice minicomputer - MK812 Mini PC Dual-Core Android Camera Mic BT 4.2.1 and I relied on the fact that since there is Android 4.2 installed, I can use switching users, but unfortunately this function is disabled. I need to get it to work.
Of course, I googled. This is what I've already tried:
http://www.pocketables.com/2013/03/how-to-enable-multiple-user-mode-on-cyanogenmod-10-1-and-some-other-android-4-2-2-roms.html
The problem is that this command pm get-max-users returns Unknown command get-max-users.
Furthermore, when I enter SetProp fw.max_users 8, it has no effect, even after a reboot. The command pm usernameyouwanthere create-user is also without effect.
http://forum.xda-developers.com/showthread.php?t=2187934
App - 4.2 Multiple users feature enabler
This app can't be installed by Google Play (apparently MK812 is not a compatible device). Since I couldn't get APK anywhere to download, I downloaded the source code and compiled it and generated APK. Unfortunately, can't be installed either.
I studied the source code and found out that even if i was able to get it installed, it wouldn't have worked anyway, because this app runs similar commands (as those above) instead of the user.
https://play.google.com/store/apps/details?id=fahrbot.apps.switchme
This could be a solution even for Android 4.0 and 4.1. It works, but switching takes too long, because it requires a reboot and this switching is not integrated into the system. So I do not want it.
Do you know of any other solution or anything what I could try?
I googled again, found this - http://forum.xda-developers.com/showpost.php?p=34362377&postcount=8
But setting fw.max_users=8 in /system/build.prop haven't helped either.
Unfortunatelly they answer me, that MK812 mini pc does not support multiple user function. So I have to use SwitchMe Multiple Accounts
H0w4rd said:
Unfortunatelly they answer me, that MK812 mini pc does not support multiple user function. So I have to use SwitchMe Multiple Accounts
Click to expand...
Click to collapse
try
"setprop fw.max_users 8"
Lower-Case setprop without the quotes.
Edit: I see, can you and are you willing to get the source, modify it, build it and flash it? I'm going to have to enable it for my phone so when I figure out what needs modifying I'll let u know.

Missing Developer Options Setting? Help please!

Apologize in advance for the noob struggle but I searched the forums for this and found nothing.
I am a new owner of a Tablet Z, love it but want to make Chrome behave like a desktop browser by default. Have found many places to describe how to do this but they all rely on ADB. ADB relies on USB debugging being turned on. All directions call for going to "Settings->Developer Options" and turnign on USB debugging. However on my Xperia Tablet Z (SW version is Android 4.3 build 10.4.1.B.0.109 if that helps) there is NO "Developer Options" anywhere in the Settings list. I have patiently gone through every option on the device and it plain does not exist. Do I need to boot in some special mode to see it?
maypo said:
Apologize in advance for the noob struggle but I searched the forums for this and found nothing.
I am a new owner of a Tablet Z, love it but want to make Chrome behave like a desktop browser by default. Have found many places to describe how to do this but they all rely on ADB. ADB relies on USB debugging being turned on. All directions call for going to "Settings->Developer Options" and turnign on USB debugging. However on my Xperia Tablet Z (SW version is Android 4.3 build 10.4.1.B.0.109 if that helps) there is NO "Developer Options" anywhere in the Settings list. I have patiently gone through every option on the device and it plain does not exist. Do I need to boot in some special mode to see it?
Click to expand...
Click to collapse
multiple tap on the Build number under the about tablet will bring the developer options ....
MikeViller said:
multiple tap on the Build number under the about tablet will bring the developer options ....
Click to expand...
Click to collapse
Thank you! Holy cow how mysterious can you get.
At any rate, that worked but now when I try to actually download the chrome command line text file to the root filesystem using adb I don't have permissions to do the copy. I get:
c:\Android-SDK\sdk\platform-tools>adb push /chrome-command-line /data/local/chrome-command-line
failed to copy '/chrome-command-line' to '/data/local/chrome-command-line': Permission denied
Anyone know how to modify permissions so ADB will be able to perform this copy?

Nubia Z18 (NX606J) - Mirroring through miracast

Hello all,
Mirroring through miracast works fine now! I managed to fix the issue I faced with trying to mirror the phone with miracast.
The phone I bought from China came with apparently some manually altered rom. It didn't have much of the bloatware of the Nubia stock firmware. Also, it did not come with the "screen projection" app of Nubia. This app seems to be integrated into the phone. I couldn't find any .apk of it online. I tried a bunch of different apps, none worked. Also, factory resets, did not reinstall that app either.
The solution was simple. I used TWRP to wipe the phone and install the latest (v2.23) rom from the official nubia website: http://ui.nubia.cn/rom/detail/56
After installing it, the app was there and worked instantly.
At the moment now I have some issues with TWRP. I will fix it and see if the build.prop presisted through all of this, I doubt it.
If it did, and any changes are still required, I will update the post.
Kind regards,
Rup7ur3
---- initial post ----
Dear folks,
I'm trying to fix miracast on the Nubia Z18 (NX606J). Currently when I try mirror with the use of wi-fi direct, it doesn't show the miracast dongle I use (anycast).
I've not any experience in this and am trying to google for solutions. Online I have found some answers, but it's not yet working.
Hopefully I'm on the right path, but if anyone can help, it's greatly appreciated.
Why
The reason I want to use miracast, is to stream content to a portable display without the use of internet (so by cable or with WIDI). I don't think this phone supports hdmi/display port. If someone manages to get mirroring to work over cable, please let me know. As for WIDI, I think miracast is the only option? So, my bets are on this horse and I'm trying to make it run. Also, I'm new to this forum. If I post this at the wrong place, please forgive me. I created this thread for this specific model, because the manufacturer, Nubia, creates it's own (quite elaborate) UI on top of stock android. I suspect this could be part of the issue.
Summary so far
What I tried so far, is to install the custom recovery image of TWRP on my smartphone and adb + drivers on my windows 10 pc. Next I used the "mount" option in TWRP to enable adjustments of system files. The file I changed is the /system/build.prop file. I pulled the file using adb commands. Then changed the file on my pc and pushed it back to the phone. I will describe it in detail below. Yet, the sad thing is: it does not work. On another, older, model of the Nubia Z line, the Z9 mini, it did work.
Details
I installed drivers & adb/fastboot and twrp.
TWRP: https://forum.xda-developers.com/nubia-z18/development/recovery-twrp-nubia-z18nx606j-t3882098
Drivers & adb/fastboot: https://bbs.app.nubia.cn/forum.php?mod=viewthread&tid=1412934 (in chrome download didnt start for me, had to use firefox)
Once the above were installed, I connected my phone with the pc. I put phone settings in developer options to enable usb debugging. I got a notification to let my pc debug the phone, and accepted. Next I enabled "wireless display certification", "OEM unlocking" and set usb configuration to "MTP" instead of charging.
The adb on my pc was installed on my C:\adb\ folder. In the folder hold shift & right click, select open powershell or adb. I checked if my phone was connected using "adb devices". It listed my phone. So I went on and put it in fastboot mode (hold power + decrease volume). I checked if adb recognized fastboot with "fastboot devices". It listed my phone. Then next I unlocked the phone and installed TWRP with the help of this guide, from step 2 onwards: https://bbs.app.nubia.cn/forum.php?mod=viewthread&tid=1412934
Once TWRP installed. I created a backup of the phone through there. Then I selected the tab "mount" and enabled the system folder. Back to adb, I ran the command "adb devices" to see if my phone was listed, it was. Then I ran the command "adb pull /system/build.prop" that copied the build.prop file to my c:\adb folder. I made a reserve copy of the file and adjusted it with notepad++. These are the lines I added or enabled:
ro.hdmi.enable=true
ro.hdmi.mirror.enable=true
persist.adb.notify=0
net.tethering.noprovisioning=true
persist.debug.wfd.enable=1
persist.sys.wfd.virtual=0
Click to expand...
Click to collapse
Then I pushed it back with the adb command: "adb push build.prop /system/build.prop". Rebooted the phone, tested the mirroring option, no luck. The phone runs on android 8.1.0, has the nubia V6.0 UI and the build number is NX606J_CNCommonV2.23. Any app whatsoever with a miracast option, will redirect to the system miracast settings. The following screen will appear: https://imgur.com/a/Otf1YO0
The Struggle
I read online several forums where they claimed that setting these was helping other phones to enable miracast. For the Z18 it did not work. I tried this with the Nubia Z9 mini. Miracast did not work on there before, now it does. The build.prop seems to persist fine now. For some reason, the first few attempts (attempt 1 & 2) wiped TWRP and the adjustments on the build.prop. Third time it kept working. TWRP however, still is wiped after a few reboots, but the build.prop file remains intact with the changes I made.
The Nubia Z9 mini has a few stock apps: "screen projection", "screen projection services" and "projection sink". It loads the screen projection app and allows to chose from project/receive and works flawlessly after the build.prop changes. The Z9 mini runs on android 5.1.1 and as Nubia UI V4.0 with build number: NX511J_INCommon_V4.0.4.
I read online that:
Miracast is available on Android devices with Android 4.2 Jelly Bean
Click to expand...
Click to collapse
and
no more supported by Android since 6.0
Click to expand...
Click to collapse
Yet, I've seen people make it work, by adjusting the build.prop, for later versions also. Not seen one working with android 8.0 or 8.1. Is it impossible for some reason / a hardware thing? If it's a software issue, surely it can be overcome?
I found that the build.prop in the Z9 mini contained the following lines:
#property to enable VDS WFD solution
persist.hwc.enable_vds=1
# Add by ztemt for ZWfd begin
#property to set wfd output resolution is 1080P(0) / 720P(1) / 960*540(2) / 800*480(3)
persist.sys.wfd.zte_resolution=0
#property to show wfd sink false(0) / true(1)
persist.sys.wfd.zsink_support=1
#property this is device support wfd 1080p output support(true) not support(false)
persist.sys.wfd.1080p_support=false
# Add by ztemt for ZWfd end
Click to expand...
Click to collapse
I believe it's coupled to those apps I mentioned screen projection apps which are on the z9 mini. It had no effect adding these on the Z18. Now I'm attempting to find those apps and install them on Z18. Or looking for ways to downgrade the Z18 to android 5x. Ideally I do not want to downgrade the android. Any help, advice or questions are greatly appreciated.
rup7ur3 said:
Dear folks,
I'm trying to fix miracast on the Nubia Z18 (NX606J). I've not any experience in this and am trying to google for solutions.
I have found some answers, but it's not yet working. Hopefully I'm on the right path, but if anyone can help, it's greatly appreciated.
Why
The reason I want to use miracast, is to stream content to a portable display without the use of internet (so by cable or with WIDI). I don't think this phone supports hdmi/display port. If someone manages to get mirroring to work over cable, please let me know. As for WIDI, I think miracast is the only option? So, my bets are on this horse and I'm trying to make it run. Also, I'm new to this forum. If I post this at the wrong place, please forgive me. I created this thread for this specific model, because the manufacturer, Nubia, creates it's own (quite elaborate) UI on top of stock android. I suspect this could be part of the issue.
Summary so far
What I tried so far, is to install the custom recovery image of TWRP on my smartphone and adb + drivers on my windows 10 pc. Next I used the "mount" option in TWRP to enable adjustments of system files. The file I changed is the /system/build.prop file. I pulled the file using adb commands. Then changed the file on my pc and pushed it back to the phone. I will describe it in detail below. Yet, the sad thing is: it does not work. On another, older, model of the Nubia Z line, the Z9 mini, it did work.
Details
I installed drivers & adb/fastboot and twrp.
TWRP: https://forum.xda-developers.com/nubia-z18/development/recovery-twrp-nubia-z18nx606j-t3882098
Drivers & adb/fastboot: https://bbs.app.nubia.cn/forum.php?mod=viewthread&tid=1412934 (in chrome download didnt start for me, had to use firefox)
Once the above were installed, I connected my phone with the pc. I put phone settings in developer options to enable usb debugging. I got a notification to let my pc debug the phone, and accepted. Next I enabled "wireless display certification", "OEM unlocking" and set usb configuration to "MTP" instead of charging.
The adb on my pc was installed on my C:\adb\ folder. In the folder hold shift & right click, select open powershell or adb. I checked if my phone was connected using "adb devices". It listed my phone. So I went on and put it in fastboot mode (hold power + decrease volume). I checked if adb recognized fastboot with "fastboot devices". It listed my phone. Then next I unlocked the phone and installed TWRP with the help of this guide, from step 2 onwards: https://bbs.app.nubia.cn/forum.php?mod=viewthread&tid=1412934
Once TWRP installed. I created a backup of the phone through there. Then I selected the tab "mount" and enabled the system folder. Back to adb, I ran the command "adb devices" to see if my phone was listed, it was. Then I ran the command "adb pull /system/build.prop" that copied the build.prop file to my c:\adb folder. I made a reserve copy of the file and adjusted it with notepad++. These are the lines I added or enabled:
Then I pushed it back with the adb command: "adb push build.prop /system/build.prop". Rebooted the phone, tested the mirroring option, no luck. The phone runs on android 8.1.0, has the nubia V6.0 UI and the build number is NX606J_CNCommonV2.23. Any app whatsoever with a miracast option, will redirect to the system miracast settings. The following screen will appear: https://imgur.com/a/Otf1YO0
The Struggle
I read online several forums where they claimed that setting these was helping other phones to enable miracast. For the Z18 it did not work. I tried this with the Nubia Z9 mini. Miracast did not work on there before, now it does. The build.prop seems to persist fine now. For some reason, the first few attempts (attempt 1 & 2) wiped TWRP and the adjustments on the build.prop. Third time it kept working. TWRP however, still is wiped after a few reboots, but the build.prop file remains intact with the changes I made.
The Nubia Z9 mini has a few stock apps: "screen projection", "screen projection services" and "projection sink". It loads the screen projection app and allows to chose from project/receive and works flawlessly after the build.prop changes. The Z9 mini runs on android 5.1.1 and as Nubia UI V4.0 with build number: NX511J_INCommon_V4.0.4.
I read online that:
and
Yet, I've seen people make it work, by adjusting the build.prop, for later versions also. Not seen one working with android 8.0 or 8.1. Is it impossible for some reason / a hardware thing? If it's a software issue, surely it can be overcome?
I found that the build.prop in the Z9 mini contained the following lines:
I believe it's coupled to those apps I mentioned screen projection apps which are on the z9 mini. It had no effect adding these on the Z18. Now I'm attempting to find those apps and install them on Z18. Or looking for ways to downgrade the Z18 to android 5x. Ideally I do not want to downgrade the android. Any help, advice or questions are greatly appreciated.
Click to expand...
Click to collapse
Never try downgrading this phone. It's a nightmare because it's using AVB2.0 which was introduced with Android 8 I think. So getting that to work would be extremely difficult. What I'm not sure about is if nubia is doing anything different from other vendors as, judging by the source code, it looks the same as Sony for example (actually that's no wonder since they got 70% of their code from Sony).
What's difficult about this is that they define custom, vendor and device specific values as you can see with the Z9 build.prop. I'm not that well versed in Android actually and mostly just learning all this stuff by experimenting right now, but I would say your best bet would be some tool that scans a system for possible values in build.prop. However I'm unsure if such a tool exists unfortunately..
Sorry I can't be of more help as of now. I think Lineage is supporting Miracast though? So once I got that to work, it might be an option for you
Nubia z18 support screen cast without internet.
I use with EZcast 2.4g/5g without any internet and wifi hotspot.
I buy from Aliexpress " EZCAST 1080P TV Stick Dongle 5G Wifi Support HDMI DLNA Miracast Airplay DLNA Stick For IOS Android Windows Smartphone"
jagdishgeb said:
I use with EZcast 2.4g/5g without any internet and wifi hotspot.
I buy from Aliexpress " EZCAST 1080P TV Stick Dongle 5G Wifi Support HDMI DLNA Miracast Airplay DLNA Stick For IOS Android Windows Smartphone"
Click to expand...
Click to collapse
Thank you for the response, great to hear that it is possible! Did it work immediately?
Also, if you don't mind me asking. Could you maybe check if there are any default screen projection / sink apps pre-installed on your z18?
Mine came without any. I will try reinstall stock to see if that helps. All apps I use go to this screen: https://imgur.com/a/Otf1YO0
Online I read there are supposed to be options to enable wireless display in there. However, I think Nubia disabled it in their UI.

How To Guide Activate Native Call Recording Feature for ONEPLUS 9R (without Root)

Oneplus has started to put Google Dialer along with its new android updates. Although, Google Dialer has many functionalities but, it misses out the native call recording of Oneplus Dialer (without the annoying announcement of calls being recorded of the GOOGLE DIALER).
I tried searching all over the internet but could not get Here is the process of activating native call recording in Oneplus 9R.
Install native Oneplus dailer (you can download from the below link)
https://drive.google.com/file/d/1T4UhfxsmFytd8MTBYN7vZZeVWe8yFAvJ/view
(from https://forum.xda-developers.com/t/...th-call-recording-in-oneplus-8t-nord.4189165/)
Activate USB Debugging on your phone from the developer options.
Go to SETTINGS
ABOUT PHONE
tap few times on BUILD NUMBER before activating DEVELOPER OPTIONS
go back to SETTINGS
go to SYSTEM
DEVELOPER OPTIONS
and activate USB DEBUGGING
Install joneplus tools from Playstore
https://play.google.com/store/apps/details?id=net.jroot3d.joneplustools&hl=en&gl=US
Download Platform tools for android in WINDOWS
USE ADB instruction method from the PLATFORM TOOLS FOLDER
Check if you can find your phone or not
./adb devices
it should show the phone as listed.
after finding your phone as listed, type the following instruction
./adb shell settings put global op_voice_recording_supported_by_mcc 1
This will activate the native call recording feature of ONEPLUS DIALER.
However, the call recorder will be deactivated once you change the sim card or restart your phone. So, you need to install JONEPLUS TOOLS app from GOOGLE PLAYSTORE which will activate the call recording automatically every time you reboot your phone.
You need to provide the permission to joneplus tools by using ADB instruction
./adb shell pm grant net.jroot3d.joneplustools android.permission.WRITE_SECURE_SETTINGS
This will allow joneplus tools to automatically restart and activate the call recording every time the phone reboots. Finally, you will have call recording feature in your beloved ONEPLUS 9R.
Is there any method with root other than the axet call recorder & skvalex?
Thanks in advance.
It's weird, I'm getting the recording option right after installing the dialer apk without performing any adb command or installing any joneplus tool. It's staying Even after reboots, I'm on oos 11.2.LE28DA factory firmware, I'm not rooted and bootloader is locked.. it's weird..
Thanks a lot btw.. pretty useful for me..
Hi there,
OnePlus 9R is one of the most recent devices prior to the OnePlus 10 Pro that just received its global release.
Same thing there, comes with Google Dialer stock. The above apps work on that phone too, but jOnePlus Tools does not install, and the command ./adb shell settings put global op_voice_recording_supported_by_mcc 1 does not execute.
I made a post similar to yours on that forum, with the difference we are stuck without understanding why.
Could you please help us understand why this command does not work on our phones as compared to the Oneplus 9R?
It would help that community a lot.
Here's a link to my post:
Enable Native Call Recording + OP Stock Dialer on OnePlus 10 Pro
Hi guys, Just upgraded from OP7T to OP10 Pro as a European user. Call recording functionality does not come with the device here. Had native call recording enabled on my OP7T through jOnePlus Tools and the likes. Jtools Oneplus does not install...
forum.xda-developers.com
Thanks a lot in advance
Edit: Found a working solution. All I need now is to understand how to write a Tasker task to automate the adb command upon each reboot. This is what jOnePlus Tools normally took care of, but since we can't install it on that device..

How To Guide Dark room (i.e. icebox for bloatware)

Xiaomi, while way better than Huawei in terms of bootloader unlock support etc, still has an issue of bloatware. This is where Dark room comes in. It is a simple app that can run in various modes to disable apps that refuse to be disabled. This would be a nice GUI to disable apps. No more finding package names and uninstalling from adb!
Requirements: another computer or terminal emulator with adb
icebox app:https://www.coolapk.com/apk/web1n.stopapp
You DO NOT need to unlock your bootloader. This can all be done from adb. Just enable it in developer settings.
It supports multiple modes, including shizuku mode.
Be aware that while using device owner mode means it survives restarts, you would have to log out of all accounts on the device including the Xiaomi account, and other users (also called second space) will be deleted. You would have to log back in manually. The app developer has also included a support page for a GUI application which can set device owner (basically it inputs adb commands that delete accounts and then sets device owner)
https://stopapp.https.gs/nonroot.html
Bugs: DO NOT disable critical system apps. You will end up soft bricking your device. System reset is your only option now.

Categories

Resources