How to write something on mobile's nvram? - android

I have very limited knowledge of Android NDK and I want to write something on NVRAM using NDK. I want to know:
If it is possible to write on NVRAM
If yes, then how (I didn't find anything on google)
If no, then do I need to make a customized operating system or any other solution?
The main goal is to lock the phone on a particular band e.g:
Lock LTE mode and then band 1 of LTE
Please share your thoughts.

You can lock your band user Network Signal Guru. In fact once you download the tool you execute the following
Select Menu ---> Lock Bands ---> Select LTE
Choose which Bands 1,2,4,5,40 etc..
Click Ok ---> Select Menu again ---select Lock RAT
Select LTE --> select ok
The mobile radio will powercycle once or twice but then your Band and LTE preference is locked and saved.

Related

Android 8.1 : 4G option not visible under Preferred Network type List in Network Settings UI

My desired options
I'm building AOSP x86 image from source, i see that after flashing the built oreo image to the target system, 4G (recommended) option shown in above image is not visible in the Preferred network type drop down list.
I have set ro.telephony.default_network=9 in device.mk as given below. This ro.telephony.default_network=9 is also reflected under build.prop of the target system.
PRODUCT_PROPERTY_OVERRIDES :=
ro.ril.hsxpa=1
ro.ril.gprsclass=10
keyguard.no_require_sim=true
ro.com.android.dataroaming=true
media.sf.hwaccel=1
media.sf.omx-plugin=libffmpeg_omx.so
media.sf.extractor-plugin=libffmpeg_extractor.so
rild.libpath=/vendor/lib64/librapid-ril-core.so
ro.telephony.default_network=9
I can see 4G (recommended) selected by default in Preferred network type, but if i click on Preferred network type menu and go inside i see only 3G and 2G Radio buttons.
4G (recommended) is missing in the drop down menu.
Once i select one of the 3G or 2G Radio button, there is no way i can switch back to 4G (recommended) which was selected by default by the OS.
NOTE: i'm successfully able to get 4G download speeds when 4G( recommended) selected by default in Preferred network type. Changing to 3G and 2G will successfully get respective speeds and able to see corresponding network type indicator icon in status bar. So functionally Internet data connectivity is working fine in all 3 modes (4G, 3G and 2G).
How to modify source files to make the 4G (recommended) radio button visible under Preferred network type as indicated in above attached image?
I'm not able to enter engineering mode by dialing *#*#4636#*#* (any answers to enable this also grateful)
Reference: http://paldan.altervista.org/lte-in-aosp-preferred-network-settings/
To enable 4g(recommended) radio under Preferred Network Type menu, you must set config_enabled_lte to true in packages/services/Telephony/res/values/config.xml
<bool name="config_enabled_lte" translatable="false">true</bool>

How to lock LTE_ONLY mode?

I am working on an application that has a requirement to lock the RAT on devices. I just want to lock only two modes i.e. "LTE Only" or "WCDMA Only".
We can do this without using an app from phone dial app by running ##4636## and choosing Phone Information and the "LTE Only" or "WCDMA Only".
I have also tried QXDM to set these values on NV Item 10 but it doesn't persist on reboot. So if some one have good knowledge of QXDM and share that knowledge then it would be really helpful.
My final goal is to do this from Android application that has root access.

Cast icon not showing for custom receiver

I have followed the CastHelloText-android example on github. When I use either the receiver they specified in the demo or the default receiver, the cast icon shows up in my application.
However, as soon as I change the app_id to be the one provided by the Google Cast SDK Developer Console for my registered application, the icon doesn't show.
I've tried rebooting my chromecast and my android device. All to no avail.
Any suggestions?
Make sure the serial number for the device that you have registered on the dev console is correct, it is sometimes hard to read the serial number (take a picture and zoom in). Also make sure the checkbox that sends the serial number is checked when you setup you chromecast. If cast icon doesn't show up for your own app-id but shows up for the other one, then there is an issue with your app/device registration.
I had the same issue as Kimble above. I started with the serial number on my Nvidia shield, which didn't work because that's not the serial number for the Chromecast. The proper serial number can be found in the settings menu under "Chromecast built-in".
I know I am late to the party, but here is a probably more up-to-date solution. Following this documentation solved my problem: https://developers.google.com/cast/docs/registration#find_device_serial_number
According to the documentation, for cast-enabled Android TVs, the serial number can be found in the following way:
Android TV (ATV) devices have multiple serial numbers associated with them. The software (Cast) serial number can be obtained either by casting the Cast Developer Console page to the ATV device as outlined above, or by putting the ATV device into developer mode and looking in the Cast settings for the software serial number.
To put your ATV device into developer mode, navigate to Settings > System > About > Android TV OS build, and click on the build several times until the device notifies you that you are in developer mode. To find the serial number once in developer mode, navigate either to Settings > Device Preferences > Chromecast built-in or Settings > System > Cast, depending on your ATV model, and you'll see the software serial number displayed.
Also, since just by looking at the screen there is no way to disambiguate zero and capital O, or small L and capital I, etc., you can simply cast the page in the link above to read out the serial number for you:
To find the serial number of any device, you can cast the Cast Developer Console page to the device:
Click the Cast button (as if you were casting this page).
The prompt displays Cast tab and lists the available devices.
From the drop-down menu, select the device for which you want to obtain the serial number.
For display devices, the serial number displays on the TV screen and is read aloud on the TV speakers (to help disambiguate 0's and O's).
For audio devices, the serial number is read aloud on the speaker being cast to.

Poll: Phone number in Android About -> Phone Identity and International Dialling Codes

Background; I am in the process of writing an Android messaging application that needs to know the current user's phone number. This is then used to connect to other users using the application.
My application relies on looking up the user's number from Android's Settings -> About Phone -> Phone identity -> Phone number (this can at times be blank.. but that is a separate problem).
I am assuming that the above Phone number contains the user's full number. ie, my UK Android phone shows my number as: +447832xxxxxxxx, where 44 is the UK's international dialling code and 7832 is the operator.
Is it safe to assume that all Androids phones would include the international dialling code, which starts with +?
I would be indebted if any Android users could have a quick look at their Android settings and confirm whether Phone number is displayed as +international code+operator+number, i.e. US Android sets start with +1xxxxxx.
TelephonyManager.getLine1Number() is not guaranteed to be correct or even available to applications. I'd suggest a backup plan of using SECURE_ID to match to some user entered, possibly text-message verified phone number on a server somewhere. But even SECURE_ID is sometimes not a unique identifier (all DROID2 phones have the same ID), which would mean you should rely on an account system of some sort.
In my phone (Nexus One, Android 2.2, O2 UK) I don't have Settings -> About Phone -> Phone identity. In Settings -> Status -> My phone number is "Unknown". Not sure this helps you though, sorry.
On my moto droid with 2.2 I have: Settings->About Phone->Status->My phone number. FYI it is not prefixed with +international code

Set Data roaming on/off

How could I programmatically set data roaming on/off in my android application ?
Apologies in advance for reopening a dead post but I have managed to achieve it by calling this executable:
su -c settings put global data_roaming0 1
Also to get the roaming setting for first SIM card:
su -c settings get global data_roaming0
If your app is signatureOrSystem/Privileged app (app resides in /system/priv-app) and your have valid android.permission.WRITE_SECURE_SETTINGS permission in system/etc/permissions. Then you can do it as below.
Enable :
Settings.Global.putInt(context.getContentResolver(), Settings.Global.DATA_ROAMING, 1)
Disable :
Settings.Global.putInt(context.getContentResolver(), Settings.Global.DATA_ROAMING, 0)
I hope that it's not possible to turn on data roaming programmatically as this would be a serious security issue from my point of view ...
Data roaming (i.e. UMTS data transfer via a foreign network) may result in a huge bill from your network provider - at least in europe.
If data roaming is currently on, then I think you can manipulate the Access Points Names in order to make it appear that a data service isn't available. See this post which also links to apndroid. You could browse their source and see the approach they have taken.
If data roaming has been set to off by the user, then this approach won't work. Though you could prompt users to turn it on as part of your install/setup process, which is the route apndroid take.
apndroid also provide an API for changing these kind of settings, which might be more convenient than reimplementing the same functionality.
On rooted devices when using su to enable data roaming, on multi sim devices the data roaming setting is sim specific.
So you need to get the sim number that is active for data calls
sim_num = settings get global multi_sim_data_call
and use this in the data_roaming + sim_num setting. EG sim_num 3
settings get global data_roaming3
if this is null then not multi sim device and use data_roaming otherwise use
settings put global data_roaming3
I was able to enable data roaming on my dual sim Motorola G8 without the need to root it via ADB. I'm posting here the procedure, because the phone has a bug that prevents data roaming from being enabled normally.
You need a computer and to install ADB installed
Enable developer mode and USB debugging in your phone
Connect the phone to the computer via USB and accept the debugging connection.
Start an "adb shell", be sure that it is correctly connected to your phone.
Issue the command
settings put global data_roaming1 1
to enable data roaming for SIM card 1, or
settings put global data_roaming2 1
to enable it for SIM 2
Note: if you do not have the USB cable, this can be done via wifi, but the pairing process is a bit complicated and version dependent.
If you do not have a computer, it may be possible to run the commands directly on the phone using a "local adb" app (there are a few on the play store), but I have not tested any.

Categories

Resources