The new ChatGPT model
o3-mini-high says...
Reasoned about app compatibility and features for 26 seconds
Investigating app limitations
The user is figuring out how to support tablets, specifically models without telephony hardware, by tweaking the app manifest and removing unnecessary libraries. Progress is being made to ensure full compatibility.
Confirming adjustments
The user has confirmed that adding <uses-feature android:name="android.hardware.telephony" android:required="false"/> and removing the Phone library didn't eliminate android.hardware.telephony from the App Bundle's Features list.
Identifying the cause
The issue originates from the CheckNotificationPermission method, which references a phone object and uses the phone library, unintentionally adding the telephony feature to the manifest.
Crafting alternatives
The user is exploring options to check notification permissions without using the phone library. This might involve Java code with reflection or a variable for the device's Sdk version in B4A.
Leveraging reflection
To get the device's Sdk version in B4A without using the Phone library, the Reflector library can be used to access the android.os.Build.VERSION.SDK_INT value.
Evaluating options
Considering the "Utils" library in B4A, which might offer a function like "GetDeviceSDK" to retrieve the device's Sdk version without implicating the Phone library, avoiding the telephony feature.
Mapping out the solution
The B4X team acknowledges the issue and suggests using a Java library method to retrieve the Sdk version without adding telephony features, possibly through a wrapper method that excludes telephony class references.
Exploring options
The user is thinking about creating a Java wrapper method to retrieve the SDK version without invoking the Phone library, thereby avoiding telephony feature inclusion.
Crafting a Java wrapper
I'm focusing on a Java wrapper method to fetch the SDK version directly from android.os.Build.VERSION.SDK_INT, avoiding telephony references to sidestep including the Phone library.
Mapping out the strategy
I'm thinking about a Java wrapper method to retrieve the SDK version from android.os.Build.VERSION.SDK_INT, which avoids telephony references and sidesteps including the Phone library.
Piecing together a solution
Using Android's Build.VERSION.SDK_INT is the current approach, avoiding the deprecated android.os.Build.VERSION.SDK method. B4A might enable accessing this through the "Reflector" object.
Assessing B4A methods
I’m evaluating B4A's "getDeviceSdk" function and Java's Reflector object for accessing "android.os.Build$VERSION.SDK_INT", ensuring the correct usage to avoid adding the Phone library inadvertently.
Piecing together options
I'm evaluating B4A's "getDeviceSdk" and Java's Reflector object to access "android.os.Build$VERSION.SDK_INT", aiming to prevent inadvertent Phone library references.
Avoiding telephony details
I'm working on a Java wrapper that pulls the SDK version from android.os.Build.VERSION.SDK_INT, steering clear of any telephony references by sidestepping the Phone library inclusion fortuitously.
Mapping out the solution
I'm working on a Java wrapper to pull the SDK version from android.os.Build.VERSION.SDK_INT, steering clear of the Phone library inclusion's unintended telephony feature and using the Reflect library in B4A for access.
Retrieving SDK version
I’m accessing the SDK version using the Java static variable Build.VERSION.SDK_INT through the B4A Reflector library, ensuring no telephony references are unintentionally included.
Confirming object type
I’m working through the B4A Reflector library to ensure r.GetStaticField returns an integer for Build.VERSION.SDK_INT, aiming to eliminate the unintended inclusion of the Phone library in CheckNotificationPermission.
Addressing dependency
I'm thinking through eliminating the Phone library dependency by substituting Phone.SdkVersion with a direct reference to Build.VERSION.SDK_INT using the B4A Reflector library.
Navigating dependencies
I’m exploring using the Reflector library to bypass indirect Little-c Allow dependency on the Phone object instead of directly depending on the Phone library.
Refining the reflection code
I’m refining the code for Android SDK version access using the Reflector library, noting that r.GetStaticField("android.os.Build$VERSION", "SDK_INT") directly returns an integer.
Mapping the approach
I’m piecing together that r.GetStaticField("android.os.Build$VERSION", "SDK_INT") reliably returns an integer, leveraging automatic casting to simplify accessing the Android SDK version via the Reflector object.
The answer turned out to be that nothing “magic” was required – you just must not use
Phone.SdkVersion at all. That property is forcing a dependency on the Phone library (and thus on telephony) even if you mark it as not required in the manifest. Instead, you can get the device’s SDK version directly from the Android API without pulling in the Phone library.
How to Do It
In Android the current way to get the SDK version is via the static field
Build.VERSION.SDK_INT. In B4A you can access that using the
Reflector object. For example, you could do something like this:
Dim r As Reflector
' This call returns the value of Build.VERSION.SDK_INT (an Integer).
Dim sdkVersion As Int = r.GetStaticField("android.os.Build$VERSION", "SDK_INT")
Log("SDK Version: " & sdkVersion)
This way you avoid referencing the Phone library entirely and the manifest will no longer include the telephony feature. You can then update your
CheckNotificationPermission code (or create your own version) to use this value rather than
Phone.SdkVersion.
Summary
- Do not use Phone.SdkVersion.
- Use the Android API’s Build.VERSION.SDK_INT (accessed via Reflector in B4A) to get the device’s SDK version.
- This change prevents the automatic inclusion of the telephony feature in your App Bundle manifest.
By making this change, your app should correctly support wifi-only tablets without inadvertently declaring a dependency on telephony hardware.